Skip Doctrine repositories in NoDocumentMockingRule by TomasVotruba · Pull Request #372 · symplify/phpstan-rules · GitHub
Skip to content

Skip Doctrine repositories in NoDocumentMockingRule - #372

Merged
TomasVotruba merged 1 commit into
mainfrom
skip-repository-document-mocking
Oct 14, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
skip-repository-document-mocking

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

NoDocumentMockingRule flagged any createMock() of a class whose FQCN contains \Entity\ or \Document\. Repositories living in an Entity namespace (e.g. Mautic\LeadBundle\Entity\TagRepository) got flagged too, even though they are not entities/documents.

Skip classes that extend Doctrine\ORM\EntityRepository or Doctrine\ODM\MongoDB\Repository\DocumentRepository.

@TomasVotruba
TomasVotruba merged commit 2871fcc into main Oct 14, 2026
9 checks passed
@TomasVotruba
TomasVotruba deleted the skip-repository-document-mocking branch October 14, 2026 16:00
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.

1 participant