PHP support
- Require
~8.3.0 || ~8.4.0 || ~8.5.0 in composer.json and drop 8.2 from both CI matrices
Bugs
- Stop
AttributedServiceFactory from treating a config value of null as a missing key (isset() → array_key_exists()/offsetExists())
- Throw instead of silently truncating a dot path that continues past a scalar
- Remove the mutable
$originalKey property — shared factory instances make it stateful; pass the key as an argument
- Validate in
AttributedRepositoryFactory that Doctrine returned the requested class, so an entity missing repositoryClass fails loudly
- Guard against an
#[Entity] attribute naming a non-existent class
- Fix
findEntityAttribute()/findInjectAttribute() returning object where ?Entity/?Inject is declared
Code quality
- Restrict attribute targets:
#[Entity] to TARGET_CLASS, #[Inject] to TARGET_METHOD (misplacement is currently a silent no-op)
- Add
InvalidArgumentException::missingKey() for parity with RuntimeException's static constructors
- Replace the hand-rolled attribute loops with
getAttributes(X::class)
- Drop the
ignoreErrors entries from phpstan.neon by fixing their cause in the tests
Tests
- Cover null config values, paths overshooting a scalar, dot notation on a non-array service,
ArrayAccess traversal, exact-name precedence over dot resolution, unregistered class instantiation, missing entity, wrong repository class
Documentation
- Add an "Attributes vs. factories" page: comparison, advantages, trade-offs, when to still write a factory
- Add an FAQ page
- Correct the dot-notation description — only the full name and the first segment are resolved from the container, not every segment
- Document
InvalidArgumentException, constructor-less classes, the unregistered-class fallback, ArrayAccess traversal, only-direct-recursion detection, the repositoryClass requirement, createObject() vs __invoke()
- Fix the unrunnable PHP samples (missing
use statements) and the Srevice typos
- Update the README: requirements, QA section, un-pin the PHP badge from 1.3.0
- Reformat all Markdown to one sentence per row
Note: readKeysFromArray() gains a third parameter and the attribute-target change turns silent misuse into a compile-time error — backwardCompatibilityCheck will flag both.
PHP support
~8.3.0 || ~8.4.0 || ~8.5.0incomposer.jsonand drop8.2from both CI matricesBugs
AttributedServiceFactoryfrom treating a config value ofnullas a missing key (isset()→array_key_exists()/offsetExists())$originalKeyproperty — shared factory instances make it stateful; pass the key as an argumentAttributedRepositoryFactorythat Doctrine returned the requested class, so an entity missingrepositoryClassfails loudly#[Entity]attribute naming a non-existent classfindEntityAttribute()/findInjectAttribute()returningobjectwhere?Entity/?Injectis declaredCode quality
#[Entity]toTARGET_CLASS,#[Inject]toTARGET_METHOD(misplacement is currently a silent no-op)InvalidArgumentException::missingKey()for parity withRuntimeException's static constructorsgetAttributes(X::class)ignoreErrorsentries fromphpstan.neonby fixing their cause in the testsTests
ArrayAccesstraversal, exact-name precedence over dot resolution, unregistered class instantiation, missing entity, wrong repository classDocumentation
InvalidArgumentException, constructor-less classes, the unregistered-class fallback,ArrayAccesstraversal, only-direct-recursion detection, therepositoryClassrequirement,createObject()vs__invoke()usestatements) and theSrevicetypos