File tree 2 files changed +8
-3
lines changed
Component/Generator/Definition
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 11
11
use PhpParser \NodeFinder ;
12
12
use PhpParser \ParserFactory ;
13
13
use Shopware \Core \Framework \DataAbstractionLayer \DefinitionInstanceRegistry ;
14
+ use Shopware \Core \Kernel ;
14
15
use Symfony \Component \Console \Style \SymfonyStyle ;
15
16
use Symfony \Component \Filesystem \Filesystem ;
16
17
@@ -25,9 +26,12 @@ class EntityLoader
25
26
*/
26
27
private $ instanceRegistry ;
27
28
28
- public function __construct (DefinitionInstanceRegistry $ instanceRegistry )
29
+ private Kernel $ kernel ;
30
+
31
+ public function __construct (DefinitionInstanceRegistry $ instanceRegistry , Kernel $ kernel )
29
32
{
30
33
$ this ->instanceRegistry = $ instanceRegistry ;
34
+ $ this ->kernel = $ kernel ;
31
35
}
32
36
33
37
public function load (string $ class , SymfonyStyle $ io ): Definition
@@ -194,8 +198,7 @@ private function normalizeName(string $class): string
194
198
195
199
private function getNewEntityFolder (string $ namespace ): string
196
200
{
197
- global $ classLoader ;
198
- $ prefixes = $ classLoader ->getPrefixesPsr4 ();
201
+ $ prefixes = $ this ->kernel ->getPluginLoader ()->getClassLoader ()->getPrefixesPsr4 ();
199
202
200
203
$ namespaceSplit = explode ('\\' , $ namespace );
201
204
unset($ namespaceSplit [count ($ namespaceSplit ) -1 ]);
Original file line number Diff line number Diff line change 15
15
<defaults >
16
16
</defaults >
17
17
18
+ <service id =" Shopware\Core\Kernel" alias =" kernel" />
19
+
18
20
<instanceof id =" Frosh\DevelopmentHelper\Component\Generator\QuestionHandler\QuestionHandlerInterface" >
19
21
<tag name =" frosh_development_helper.question_helper" />
20
22
</instanceof >
You can’t perform that action at this time.
0 commit comments