我有以下代码:
namespace Some\Space\Utility;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
/**
* @psalm-template T
*/
class SomeAdapter
{
/**
* Some method
*
* @psalm-param iterable<int, T> $data
*
* @psalm-return Collection<int, T>
*/
public static function doSomething($data): Collection
{
if (is_array($data)) {
$data = new ArrayCollection($data);
}
return $data;
}
}
可能我错过了一些东西,但我收到以下错误@psalm-param
:
psalm: UndefinedDocblockClass: Docblock定义的类或接口Some\Space\Utility\T不存在