Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL).
This report summarizes scanner evidence for mockery/mockery, a PHP project with 10,723 GitHub stars. SynthScan examined 33,878 lines of code across 415 source files, recording 656 pattern matches distributed across 4 syntactic categories. The legacy adjusted pattern signal is 15.5 (Elevated pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 655 finding(s).
Are imports declared and package/API names verified? 1 finding(s).
Are wrappers, guards, and repeated structures necessary? 644 finding(s).
Which changes need focused human review? 656 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 656 distinct pattern matches across 4 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/Unit/AbstractTestCase.php | 35 | protected function assertInvalidCountExceptionMessage( | CODE |
| LOW | tests/Unit/PHP81/Php81LanguageFeaturesTest.php | 52 | public function testCanMockClassesThatImplementSerializable(): void | CODE |
| LOW | tests/Unit/PHP81/Php81LanguageFeaturesTest.php | 62 | public function testItCanMockAClassWithANeverReturningTypeHint(): void | CODE |
| LOW | tests/Unit/PHP81/Php81LanguageFeaturesTest.php | 75 | public function testItCanMockAClassWithANeverReturningTypeHintWithExit(): void | CODE |
| LOW | tests/Unit/PHP81/Php81LanguageFeaturesTest.php | 100 | public function testItCanMockAClassWithAnIntersectionArgumentTypeHint(): void | CODE |
| LOW⚡ | tests/Unit/PHP81/Php81LanguageFeaturesTest.php | 116 | public function testItCanMockAClassWithReturnTypeWillChangeAttributeAndNoReturnType(): void | CODE |
| LOW⚡ | tests/Unit/PHP81/Php81LanguageFeaturesTest.php | 126 | public function testItCanMockAClassWithReturnTypeWillChangeAttributeAndWrongReturnType(): void | CODE |
| LOW⚡ | tests/Unit/PHP81/Php81LanguageFeaturesTest.php | 136 | public function testItCanMockAnInternalClassWithTentativeReturnTypes(): void | CODE |
| LOW⚡ | tests/Unit/PHP81/Php81LanguageFeaturesTest.php | 146 | public function testItCanMockAnInternalClassWithTentativeUnionReturnTypes(): void | CODE |
| LOW | tests/Unit/PHP81/Php81LanguageFeaturesTest.php | 161 | public function testItCanParseEnumAsDefaultValueCorrectly(): void | CODE |
| LOW | tests/Unit/PHP81/Php81LanguageFeaturesTest.php | 173 | public function testMockingClassWithNewInInitializer(): void | CODE |
| LOW | tests/Unit/PHP81/Php81LanguageFeaturesTest.php | 183 | public function testNewInitializerExpression(): void | CODE |
| LOW | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 45 | public function testItCanMockAClassWithAMixedArgumentTypeHint(): void | CODE |
| LOW | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 59 | public function testItCanMockAClassWithAMixedReturnTypeHint(): void | CODE |
| LOW | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 69 | public function testItCanMockAClassWithANamedArgumentList(): void | CODE |
| LOW | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 94 | public function testItCanMockAClassWithANamedArgumentListWithoutDefaultValue(): void | CODE |
| LOW | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 110 | public function testItCanMockAClassWithAParentArgumentTypeHint(): void | CODE |
| LOW | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 124 | public function testItCanMockAClassWithAParentReturnTypeHint(): void | CODE |
| LOW | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 134 | public function testItCanMockAClassWithAUnionArgumentTypeHint(): void | CODE |
| LOW | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 148 | public function testItCanMockAClassWithAUnionArgumentTypeHintIncludingNull(): void | CODE |
| LOW | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 161 | public function testItCanMockAClassWithAUnionReturnTypeHint(): void | CODE |
| LOW | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 171 | public function testItCanSpyAClassWithANamedArgumentList(): void | CODE |
| LOW | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 212 | public function testMockingIteratorAggregateDoesNotImplementIterator(): void | CODE |
| LOW | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 223 | public function testMockingIteratorDoesNotImplementIterator(): void | CODE |
| LOW | tests/Unit/PHP80/MockWithClosureAsLastArgumentTest.php | 32 | public function testIfClosureIsPassedAsLastArgumentToMockItIsCalledWithMockObject(): void | CODE |
| LOW | …/Unit/PHP80/MockingMethodsWithStaticReturnTypeTest.php | 31 | public function testMockingStaticReturnType(): void | CODE |
| LOW | tests/Unit/PHP73/MockingVoidMethodsTest.php | 29 | public function testItCanStubAndMockVoidMethods(): void | CODE |
| LOW | tests/Unit/PHP73/MockingVoidMethodsTest.php | 41 | public function testItShouldSuccessfullyBuildTheMock(): void | CODE |
| LOW | tests/Unit/PHP73/TestCase1404Test.php | 49 | public function testDemeterChainsAlternativeSyntax(array $result): void | CODE |
| LOW | tests/Unit/PHP73/TestCase1404Test.php | 81 | public function testDetestDemeterChainsAllowsmeterChainsAllows(array $result): void | CODE |
| LOW | tests/Unit/PHP73/TestCase1404Test.php | 97 | public function testNonDemeterChainsSyntax(array $result): void | CODE |
| LOW | tests/Unit/PHP73/TestCase1328Test.php | 38 | public function testShouldFailWithAnInvocationCountError(): void | CODE |
| LOW | tests/Unit/PHP73/TestCase1328Test.php | 54 | public function testThrowsInvalidArgumentExceptionForChainingAdditionalInvocationCountMethod(): void | CODE |
| LOW | tests/Unit/PHP73/TestCase1328Test.php | 79 | public function testThrowsInvalidArgumentExceptionWhenInvocationCountChanges(): void | CODE |
| LOW | tests/Unit/PHP73/MockClassWithFinalWakeupTest.php | 48 | public function testCreateMockForClassWithFinalWakeup(): void | CODE |
| LOW | tests/Unit/PHP73/MockClassWithFinalWakeupTest.php | 62 | public function testCreateMockForClassWithNonFinalWakeup(): void | CODE |
| LOW | tests/Unit/PHP73/MockingOldStyleConstructorTest.php | 30 | public function testMockClassWithOldStyleConstructorAndArguments(): void | CODE |
| LOW | tests/Unit/PHP73/WithFormatterExpectationTest.php | 33 | public static function provideFormatObjectsCases(): iterable | CODE |
| LOW | tests/Unit/PHP73/WithFormatterExpectationTest.php | 52 | public function testFormatObjectsExcludesStaticGetters(): void | CODE |
| LOW | tests/Unit/PHP73/WithFormatterExpectationTest.php | 63 | public function testFormatObjectsExcludesStaticProperties(): void | CODE |
| LOW | tests/Unit/PHP73/WithFormatterExpectationTest.php | 74 | public function testFormatObjectsShouldNotCallGettersWithParams(): void | CODE |
| LOW | tests/Unit/PHP73/WithFormatterExpectationTest.php | 88 | public function testFormatObjectsWithMockCalledInGetterDoesNotLeadToRecursion(): void | CODE |
| LOW | tests/Unit/PHP73/WithCustomFormatterExpectationTest.php | 67 | public static function provideFormatObjectsCases(): iterable | CODE |
| LOW | tests/Unit/PHP73/WithCustomFormatterExpectationTest.php | 88 | public static function provideGetObjectFormatterCases(): iterable | CODE |
| LOW | tests/Unit/Mockery/GlobalHelpersTest.php | 90 | public function testNamedMockCreatesANamedMock(): void | CODE |
| LOW | tests/Unit/Mockery/ProxyMockingTest.php | 30 | public function testFinalClassCannotBeMocked(): void | CODE |
| LOW | tests/Unit/Mockery/ProxyMockingTest.php | 50 | public function testPassesThruVirtualMethods(): void | CODE |
| LOW | tests/Unit/Mockery/HamcrestExpectationTest.php | 44 | public function testAnythingConstraintMatchesArgument(): void | CODE |
| LOW | tests/Unit/Mockery/HamcrestExpectationTest.php | 55 | public function testGreaterThanConstraintMatchesArgument(): void | CODE |
| LOW | tests/Unit/Mockery/HamcrestExpectationTest.php | 66 | public function testGreaterThanConstraintNotMatchesArgument(): void | CODE |
| LOW⚡ | tests/Unit/Mockery/ContainerTest.php | 214 | public function testCanMockAbstractClassWithAbstractPublicMethod(): void | CODE |
| LOW⚡ | tests/Unit/Mockery/ContainerTest.php | 223 | public function testCanMockAbstractWithAbstractProtectedMethod(): void | CODE |
| LOW⚡ | tests/Unit/Mockery/ContainerTest.php | 232 | public function testCanMockClassAndApplyMultipleInterfaces(): void | CODE |
| LOW⚡ | tests/Unit/Mockery/ContainerTest.php | 243 | public function testCanMockClassContainingAPublicWakeupMethod(): void | CODE |
| LOW⚡ | tests/Unit/Mockery/ContainerTest.php | 252 | public function testCanMockClassContainingMagicCallMethod(): void | CODE |
| LOW⚡ | tests/Unit/Mockery/ContainerTest.php | 261 | public function testCanMockClassContainingMagicCallMethodWithoutTypeHinting(): void | CODE |
| LOW⚡ | tests/Unit/Mockery/ContainerTest.php | 270 | public function testCanMockClassUsingMagicCallMethodsInPlaceOfNormalMethods(): void | CODE |
| LOW⚡ | tests/Unit/Mockery/ContainerTest.php | 281 | public function testCanMockClassWhereMethodHasReferencedParameter(): void | CODE |
| LOW⚡ | tests/Unit/Mockery/ContainerTest.php | 289 | public function testCanMockClassWithConstructor(): void | CODE |
| LOW⚡ | tests/Unit/Mockery/ContainerTest.php | 298 | public function testCanMockClassWithConstructorNeedingClassArgs(): void | CODE |
| 584 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | e2e-test.sh | 1 | #!/bin/bash | COMMENT |
| LOW | docs/conf.py | 1 | # -*- coding: utf-8 -*- | COMMENT |
| LOW | docs/conf.py | 61 | # The language for content autogenerated by Sphinx. Refer to documentation | COMMENT |
| LOW | docs/conf.py | 81 | COMMENT | |
| LOW | docs/conf.py | 101 | COMMENT | |
| LOW | docs/conf.py | 121 | # so a file named "default.css" will overwrite the builtin "default.css". | COMMENT |
| LOW | docs/conf.py | 141 | # template names. | COMMENT |
| LOW | docs/conf.py | 161 | COMMENT | |
| LOW | docs/conf.py | 181 | #'pointsize': '10pt', | COMMENT |
| LOW | docs/conf.py | 201 | #latex_use_parts = False | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | docs/conf.py | 6 | # This file is execfile()d with the current directory set to its | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/conf.py | 15 | CODE |