diff --git a/src/DI/Container.php b/src/DI/Container.php index 2f38f918b..d2398cb57 100644 --- a/src/DI/Container.php +++ b/src/DI/Container.php @@ -369,4 +369,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 c5bad2448..14fab1b53 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; }