@@ -182,12 +182,12 @@ public function afterCompile(ClassTypeGenerator $class)
182182 /** @hack This tries to add the event invokation right after the code, generated by NetteExtension. */
183183 $ foundNetteInitStart = $ foundNetteInitEnd = FALSE ;
184184 $ lines = explode ("; \n" , trim ($ init ->getBody () ?: '' ));
185- $ init ->setBody (NULL );
185+ $ init ->setBody ('' );
186186 while (($ line = array_shift ($ lines )) !== NULL ) {
187187 if ($ foundNetteInitStart && !$ foundNetteInitEnd &&
188188 stripos ($ line , 'Nette \\' ) === FALSE && stripos ($ line , 'set_include_path ' ) === FALSE && stripos ($ line , 'date_default_timezone_set ' ) === FALSE
189189 ) {
190- $ init ->addBody (GeneratorHelpers:: format (
190+ $ init ->addBody ( ( new \ Nette \ PhpGenerator \ Dumper )-> format (
191191 '$this->getService(?)->createEvent(?)->dispatch($this); ' ,
192192 $ this ->prefix ('manager ' ),
193193 [DIContainer::class, 'onInitialize ' ]
@@ -206,7 +206,7 @@ public function afterCompile(ClassTypeGenerator $class)
206206 }
207207
208208 if (!$ foundNetteInitEnd ) {
209- $ init ->addBody (GeneratorHelpers:: format (
209+ $ init ->addBody ( ( new \ Nette \ PhpGenerator \ Dumper )-> format (
210210 '$this->getService(?)->createEvent(?)->dispatch($this); ' ,
211211 $ this ->prefix ('manager ' ),
212212 [DIContainer::class, 'onInitialize ' ]
0 commit comments