Closed
Description
Symfony version(s) affected
5.4.9
Description
Similar problem as in #42342
With a framework.php
similar to the example shown at https://symfony.com/doc/current/http_client.html#scoping-client
// config/packages/framework.php
use Symfony\Config\FrameworkConfig;
return static function (FrameworkConfig $framework) {
$framework->httpClient()->scopedClient('github.client')
->scope('https://api\.github\.com')
->header('Accept', 'application/vnd.github.v3+json')
->header('Authorization', 'token %env(GITHUB_API_TOKEN)%')
;
};
...psalm is reporting:
PossiblyUndefinedMethod - config/packages/framework.php - Method Symfony\Config\FrameworkConfig::scopedClient does not exist
and PHPStan:
Call to an undefined method Symfony\Config\Framework\HttpClientConfig|Symfony\Config\FrameworkConfig::scopedClient().
Even though I do have public function scopedClient(string $name, $value = [])
in my var/cache/dev/Symfony/Config/Framework/HttpClientConfig.php
So it looks like adding this to phpstan.neon
isn't enough anymore:
scanDirectories:
- var/cache/dev/Symfony/Config
The same error is raised for other packages, e.g.:
- Call to an undefined method Symfony\Config\Twig\GlobalConfig|Symfony\Config\TwigConfig::value().
- Call to an undefined method Symfony\Config\Monolog\HandlerConfig|Symfony\Config\MonologConfig::type().
Was there a change recently?
How to reproduce
See above
Possible Solution
No response
Additional Context
No response