Skip to content

Fix ObjectType resolving inside bound Closure#1543

Merged
ondrejmirtes merged 2 commits intophpstan:1.8.xfrom
herndlm:fix-7675
Jul 24, 2022
Merged

Fix ObjectType resolving inside bound Closure#1543
ondrejmirtes merged 2 commits intophpstan:1.8.xfrom
herndlm:fix-7675

Conversation

@herndlm
Copy link
Copy Markdown
Contributor

@herndlm herndlm commented Jul 24, 2022

Closes phpstan/phpstan#7675

This is my first time dealing with this dynamic Closure binding, but I guess this make sense. Previously it would lead incorrectly to a ThisType because $originalClass === $this->getClassReflection()->getName() evaluates to true if $originalClass is the one where the Closure bind is in.

@herndlm
Copy link
Copy Markdown
Contributor Author

herndlm commented Jul 24, 2022

hmm I see the same 3 failures (with more errors) in the non-falsy-string PR, so they should be unrelated 🤞 but this needs to be double-checked and I have actually no clue where the came from (weren't there still a couple of days ago?)..
UPDATE: the true pseudotype PR seems to be having the same failures, so I really assume they're fine..

@herndlm herndlm marked this pull request as ready for review July 24, 2022 18:48
@ondrejmirtes ondrejmirtes merged commit a6950a1 into phpstan:1.8.x Jul 24, 2022
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you!

1 similar comment
@szepeviktor
Copy link
Copy Markdown
Contributor

Thank you!

@herndlm herndlm deleted the fix-7675 branch July 24, 2022 20:32
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.

Incorrect class in closure for Closure::bind

3 participants