v1.8.1 Quality Hardening
What's New
This release hardens the codebase to the highest quality bar — PHPStan level max with zero errors, 100% line coverage, and strict PHPUnit mode — all without changing any runtime behavior.
Static Analysis: PHPStan Level Max
- Zero errors at level max — reduced from 917 errors to 0 across src/ and tests/
- Zero
@phpstan-ignoreannotations — every error fixed at the root cause using assertion-based narrowing - phpstan-doctrine formalized in require-dev for Doctrine metadata type awareness
- Config locked:
level: maxin phpstan.neon, singlecomposer stancommand
Type Safety
- Handler chain verified: All 10 handlers have explicit type narrowing at every
getDataToBeTranslated(),getProperty(), andgetTranslatedParent()call site - ORM 3 typed API migration: All handler association access uses
instanceof InverseSideMapping/OwningSideMappingwith typed property syntax ($assoc->mappedBy) instead of array syntax - Interface coupling: Handlers depend only on
EntityTranslatorInterface, removed concrete class downcasts - DI extension: Typed array shape for
processConfiguration()return, simplified logging config access
Test Quality
- 293 tests, 2101 assertions — up from 275 tests, 2012 assertions
- Strict mode:
failOnWarning,failOnNotice,failOnRiskyall enabled — zero violations - 100% line coverage: 813/813 lines, 153/153 methods, 29/29 classes
- CI enforcement: Coverage threshold raised from 95% to 100%
PHPDoc Improvements
TranslatableInterface::getTranslations()return type narrowed toarray<string, array<string, mixed>>TranslatableTrait::$translationsproperty type narrowed to match- Typed accessor methods on test base classes for null-safe property access
EntityTranslatorInterfaceenhanced with full@param/@returnPHPDoc
Internal
- 37 atomic commits across 13 plans in 5 phases
- PHPUnit mock notices resolved with
#[AllowMockObjectsWithoutExpectations]attribute ReflectionMethod::invoke()replaces variable method calls for strict mode compliance- Stale
@varannotations, dead imports, and unused code removed
Full Changelog: v1.8.0...v1.8.1