-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Symfony version(s) affected
7.2.3
Description
I tried to use the FrameworkConfig class in a Symfony PHP configuration, but PHPStan complains about it. I am happy to provide a fix, once I know how that should look like.
How to reproduce
When I have a configuration file like the following:
<?php
declare(strict_types=1);
use Symfony\Config\FrameworkConfig;
return static function(FrameworkConfig $framework): void
{
$framework->router()
->strictRequirements(true)
;
};PHPStan complains with an error like the following:
------ ---------------------------------------------------------------------------------------------
Line config/packages/routing.php
------ ---------------------------------------------------------------------------------------------
9 Call to an undefined method
Symfony\Config\Framework\RouterConfig|Symfony\Config\FrameworkConfig::strictRequirements().
🪪 method.notFound
------ ---------------------------------------------------------------------------------------------
A similar thing is happening with $framework->session(). I am not sure why it is only happening for some of the methods though.
Possible Solution
Fix the return type of the generated FrameworkConfig file to work properly with PHPStan.
Additional Context
No response