By elber on
Change record status:
Draft (View all draft change records)
Project:
Introduced in branch:
10.2.x
Introduced in version:
10.2.0
Issue links:
Description:
Autowiring is now used for core services. core.services.yml has the following default added:
services:
_defaults:
autowire: true
Many explicit service arguments have been removed as the container can now infer the correct service from the constructor argument types alone.
BEFORE
services:
asset.query_string:
class: Drupal\Core\Asset\AssetQueryString
arguments:
- '@state'
- '@datetime.time'
AFTER
services:
asset.query_string:
class: Drupal\Core\Asset\AssetQueryString
This is possible because of these two earlier changes, Adding support for _defaults key to the your_module.services.yml file and Core services provide aliases for autowiring.
Impacts:
Module developers