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 presents the forensic synthetic code analysis of mockery/mockery, a PHP project with 10,726 GitHub stars. SynthScan v2.0 examined 31,703 lines of code across 399 source files, recording 631 pattern matches distributed across 4 syntactic categories. The overall adjusted score of 18.5 places this repository in the Moderate AI signal band.
The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).
Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.
Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.
This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.
The scanner identified 631 distinct pattern matches across 4 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. 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 diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | psalm-baseline.xml | 1995 | <code><![CDATA[public function shouldAllowMockingProtectedMethods()]]></code> | CODE |
| LOW | tests/Unit/PHP81/Php81LanguageFeaturesTest.php | 35 | public function testCanMockClassesThatImplementSerializable(): void | CODE |
| LOW | tests/Unit/PHP81/Php81LanguageFeaturesTest.php | 42 | public function testItCanMockAClassWithANeverReturningTypeHint(): void | CODE |
| LOW | tests/Unit/PHP81/Php81LanguageFeaturesTest.php | 53 | public function testItCanMockAClassWithANeverReturningTypeHintWithExit(): void | CODE |
| LOW | tests/Unit/PHP81/Php81LanguageFeaturesTest.php | 75 | public function testItCanMockAClassWithAnIntersectionArgumentTypeHint(): void | CODE |
| LOW⚡ | tests/Unit/PHP81/Php81LanguageFeaturesTest.php | 88 | public function testItCanMockAClassWithReturnTypeWillChangeAttributeAndNoReturnType(): void | CODE |
| LOW⚡ | tests/Unit/PHP81/Php81LanguageFeaturesTest.php | 95 | public function testItCanMockAClassWithReturnTypeWillChangeAttributeAndWrongReturnType(): void | CODE |
| LOW⚡ | tests/Unit/PHP81/Php81LanguageFeaturesTest.php | 102 | public function testItCanMockAnInternalClassWithTentativeReturnTypes(): void | CODE |
| LOW⚡ | tests/Unit/PHP81/Php81LanguageFeaturesTest.php | 109 | public function testItCanMockAnInternalClassWithTentativeUnionReturnTypes(): void | CODE |
| LOW⚡ | tests/Unit/PHP81/Php81LanguageFeaturesTest.php | 125 | public function testItCanParseEnumAsDefaultValueCorrectly(): void | CODE |
| LOW⚡ | tests/Unit/PHP81/Php81LanguageFeaturesTest.php | 134 | public function testMockingClassWithNewInInitializer(): void | CODE |
| LOW⚡ | tests/Unit/PHP81/Php81LanguageFeaturesTest.php | 141 | public function testNewInitializerExpression(): void | CODE |
| LOW | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 29 | public function testItCanMockAClassWithAMixedArgumentTypeHint(): void | CODE |
| LOW | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 40 | public function testItCanMockAClassWithAMixedReturnTypeHint(): void | CODE |
| LOW | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 47 | public function testItCanMockAClassWithAParentArgumentTypeHint(): void | CODE |
| LOW | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 58 | public function testItCanMockAClassWithAParentReturnTypeHint(): void | CODE |
| LOW | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 65 | public function testItCanMockAClassWithAUnionArgumentTypeHint(): void | CODE |
| LOW | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 76 | public function testItCanMockAClassWithANamedArgumentList(): void | CODE |
| LOW | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 98 | public function testItCanMockAClassWithANamedArgumentListWithoutDefaultValue(): void | CODE |
| LOW | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 111 | public function testItCanSpyAClassWithANamedArgumentList(): void | CODE |
| LOW⚡ | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 135 | public function testItCanMockAClassWithAUnionArgumentTypeHintIncludingNull(): void | CODE |
| LOW⚡ | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 145 | public function testItCanMockAClassWithAUnionReturnTypeHint(): void | CODE |
| LOW⚡ | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 152 | public function testMockingIteratorAggregateDoesNotImplementIterator(): void | CODE |
| LOW⚡ | tests/Unit/PHP80/Php80LanguageFeaturesTest.php | 160 | public function testMockingIteratorDoesNotImplementIterator(): void | CODE |
| LOW | tests/Unit/PHP80/MockWithClosureAsLastArgumentTest.php | 18 | public function testIfClosureIsPassedAsLastArgumentToMockItIsCalledWithMockObject(): void | CODE |
| LOW | …/Unit/PHP80/MockingMethodsWithStaticReturnTypeTest.php | 15 | public function testMockingStaticReturnType(): void | CODE |
| LOW | tests/Unit/PHP73/MockingVoidMethodsTest.php | 15 | public function testItCanStubAndMockVoidMethods(): void | CODE |
| LOW | tests/Unit/PHP73/MockingVoidMethodsTest.php | 24 | public function testItShouldSuccessfullyBuildTheMock(): void | CODE |
| LOW | tests/Unit/PHP73/TestCase1404Test.php | 34 | public function testDemeterChainsAlternativeSyntax(array $result): void | CODE |
| LOW | tests/Unit/PHP73/TestCase1404Test.php | 60 | public function testDetestDemeterChainsAllowsmeterChainsAllows(array $result): void | CODE |
| LOW | tests/Unit/PHP73/TestCase1404Test.php | 73 | public function testNonDemeterChainsSyntax(array $result): void | CODE |
| LOW | tests/Unit/PHP73/TestCase1328Test.php | 21 | public function testShouldFailWithAnInvocationCountError(): void | CODE |
| LOW | tests/Unit/PHP73/TestCase1328Test.php | 34 | public function testThrowsInvalidArgumentExceptionForChainingAdditionalInvocationCountMethod(): void | CODE |
| LOW | tests/Unit/PHP73/TestCase1328Test.php | 57 | public function testThrowsInvalidArgumentExceptionWhenInvocationCountChanges(): void | CODE |
| LOW | tests/Unit/PHP73/MockClassWithFinalWakeupTest.php | 34 | public function testCreateMockForClassWithFinalWakeup(): void | CODE |
| LOW | tests/Unit/PHP73/MockClassWithFinalWakeupTest.php | 45 | public function testCreateMockForClassWithNonFinalWakeup(): void | CODE |
| LOW | tests/Unit/PHP73/MockingOldStyleConstructorTest.php | 16 | public function testMockClassWithOldStyleConstructorAndArguments(): void | CODE |
| LOW | tests/Unit/PHP73/WithFormatterExpectationTest.php | 21 | public static function provideFormatObjectsCases(): iterable | CODE |
| LOW⚡ | tests/Unit/PHP73/WithFormatterExpectationTest.php | 34 | public function testFormatObjectsExcludesStaticGetters(): void | CODE |
| LOW⚡ | tests/Unit/PHP73/WithFormatterExpectationTest.php | 42 | public function testFormatObjectsExcludesStaticProperties(): void | CODE |
| LOW⚡ | tests/Unit/PHP73/WithFormatterExpectationTest.php | 50 | public function testFormatObjectsShouldNotCallGettersWithParams(): void | CODE |
| LOW | tests/Unit/PHP73/WithFormatterExpectationTest.php | 62 | public function testFormatObjectsWithMockCalledInGetterDoesNotLeadToRecursion(): void | CODE |
| LOW | tests/Unit/PHP73/WithCustomFormatterExpectationTest.php | 53 | public static function provideFormatObjectsCases(): iterable | CODE |
| LOW | tests/Unit/PHP73/WithCustomFormatterExpectationTest.php | 74 | public static function provideGetObjectFormatterCases(): iterable | CODE |
| LOW | tests/Unit/Mockery/GlobalHelpersTest.php | 53 | public function testNamedMockCreatesANamedMock(): void | CODE |
| LOW | tests/Unit/Mockery/ProxyMockingTest.php | 16 | public function testFinalClassCannotBeMocked(): void | CODE |
| LOW | tests/Unit/Mockery/ProxyMockingTest.php | 30 | public function testPassesThruVirtualMethods(): void | CODE |
| LOW⚡ | tests/Unit/Mockery/HamcrestExpectationTest.php | 28 | public function testAnythingConstraintMatchesArgument(): void | CODE |
| LOW⚡ | tests/Unit/Mockery/HamcrestExpectationTest.php | 36 | public function testGreaterThanConstraintMatchesArgument(): void | CODE |
| LOW⚡ | tests/Unit/Mockery/HamcrestExpectationTest.php | 44 | public function testGreaterThanConstraintNotMatchesArgument(): void | CODE |
| LOW⚡ | tests/Unit/Mockery/ContainerTest.php | 172 | public function testCanMockAbstractClassWithAbstractPublicMethod(): void | CODE |
| LOW⚡ | tests/Unit/Mockery/ContainerTest.php | 178 | public function testCanMockAbstractWithAbstractProtectedMethod(): void | CODE |
| LOW⚡ | tests/Unit/Mockery/ContainerTest.php | 184 | public function testCanMockClassAndApplyMultipleInterfaces(): void | CODE |
| LOW⚡ | tests/Unit/Mockery/ContainerTest.php | 192 | public function testCanMockClassContainingAPublicWakeupMethod(): void | CODE |
| LOW⚡ | tests/Unit/Mockery/ContainerTest.php | 198 | public function testCanMockClassContainingMagicCallMethod(): void | CODE |
| LOW⚡ | tests/Unit/Mockery/ContainerTest.php | 204 | public function testCanMockClassContainingMagicCallMethodWithoutTypeHinting(): void | CODE |
| LOW⚡ | tests/Unit/Mockery/ContainerTest.php | 210 | public function testCanMockClassUsingMagicCallMethodsInPlaceOfNormalMethods(): void | CODE |
| LOW⚡ | tests/Unit/Mockery/ContainerTest.php | 218 | public function testCanMockClassWhereMethodHasReferencedParameter(): void | CODE |
| LOW⚡ | tests/Unit/Mockery/ContainerTest.php | 223 | public function testCanMockClassWithConstructor(): void | CODE |
| LOW⚡ | tests/Unit/Mockery/ContainerTest.php | 229 | public function testCanMockClassWithConstructorNeedingClassArgs(): void | CODE |
| 559 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 |