@@ -40,8 +40,6 @@ class InjectorGenerator
4040 private const INJECTOR_TEMPLATE = __DIR__ . '/../../templates/injector.template ' ;
4141 private const INDENTATION_SPACES = 4 ;
4242
43- private ConfigInterface $ config ;
44-
4543 /**
4644 * @deprecated
4745 *
@@ -68,12 +66,11 @@ class InjectorGenerator
6866 * and processed classes.
6967 */
7068 public function __construct (
71- ConfigInterface $ config ,
69+ private ConfigInterface $ config ,
7270 DependencyResolverInterface $ resolver ,
7371 ?string $ namespace = null ,
7472 ?LoggerInterface $ logger = null
7573 ) {
76- $ this ->config = $ config ;
7774 $ this ->namespace = $ namespace ? : 'Laminas\Di\Generated ' ;
7875 $ this ->factoryGenerator = new FactoryGenerator ($ config , $ resolver , $ this ->namespace . '\Factory ' );
7976 $ this ->autoloadGenerator = new AutoloadGenerator ($ this ->namespace );
@@ -113,7 +110,7 @@ private function generateFactoryList(array $factories): void
113110 {
114111 $ indentation = sprintf ("\n%s " , str_repeat (' ' , self ::INDENTATION_SPACES ));
115112 $ codeLines = array_map (
116- fn (string $ key , string $ value ): string =>
113+ static fn (string $ key , string $ value ): string =>
117114 sprintf ('%s => %s, ' , var_export ($ key , true ), var_export ($ value , true )),
118115 array_keys ($ factories ),
119116 $ factories
@@ -154,7 +151,7 @@ private function generateTypeFactory(string $class, array &$factories): void
154151
155152 private function generateAutoload (): void
156153 {
157- $ addFactoryPrefix = fn (string $ value ): string => 'Factory/ ' . $ value ;
154+ $ addFactoryPrefix = static fn (string $ value ): string => 'Factory/ ' . $ value ;
158155
159156 $ classmap = array_map ($ addFactoryPrefix , $ this ->factoryGenerator ->getClassmap ());
160157
0 commit comments