Mago analyzer report
Command run:
devenv shell ./vendor/bin/mago analyze --sort
Result: failed.
Summary from Mago: found 450 issues: 352 errors, 96 warnings, and 2 help messages. Mago also reported 366 stale baseline entries and filtered 268 issues via the existing analyzer baseline.
Issues by type
| Type |
Count |
Suggested solution |
error[mixed-property-access] |
298 |
Add or tighten return types, collection value types, PHPUnit assertions, or PHPDoc generics so analyzer knows retrieved accounts, transfers, balances, histories, and array elements are concrete domain objects before property access. |
warning[mixed-assignment] |
91 |
Type intermediate variables at assignment points; add repository/ledger method return types or local @var annotations where values are intentionally dynamic. |
error[mixed-method-access] |
44 |
Narrow variables from mixed before method calls using stronger API return types, assertions such as self::assertInstanceOf, or precise PHPDoc. |
error[mixed-operand] |
6 |
Ensure arithmetic/comparison operands have scalar numeric/string types before use; cast or type source values explicitly. |
warning[incompatible-parameter-name] |
4 |
Align implementing/overriding method parameter names with their parent/interface declarations. |
help[write-only-property] |
2 |
Remove unused property writes or add reads if the stored value is needed. |
error[invalid-iterator] |
1 |
Ensure the iterated expression is typed as iterable with a known value type. |
error[method-access-on-null] |
1 |
Add a null check/assertion or adjust the return type so the method call is only made on a non-null object. |
error[mixed-argument] |
1 |
Type the argument before passing it to a parameter requiring a stricter type. |
warning[redundant-docblock-type] |
1 |
Remove the redundant docblock type or update it only if it adds missing generic/detail information. |
error[non-existent-method] |
1 |
Update tests/PHPUnit/DatabaseExtension.php for the installed PHPUnit event API; PHPUnit\Event\Code\Test::metadata() is not available. |
Notable locations
- Many
mixed-property-access findings are in tests/StandardLedgerTest.php, tests/IdempotentLedgerTest.php, and tests/Storage/Dbal/TransferRepositoryTest.php when dereferencing retrieved fixtures or repository results.
tests/PHPUnit/DatabaseExtension.php:62 calls metadata() on PHPUnit\Event\Code\Test, which Mago reports as non-existent.
Suggested remediation order
- Fix the PHPUnit extension API issue because it is a concrete missing-method error.
- Add precise return types/PHPDoc generics to repository and ledger retrieval APIs used by tests.
- Add PHPUnit
assertInstanceOf/non-null assertions where tests intentionally validate dynamic repository results.
- Regenerate or verify the analyzer baseline after fixes to remove stale entries.
Mago analyzer report
Command run:
Result: failed.
Summary from Mago: found 450 issues: 352 errors, 96 warnings, and 2 help messages. Mago also reported 366 stale baseline entries and filtered 268 issues via the existing analyzer baseline.
Issues by type
error[mixed-property-access]warning[mixed-assignment]@varannotations where values are intentionally dynamic.error[mixed-method-access]mixedbefore method calls using stronger API return types, assertions such asself::assertInstanceOf, or precise PHPDoc.error[mixed-operand]warning[incompatible-parameter-name]help[write-only-property]error[invalid-iterator]error[method-access-on-null]error[mixed-argument]warning[redundant-docblock-type]error[non-existent-method]tests/PHPUnit/DatabaseExtension.phpfor the installed PHPUnit event API;PHPUnit\Event\Code\Test::metadata()is not available.Notable locations
mixed-property-accessfindings are intests/StandardLedgerTest.php,tests/IdempotentLedgerTest.php, andtests/Storage/Dbal/TransferRepositoryTest.phpwhen dereferencing retrieved fixtures or repository results.tests/PHPUnit/DatabaseExtension.php:62callsmetadata()onPHPUnit\Event\Code\Test, which Mago reports as non-existent.Suggested remediation order
assertInstanceOf/non-null assertions where tests intentionally validate dynamic repository results.