12
12
namespace Symfony \Bundle \MakerBundle \Maker ;
13
13
14
14
use Doctrine \Bundle \DoctrineBundle \DoctrineBundle ;
15
- use Doctrine \Inflector \InflectorFactory ;
16
15
use Sensio \Bundle \FrameworkExtraBundle \Configuration \ParamConverter ;
17
16
use Symfony \Bundle \FrameworkBundle \Controller \AbstractController ;
18
17
use Symfony \Bundle \MakerBundle \ConsoleStyle ;
31
30
use Symfony \Component \Form \AbstractType ;
32
31
use Symfony \Component \Routing \Annotation \Route ;
33
32
use Symfony \Component \Security \Csrf \CsrfTokenManager ;
33
+ use Symfony \Component \String \Inflector \EnglishInflector ;
34
34
use Symfony \Component \Validator \Validation ;
35
35
36
36
/**
@@ -50,7 +50,8 @@ public function __construct(DoctrineHelper $doctrineHelper, FormTypeRenderer $fo
50
50
{
51
51
$ this ->doctrineHelper = $ doctrineHelper ;
52
52
$ this ->formTypeRenderer = $ formTypeRenderer ;
53
- $ this ->inflector = InflectorFactory::create ()->build ();
53
+
54
+ $ this ->inflector = new EnglishInflector ();
54
55
}
55
56
56
57
public static function getCommandName (): string
@@ -120,7 +121,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
120
121
$ repositoryVars = [
121
122
'repository_full_class_name ' => $ repositoryClassDetails ->getFullName (),
122
123
'repository_class_name ' => $ repositoryClassDetails ->getShortName (),
123
- 'repository_var ' => lcfirst ($ this ->inflector ->singularize ($ repositoryClassDetails ->getShortName ())),
124
+ 'repository_var ' => lcfirst ($ this ->inflector ->singularize ($ repositoryClassDetails ->getShortName ())[ 0 ] ),
124
125
];
125
126
}
126
127
@@ -140,8 +141,8 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
140
141
++$ iter ;
141
142
} while (class_exists ($ formClassDetails ->getFullName ()));
142
143
143
- $ entityVarPlural = lcfirst ($ this ->inflector ->pluralize ($ entityClassDetails ->getShortName ()));
144
- $ entityVarSingular = lcfirst ($ this ->inflector ->singularize ($ entityClassDetails ->getShortName ()));
144
+ $ entityVarPlural = lcfirst ($ this ->inflector ->pluralize ($ entityClassDetails ->getShortName ())[ 0 ] );
145
+ $ entityVarSingular = lcfirst ($ this ->inflector ->singularize ($ entityClassDetails ->getShortName ())[ 0 ] );
145
146
146
147
$ entityTwigVarPlural = Str::asTwigVariable ($ entityVarPlural );
147
148
$ entityTwigVarSingular = Str::asTwigVariable ($ entityVarSingular );
0 commit comments