Open michnovka opened 2 months ago
I did check for any stubs used, but in the whole project there is no stub for TwigFilter class. I do use psalm/plugin-symfony
v 5.1.0, but this stub is not there. So Id assume it reads signature from the source code (vendor/twig/twig/src/TwigFilter.php
)
Also please note that this syntax is in line with official Symfony docs for Lazy loaded twig extensions
This error is showing up on more places now. E.g. in the Syfony\Console\Command\Command::setCode() function.
ERROR: InvalidArgument - src/Command/AbstractEndlessCommand.php:55:25 - Argument 1 of Symfony\Component\Console\Command\Command::setCode expects a public callable, but a non-public callable provided (see https://psalm.dev/004)
parent::setCode([$this, 'runloop']);
when I use protected
modifier for function runloop. I repeat, there is no psalm param specification requiring that the callable should be public, nonstatic or whatever. Only callable. And I am unable to reproduce this on psalm.dev - https://psalm.dev/r/3c405968f1
Version 5.23 works just fine
I found these snippets:
Aha, the reason why I cannot reproduce this issue on psalm.dev is because it uses this version:
Which does not contain the breaking PR #10839
@weirdan can you please look into this, as you reviewed the change and also it seems you are in charge of merging code into master branch, which is what psalm.dev uses?
You can close the issue because it's already fixed in https://github.com/vimeo/psalm/pull/10935.
Just wait for a new release.
The issue from the initial message here is resolved, but the issue with setting protected function remains. Should I close this one and open a new one, or keep this one open?
See https://github.com/vimeo/psalm/pull/10935#issuecomment-2182247241
Getting this error:
With the below code
Note that the TwigFilter source does not specify static nor public property for callable:
I am unable to reproduce this on psalm.dev
I am getting this on all projects with psalm 5.24, but it works fine with 5.23