diff --git a/src/DI/Container.php b/src/DI/Container.php index 61edf727d..c51b9a367 100644 --- a/src/DI/Container.php +++ b/src/DI/Container.php @@ -363,4 +363,9 @@ public static function getMethodName(string $name): string return 'createService' . str_replace('.', '__', ucfirst($name)); } + + + public function initialize(): void + { + } } diff --git a/src/DI/PhpGenerator.php b/src/DI/PhpGenerator.php index d928a7e37..5ba0a0776 100644 --- a/src/DI/PhpGenerator.php +++ b/src/DI/PhpGenerator.php @@ -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; }