phpstan-symfony icon indicating copy to clipboard operation
phpstan-symfony copied to clipboard

Symfony's FrameworkConfig methods not found

Open ThomasLandauer opened this issue 3 years ago • 3 comments

I just want to make you aware of https://github.com/symfony/symfony/issues/46546

In short: The workaround (scanDirectories) I added in https://github.com/phpstan/phpstan-symfony/pull/190 isn't working anymore.

So the question is: If the Symfony guys don't change anything, is there a change that this can get fixed in PHPStan? If no, I'd delete that workaround from the docs again, and recommend to exclude config/ from analysis.

ThomasLandauer avatar Jun 01 '22 20:06 ThomasLandauer

I am experiencing the same problem after updating.

arjanfrans avatar Jun 02 '22 14:06 arjanfrans

The generated config has changed to always include |static return type.

For example, FrameworkConfig.form changed between 6.0 and 6.1 to:

-    public function form(array $value = []): \Symfony\Config\Framework\FormConfig
+    /**
+     * form configuration
+     * @default {"enabled":false,"csrf_protection":{"enabled":null,"field_name":"_token"}}
+     * @return \Symfony\Config\Framework\FormConfig|$this
+     */
+    public function form(mixed $value = []): \Symfony\Config\Framework\FormConfig|static

marmichalski avatar Jun 16 '22 09:06 marmichalski

Any update on this?

DjordyKoert avatar Nov 29 '23 10:11 DjordyKoert