Преглед на файлове

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>
tags/v25.0.0beta1
Carl Schwan преди 2 години
родител
ревизия
7f899b3bc8
променени са 2 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 0
    1
      build/psalm-baseline.xml
  2. 3
    2
      lib/public/Server.php

+ 0
- 1
build/psalm-baseline.xml Целия файл

@@ -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>

+ 3
- 2
lib/public/Server.php Целия файл

@@ -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

Loading…
Отказ
Запис