Skip to content

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

@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