This was discovered while working on #2412669: Remove drupal_static from BookManager.
Problem/Motivation
The BackendChain service constructor looks like:
public function __construct($bin) {
}
This is forcing a service definition to declare arguments, in *.services.yml, such as:
book.cache:
class: Drupal\Core\Cache\BackendChain
arguments: ['']
...
or...
book.cache:
class: Drupal\Core\Cache\BackendChain
arguments: ['whatever arbitrary string...']
...
The parameter is not used and not needed.
Proposed resolution
Make the parameter optional and deprecate it. Will be removed in 9.0.0.
Remaining tasks
None.
User interface changes
None.
API changes
The BackendChain constructor parameter is optional and deprecated.
Data model changes
None.
Release notes snippet
None.
Comments
Comment #2
claudiu.cristeaComment #3
claudiu.cristeaPatch.
Comment #4
claudiu.cristeaComment #6
claudiu.cristeaRemove the usage of deprecated parameter from tests.
Comment #7
darrenwh commentedI think a test should be in place to test that the deprecation message is shown correctly, maybe over engineering but since it's just been added may as well prove that it works?
Comment #8
darrenwh commentedComment #9
claudiu.cristeaYeah, it makes sense.
Comment #10
claudiu.cristeaAdded deprecation test.
Comment #11
darrenwh commentedCode reviewed and tests run correctly RTBC
Comment #12
catchCommitted 62d7215 and pushed to 8.8.x. Thanks!
Comment #15
quietone commentedpublish the change record