Skip to content

Conversation

@samsonasik
Copy link
Member

Avoid error:

There was 1 failure:

1) Rector\PHPUnit\Tests\CodeQuality\Rector\CallLike\DirectInstanceOverMockArgRector\DirectInstanceOverMockArgRectorTest::test with data set #3 ('/Users/samsonasik/www/rector-...hp.inc')
assert(!$this->isFirstClassCallable())

/Users/samsonasik/www/rector-phpunit/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php:32
/Users/samsonasik/www/rector-phpunit/rules/CodeQuality/Rector/CallLike/DirectInstanceOverMockArgRector.php:108

Ref #609 (review)

@samsonasik
Copy link
Member Author

Fixed 🎉 /cc @TomasVotruba

@samsonasik
Copy link
Member Author

@TomasVotruba ready 👍I am merging it ;)

@samsonasik samsonasik merged commit f9c08fa into main Jan 26, 2026
7 checks passed
@samsonasik samsonasik deleted the skip-first branch January 26, 2026 12:49
return null;
}

if ($methodCall->isFirstClassCallable()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already handled here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, different position, parent method call, and arg as method call , see error

https://github.com/rectorphp/rector-phpunit/actions/runs/21358188769/job/61470545174

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, that's different call. Ok 👍

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