lint/phpunit/add-property-type-create-mock
In the lint-strict preset. In Rector’s rector/type-declaration set. Needs the phpunit extension. Unsafe fix: it can change behavior.
What it does
Add “PHPUnit\Framework\MockObject\MockObject” typed property from assigned mock to clearly separate from real objects
Configuration
[lint.rules]
"phpunit/add-property-type-create-mock" = "error"
To skip it in some files or lines, add an override or an ignore comment.
Replaces
TypedPropertyFromCreateMockAssign(rector)