我在psalm的twig扩展中得到这个错误。
null, array{App\Twig\CartExtension&static, string(getOfferDate)} provided
The code in question is:
public function getFilters(): array
{
return [
new TwigFilter(
'get_offer_date',
[$this, 'getOfferDate']
)
];
}
And the TwigFilter signature is
/**
* @param callable|null $callable A callable implementing the filter. If null, you need to overwrite the "node_class" option to customize compilation.
*/
public function __construct(string $name, $callable = null, array $options = [])
...
The twig docs recommend this format
[$this, 'getOfferDate']
for the callable: https:
如何解决这个psalm错误或告诉psalm接受它?