Skip to content

Commit

Permalink
Container: added initialize()
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Sep 22, 2023
1 parent eee7ad0 commit a79310a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/DI/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,4 +363,9 @@ public static function getMethodName(string $name): string

return 'createService' . str_replace('.', '__', ucfirst($name));
}


public function initialize(): void
{
}
}
3 changes: 2 additions & 1 deletion src/DI/PhpGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ public function generate(string $className): Php\ClassType
->setReturnType($className)
->setBody('return $this;');

$class->addMethod('initialize');
$class->addMethod('initialize')
->setReturnType('void');

return $class;
}
Expand Down

0 comments on commit a79310a

Please sign in to comment.