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

[Naming] Reduce instanceof ObjectType on ExpectedNameResolver (take 5) #6423

Merged
merged 2 commits into from
Nov 12, 2024

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik commented Nov 12, 2024

isObjectType()->yes() not always working, see #6422 (comment) for reasoning, that cause error:

2) Rector\Tests\DeadCode\Rector\If_\RemoveDeadInstanceOfRector\RemoveDeadInstanceOfRectorTest::test with data set #21 ('/home/runner/work/rector-src/...hp.inc')
Error: Call to undefined method PHPStan\Type\UnionType::isInstanceOf()

see https://github.com/rectorphp/rector-src/actions/runs/11798721617/job/32865546672?pr=6422#step:5:110

use instanceof ObjectType but reduce its usage.

Ref rectorphp/rector#8815 (comment)

@samsonasik samsonasik changed the title [Naming] Reduce instanceof ObjectType on ExpectedNameResolver [Naming] Reduce instanceof ObjectType on ExpectedNameResolver (take 5) Nov 12, 2024
@TomasVotruba
Copy link
Member

Just a quick question: are these objects removed in PHPStan 2? If not, we can ignore this error in phpstan.neon and move to next issues.
I recall they were breaking from the start as we use them in more advanced way.

@samsonasik
Copy link
Member Author

it is not removed, just deprecated the usage, I think yes, I agree, we can just ignore it as this got too many too handle, and then variable of its usage needs to be covered.

I will merge this as for now, and look if there is next issues.

@samsonasik samsonasik merged commit 26b8b54 into main Nov 12, 2024
36 checks passed
@samsonasik samsonasik deleted the reduce-object branch November 12, 2024 14:17
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.

3 participants