Skip to content

Commit

Permalink
Merge pull request #50908 from nextcloud/chore/server-annotations
Browse files Browse the repository at this point in the history
chore: Adjust `OCP\Server::get` annotation to work with phpstan
  • Loading branch information
susnux authored Feb 27, 2025
2 parents 8f28fa2 + 28ce57d commit 6900ac9
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/public/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* use whenever possible dependency injections instead.
*
* ```php
* use OCP\ITagManager;
* use OCP\Server;
*
* $tagManager = Server::get(ITagManager::class);
Expand All @@ -24,12 +25,9 @@
*/
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
Expand Down

0 comments on commit 6900ac9

Please sign in to comment.