psalm / psalm-plugin-symfony

Psalm Plugin for Symfony
MIT License
228 stars 53 forks source link

Fix using service locators with int keys #337

Closed HypeMC closed 6 months ago

HypeMC commented 6 months ago

Currently, the plugin breaks when an integer key is used in a service locator, even though that is valid and works as expected:

Psalm\SymfonyPsalmPlugin\Tests\Symfony\ContainerMetaTest::testServices with data set #0 ('service_container', 'Symfony\Component\DependencyI...erface', true)
TypeError: Psalm\SymfonyPsalmPlugin\Symfony\ContainerMeta::addServiceLocator(): Argument #2 ($id) must be of type string, int given, called in /psalm-plugin-symfony/src/Symfony/ContainerMeta.php on line 123