mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #9318] Document PHPUnit mocks with intersection types #11522
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/doctrine/orm/pull/9318
State: closed
Merged: Yes
PHPUnit's
createMock()will return an object that extends the mocked type and implementsMockObjectat the same time. The accurate way to document this is an intersection type, but we often document a union type instead. This declaration is too wide because virtally any mock object would pass it.This might look nit-picking now, but it will become more important later when we try to infer native types from the docblock types in an automated manner.