Problem/Motivation
lazy: true has no effect in Drupal, the only way (apart from using soon-deprecated proxy service class generator) to autowire services lazily in Drupal currently is the AutowireServiceClosure attribute that lazy-loads services by default.
Code like:
#[Autowire(service: SomeClass::class, lazy: TRUE)] or
#[AutowireCallable(service: SomeClass::class, method: 'someMethod')]
Just doesn't work as expected.
Proposed resolution
Let's add a coding standard check and pin usage of those attribute parameters so developers know what to use and when, instead of relying on Symfony docs that just don't apply in Drupal.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork coder-3609261
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
graber commentedComment #3
graber commentedSwitching to 8.3.x as that's what's used on most projects currently.
Comment #5
graber commented