Limitations¶
This page documents known analyzer boundaries, supported version floors, and the Semantic Versioning policy for friendsofmago/mago-mockery.
Known analyzer limitations¶
- Intersection-to-intersection argument checks. Mago 1.60.2 through 1.62.0 accepts
Mockery::mock(ApiClient::class)for a parameter typedGreeter&Mockery\MockInterface. Mago does not yet compare intersection types member by member.tests/fixtures/Negative.phppins this case. - Direct calls to mocked protected methods. Calling a
protectedmethod directly on a mock after->makePartial()->shouldAllowMockingProtectedMethods()reports Mago'sinvalid-method-access, ornon-documented-methodwhen the class defines__call(). Mago 1.60.2 through 1.62.0 does not expose receiver types toIssueFilterContext, so the extension does not suppress those diagnostics. Filtering by source text would also hide real visibility bugs on non-mocks. - Opt-in strict method checks. The extension checks literal and higher-order method names only when you set
MAGO_MOCKERY_STRICT_METHODSto1,true,yes, oron, or passstrictMockedMethods: truetoMockeryExtension::plugins(). Without strict mode,shouldReceive('doesNotExist')andshouldReceive()->doesNotExist()stay silent. With strict mode, each unknown higher-order call reports onemockery/unknown-mocked-methoddiagnostic. - Strict allowance flow boundaries. In strict mode,
shouldAllowMockingMethod()silencesmockery/unknown-mocked-methodonly when you call it on the same local variable or straight-line$this->property. The call must dominate the expectation without a reassignment,unset(),$thisalias, by-reference mutation, helper reset, or unmerged branch.
Compatibility and SemVer policy¶
friendsofmago/mago-mockery follows Semantic Versioning from 1.0.0.
- Public PHP API.
MagoMockery\MockeryExtension::create()andMagoMockery\MockeryExtension::plugins()are the supported PHP entry points. All classes underMagoMockery\Analyzercarry@internaland may change without a major version bump. - Worker CLI.
vendor/bin/mago-mockery-worker, frombin/mago-mockery-worker, andresources/worker.phpare supported worker entry points.stdoutcarries the Mago extension protocol. Diagnostics and warnings go tostderr. - Diagnostic codes.
mockery/unknown-mocked-methodis the only extension-owned analyzer diagnostic code and stays opt-in. Adding a new default-on diagnostic is a minor bump. Changing the meaning of an existing code, removing a code, or enabling an opt-in check by default is a major bump. - Suppression. Project-wide
[analyzer] ignore = ["mockery/unknown-mocked-method"]and per-call// @mago-ignore analysis:mockery/unknown-mocked-methodremain supported.
Supported version floors¶
| Dependency | Supported floor | Tested in CI |
|---|---|---|
| PHP | ^8.1 |
8.1, 8.2, 8.3, 8.4, 8.5 |
carthage-software/mago |
^1.60.2 |
1.60.2, 1.61.0, 1.62.0, latest |
mockery/mockery |
^1.6 |
^1.6 |