summaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework/Utility
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2022-07-28 07:50:17 +0200
committerJulius Härtl <jus@bitgrid.net>2022-10-14 10:45:16 +0200
commitcea2f79bbd02ba9eafa9993baa513ce8900d9f3f (patch)
treed0773ba1390941c0d4c82d41c64ce74e9805236e /lib/private/AppFramework/Utility
parentf49ccd140fd5ada0aa640f6642464ad149c980e6 (diff)
downloadnextcloud-server-cea2f79bbd02ba9eafa9993baa513ce8900d9f3f.tar.gz
nextcloud-server-cea2f79bbd02ba9eafa9993baa513ce8900d9f3f.zip
Improve container return type annotations
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private/AppFramework/Utility')
-rw-r--r--lib/private/AppFramework/Utility/SimpleContainer.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/private/AppFramework/Utility/SimpleContainer.php b/lib/private/AppFramework/Utility/SimpleContainer.php
index 429382aa223..da1efdec826 100644
--- a/lib/private/AppFramework/Utility/SimpleContainer.php
+++ b/lib/private/AppFramework/Utility/SimpleContainer.php
@@ -53,6 +53,15 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer {
$this->container = new Container();
}
+ /**
+ * @template T
+ * @param class-string<T>|string $id
+ * @return T|mixed
+ * @psalm-template S as class-string<T>|string
+ * @psalm-param S $id
+ * @psalm-return (S is class-string<T> ? T : mixed)
+ * @throws QueryException
+ */
public function get(string $id) {
return $this->query($id);
}