Deprecate `\Mockery` matcher static factory methods
Author: ghostwriterCreated Sep 5, 2026Updated Sep 5, 2026
LabelsMinorDeprecated
[!WARNING] The following static factory methods on the
\Mockeryclass are planned for deprecation in1.7.0and removal in2.0.0.
| Deprecated | Replacement |
|---|---|
\Mockery::andAnyOtherArgs() |
\Mockery\Argument::andAnyOtherArgs() |
\Mockery::andAnyOthers() |
\Mockery\Argument::andAnyOthers() |
\Mockery::any() |
\Mockery\Argument::any() |
\Mockery::anyOf() |
\Mockery\Argument::anyOf() |
\Mockery::capture() |
\Mockery\Argument::capture() |
\Mockery::contains() |
\Mockery\Argument::contains() |
\Mockery::ducktype() |
\Mockery\Argument::ducktype() |
\Mockery::hasKey() |
\Mockery\Argument::hasKey() |
\Mockery::hasValue() |
\Mockery\Argument::hasValue() |
\Mockery::isEqual() |
\Mockery\Argument::isEqual() |
\Mockery::isSame() |
\Mockery\Argument::isSame() |
\Mockery::mustBe() |
\Mockery\Argument::mustBe() |
\Mockery::not() |
\Mockery\Argument::not() |
\Mockery::notAnyOf() |
\Mockery\Argument::notAnyOf() |
\Mockery::on() |
\Mockery\Argument::on() |
\Mockery::pattern() |
\Mockery\Argument::pattern() |
\Mockery::subset() |
\Mockery\Argument::subset() |
\Mockery::type() |
\Mockery\Argument::type() |
[!IMPORTANT] The
\Mockerystatic factory methods will remain available throughout the deprecation period to avoid unnecessarily breaking existing test suites.Their existing behavior will remain unchanged during this period.
[!TIP] The
[mockery/rector-extension]package will provide automated migration of existing test suites from the deprecated\Mockerystatic factory methods to the corresponding\Mockery\Argumentstatic factory methods.
Source: mockery/mockery