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

Respect proper case for namespaced functions #2673

Merged
merged 2 commits into from
Oct 10, 2023
Merged

Respect proper case for namespaced functions #2673

merged 2 commits into from
Oct 10, 2023

Conversation

fredden
Copy link
Contributor

@fredden fredden commented Oct 10, 2023

@phpstan-bot
Copy link
Collaborator

You've opened the pull request against the latest branch 1.11.x. If your code is relevant on 1.10.x and you want it to be released sooner, please rebase your pull request and change its target to 1.10.x.

@fredden fredden changed the base branch from 1.11.x to 1.10.x October 10, 2023 18:58
@fredden
Copy link
Contributor Author

fredden commented Oct 10, 2023

It looks like the tests on Windows aren't working because the mongodb PHP extension isn't available there. Is there an extension which can be used there which also demonstrates the bug?

@fredden fredden marked this pull request as ready for review October 10, 2023 19:19
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@ondrejmirtes
Copy link
Member

Thank you, I reused your regression test but did a different and correct fix. See the commit history in this PR: 0db2317

PHPStan cannot rely on runtime reflection because it's often wrong, and PHPStan also doesn't require PHP extensions to be loaded for successful analysis.

The fix I did will use the name from BetterReflection which takes it from jetbrains/phpstorm-stubs where it's correct: https://github.com/JetBrains/phpstorm-stubs/blob/master/mongodb/Monitoring/functions.php

@ondrejmirtes ondrejmirtes merged commit 967621f into phpstan:1.10.x Oct 10, 2023
70 checks passed
@fredden fredden deleted the issue-10003 branch October 10, 2023 21:07
@fredden
Copy link
Contributor Author

fredden commented Oct 10, 2023

Thanks for the quick turn-around on this @ondrejmirtes! Yes, that fix looks a lot cleaner than what I came up with. I had looked through that function while investigating the bug, but hadn't spotted that the real name was retrievable from there.

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.

Case mismatch for MongoDB\Driver\Monitoring\addSubscriber function
3 participants