diff --git a/src/DI/Container.php b/src/DI/Container.php index 09518b571..2f38f918b 100644 --- a/src/DI/Container.php +++ b/src/DI/Container.php @@ -232,9 +232,7 @@ public function createService(string $name, array $args = []) /** * Resolves service by type. - * @template T - * @param class-string $type - * @return ?T + * @return object|null service * @throws MissingServiceException */ public function getByType(string $type, bool $throw = true) diff --git a/tests/DI/ContainerBuilder.resolve.Container.phpt b/tests/DI/ContainerBuilder.resolve.Container.phpt new file mode 100644 index 000000000..46a23fa63 --- /dev/null +++ b/tests/DI/ContainerBuilder.resolve.Container.phpt @@ -0,0 +1,34 @@ +getService('next'));