0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-03-15 00:43:23 +00:00

chore: Adjust OCP\Server::get annotation to work with phpstan

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
Ferdinand Thiessen 2025-02-19 16:50:16 +01:00
parent bdc043dd04
commit 28ce57d0f4
No known key found for this signature in database
GPG key ID: 45FAE7268762B400

View file

@ -15,6 +15,7 @@ use Psr\Container\NotFoundExceptionInterface;
* use whenever possible dependency injections instead.
*
* ```php
* use OCP\ITagManager;
* use OCP\Server;
*
* $tagManager = Server::get(ITagManager::class);
@ -24,12 +25,9 @@ use Psr\Container\NotFoundExceptionInterface;
*/
final class Server {
/**
* @template T
* @param class-string<T>|string $serviceName
* @return T|mixed
* @psalm-template S as class-string<T>|string
* @psalm-param S $serviceName
* @psalm-return (S is class-string<T> ? T : mixed)
* @psalm-template T
* @psalm-param class-string<T>|string $serviceName
* @psalm-return ($serviceName is class-string<T> ? T : mixed)
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @since 25.0.0