@@ -61,7 +61,8 @@ public function afterCompile(Nette\PhpGenerator\ClassType $class): void
61
61
});
62
62
}
63
63
64
- $ class ->inheritMethod ('getStaticParameters ' )
64
+ $ manipulator = new Nette \PhpGenerator \ClassManipulator ($ class );
65
+ $ manipulator ->inheritMethod ('getStaticParameters ' )
65
66
->addBody ('return ?; ' , [array_diff_key ($ builder ->parameters , $ dynamicParams )]);
66
67
67
68
if (!$ dynamicParams ) {
@@ -70,7 +71,7 @@ public function afterCompile(Nette\PhpGenerator\ClassType $class): void
70
71
71
72
$ resolver = new Nette \DI \Resolver ($ builder );
72
73
$ generator = new Nette \DI \PhpGenerator ($ builder );
73
- $ method = $ class ->inheritMethod ('getDynamicParameter ' );
74
+ $ method = $ manipulator ->inheritMethod ('getDynamicParameter ' );
74
75
$ method ->addBody ('return match($key) { ' );
75
76
foreach ($ dynamicParams as $ key => $ foo ) {
76
77
$ value = Helpers::expand ($ this ->config [$ key ] ?? null , $ builder ->parameters );
@@ -84,7 +85,7 @@ public function afterCompile(Nette\PhpGenerator\ClassType $class): void
84
85
$ method ->addBody ("\tdefault => parent::getDynamicParameter( \$key), \n}; " );
85
86
86
87
if ($ preload = array_keys ($ dynamicParams , true , true )) {
87
- $ method = $ class ->inheritMethod ('getParameters ' );
88
+ $ method = $ manipulator ->inheritMethod ('getParameters ' );
88
89
$ method ->addBody ('array_map($this->getParameter(...), ?); ' , [$ preload ]);
89
90
$ method ->addBody ('return parent::getParameters(); ' );
90
91
}
0 commit comments