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

Allow setting Symfony's version explicitly #351

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

HypeMC
Copy link
Contributor

@HypeMC HypeMC commented Jun 20, 2024

I have Psalm installed globally and use it for different projects, each with different versions of Symfony. One problem I'm facing is that the plugin determines the version of Symfony by using the Kernel::MAJOR_VERSION constant, which means it will always use the globally installed version. As a result, it might not use the correct stubs for the specific version needed.

The same issue occurs when using the composer-bin-plugin. This PR allows configuring the version explicitly in the XML file:

<pluginClass class="Psalm\SymfonyPsalmPlugin\Plugin">
    <symfonyMajorVersion>6</symfonyMajorVersion>
</pluginClass>

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 465f8e2 into psalm:5.x Jun 20, 2024
9 checks passed
@HypeMC HypeMC deleted the symfony-version branch June 20, 2024 20:41
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