Skip to content

Respect proper case for namespaced functions - #2673

Merged
ondrejmirtes merged 2 commits into
phpstan:1.10.xfrom
fredden:issue-10003
Oct 10, 2023
Merged

Respect proper case for namespaced functions#2673
ondrejmirtes merged 2 commits into
phpstan:1.10.xfrom
fredden:issue-10003

Conversation

@fredden

@fredden fredden commented Oct 10, 2023

Copy link
Copy Markdown
Contributor

@phpstan-bot

Copy link
Copy Markdown
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

fredden commented Oct 10, 2023

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Collaborator

This pull request has been marked as ready for review.

@ondrejmirtes

Copy link
Copy Markdown
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

@fredden

fredden commented Oct 10, 2023

Copy link
Copy Markdown
Contributor Author

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