From 935c2416b515aeebeba31c96bef203c1221743e0 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Mon, 16 Feb 2026 09:13:54 +0100 Subject: [PATCH] fix(IContainer): Override get method with better type annotations Signed-off-by: provokateurin --- lib/public/IContainer.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/public/IContainer.php b/lib/public/IContainer.php index 22d867c1acc..71f31032906 100644 --- a/lib/public/IContainer.php +++ b/lib/public/IContainer.php @@ -25,6 +25,20 @@ use Psr\Container\NotFoundExceptionInterface; * @deprecated 20.0.0 use \Psr\Container\ContainerInterface */ interface IContainer extends ContainerInterface { + /** + * Finds an entry of the container by its identifier and returns it. + * + * @template T + * @param class-string|string $id Identifier of the entry to look for. + * + * @throws NotFoundExceptionInterface No entry was found for **this** identifier. + * @throws ContainerExceptionInterface Error while retrieving the entry. + * + * @return ($id is class-string ? T : mixed) Entry. + * @since 34.0.0 + */ + public function get(string $id); + /** * @template T * @@ -33,7 +47,7 @@ interface IContainer extends ContainerInterface { * @param class-string|string $name * @return ($name is class-string ? T : mixed) * @since 8.2.0 - * @deprecated 20.0.0 use \Psr\Container\ContainerInterface::get + * @deprecated 20.0.0 use {@see self::get()} * @throws ContainerExceptionInterface if the class could not be found or instantiated */ public function resolve(string $name): mixed; @@ -48,7 +62,7 @@ interface IContainer extends ContainerInterface { * @throws ContainerExceptionInterface if the query could not be resolved * @throws NotFoundExceptionInterface if the name could not be found within the container * @since 6.0.0 - * @deprecated 20.0.0 use \Psr\Container\ContainerInterface::get + * @deprecated 20.0.0 use {@see self::get()} */ public function query(string $name, bool $autoload = true): mixed;