Skip to content

[PHPUnit120] Use Stub FQN in @var docblock#695

Merged
TomasVotruba merged 1 commit into
mainfrom
stub-fqn-in-var-docblock
Jun 29, 2026
Merged

[PHPUnit120] Use Stub FQN in @var docblock#695
TomasVotruba merged 1 commit into
mainfrom
stub-fqn-in-var-docblock

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Both MockObjectVarToStubRector (#689) and BareVarToStubIntersectionRector (#690) wrote the short Stub name into the @var docblock, which requires a use import to resolve.

This always emits the FQN \PHPUnit\Framework\MockObject\Stub instead, so no import check is needed and the type resolves regardless of imports.

 /**
- * @var FieldModel|Stub
+ * @var FieldModel|\PHPUnit\Framework\MockObject\Stub
  */
 private \PHPUnit\Framework\MockObject\Stub $leadFieldModel;

Fixtures and code samples updated. Tests, ECS, PHPStan, Rector all pass.

@TomasVotruba TomasVotruba merged commit 86396a5 into main Jun 29, 2026
8 checks passed
@TomasVotruba TomasVotruba deleted the stub-fqn-in-var-docblock branch June 29, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant