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 21, 2023
1 parent dc0e9f7 commit 5fcc06d
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 @@ -369,4 +369,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 5fcc06d

Please sign in to comment.