Problem/Motivation
Follow-up to #1969572: Make Uuid a service
The UUID service is registered by \Drupal\Core\CoreServiceProvider::registerUuidService()
. This is unnecessarily dynamic.
Proposed resolution
We can register it in core.services.yml and alter the class using the ServiceModifierInterface to use a more efficient class if available. This has the advantage that IDEs can find the service and use it for typehints etc.
Remaining tasks
User interface changes
None.
API changes
I would argue none as nothing should depend on \Drupal\Core\CoreServiceProvider::registerUuidService()
. If we feel that removing this is a BC break then we can deprecated it. ServiceProviders are not specifically mentioned in https://www.drupal.org/core/d8-bc-policy but I would argue that this in not API. The existence of a service called 'uuid' that implements UuidInterface is.
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#3 | 2708379-2.patch | 2.97 KB | alexpott |
Comments
Comment #2
dawehnerGood idea!
Comment #3
alexpottComment #4
alexpottComment #5
dawehnerWell, I also doubt you can have a service modifier before the core one, which is IMHO impossible, see
\Drupal\Core\DrupalKernel::discoverServiceProviders
.Comment #7
catchCommitted 4c3b376 and pushed to 8.2.x. Thanks!