Improve psalm annotation to make it stricter

Now using class-string<T> as input will only return T, and any other
string will return mixed

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
pull/32384/head
Carl Schwan 2022-05-13 16:14:01 +07:00
parent f4058a2432
commit 7f899b3bc8
2 changed files with 3 additions and 3 deletions

@ -1371,7 +1371,6 @@
</InvalidReturnType>
</file>
<file src="apps/files_external/lib/Lib/Storage/SMB.php">
<InvalidPropertyAssignmentValue occurrences="1"/>
<InvalidScalarArgument occurrences="7">
<code>$e-&gt;getCode()</code>
<code>$e-&gt;getCode()</code>

@ -41,8 +41,9 @@ use Psr\Container\NotFoundExceptionInterface;
final class Server {
/**
* @template T
* @param class-string<T>|string $serviceName
* @return T|mixed
* @template S as class-string<T>|string
* @param S $serviceName
* @return (S is class-string<T> ? T : mixed)
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @since 25.0.0