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

[TypeDeclaration] Add ReturnTypeFromMockObjectRector #6166

Merged
merged 1 commit into from
Jul 21, 2024

Conversation

TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented Jul 21, 2024

This is easy-pick rule that addes known MockObject types in tests. It's run early, as removed mixed and intersection types in PHPUnit tests

@TomasVotruba TomasVotruba force-pushed the tv-return-mock-object branch 2 times, most recently from 63b4b0e to 48c3f4f Compare July 21, 2024 22:25
@TomasVotruba TomasVotruba merged commit 5eb07c4 into main Jul 21, 2024
34 checks passed
@TomasVotruba TomasVotruba deleted the tv-return-mock-object branch July 21, 2024 22:29
return false;
}

return in_array(MockObject::class, $type->getObjectClassNames());
Copy link
Member

Choose a reason for hiding this comment

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

use string constant to avoid prefixed on downgrade

Suggested change
return in_array(MockObject::class, $type->getObjectClassNames());
return in_array(self::MOCK_OBJECT_CLASS, $type->getObjectClassNames());

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.

2 participants