Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix using service locators with int keys #337

Merged
merged 4 commits into from
Jun 5, 2024

Conversation

HypeMC
Copy link
Contributor

@HypeMC HypeMC commented Jun 4, 2024

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

Copy link
Member

@seferov seferov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HypeMC thank you!

@seferov seferov merged commit faf9050 into psalm:5.x Jun 5, 2024
6 of 8 checks passed
@HypeMC HypeMC deleted the fix-service-locator-int-key branch June 5, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants