Skip to content

Commit

Permalink
fix Nette\PhpGenerator\Helpers::format() is deprecated
Browse files Browse the repository at this point in the history
   E_USER_DEPRECATED: Nette\PhpGenerator\Helpers::format() is deprecated, use (new Nette\PhpGenerator\Dumper)->format().
  • Loading branch information
Jakub-Fajkus committed Mar 15, 2022
1 parent dc014c0 commit 7d3e386
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Events/DI/EventsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public function afterCompile(ClassTypeGenerator $class)
if ($foundNetteInitStart && !$foundNetteInitEnd &&
stripos($line, 'Nette\\') === FALSE && stripos($line, 'set_include_path') === FALSE && stripos($line, 'date_default_timezone_set') === FALSE
) {
$init->addBody(GeneratorHelpers::format(
$init->addBody( (new \Nette\PhpGenerator\Dumper)->format(
'$this->getService(?)->createEvent(?)->dispatch($this);',
$this->prefix('manager'),
[DIContainer::class, 'onInitialize']
Expand All @@ -206,7 +206,7 @@ public function afterCompile(ClassTypeGenerator $class)
}

if (!$foundNetteInitEnd) {
$init->addBody(GeneratorHelpers::format(
$init->addBody( (new \Nette\PhpGenerator\Dumper)->format(
'$this->getService(?)->createEvent(?)->dispatch($this);',
$this->prefix('manager'),
[DIContainer::class, 'onInitialize']
Expand Down

0 comments on commit 7d3e386

Please sign in to comment.