Update docs examples to show configuring and injecting the attribute reader to listeners #2797
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The documentation right now only covers injecting an annotation reader into the various event listener classes. With Symfony 6.4 deprecating the
@annotation_reader
service and 7.0 fully removing it, that makes this bit of the documentation less than optimal.Additionally, the internal feature detection code in this package still heavily favors annotations over attributes, meaning if
doctrine/annotations
is installed in a project for any reason at all, the feature detection code is going to use annotations. This is less than optimal for applications using attributes, but not really actionable until a new major release is cut.This PR updates the documentation to provide examples for injecting the attribute reader instead of an annotation reader in the IpTraceable and Symfony docs pages, as these pages do have some explicit Symfony config examples with
setAnnotationReader
calls configured; this can help users set up their environments more efficiently if they aren't usingStofDoctrineExtensionsBundle
(and for those who are, a resolution for stof/StofDoctrineExtensionsBundle#481 helps those folks).Fixes #2780