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

CommentFileSizeAuthor
#3 2708379-2.patch2.97 KBalexpott
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

dawehner’s picture

Good idea!

alexpott’s picture

Status: Active » Needs review
FileSize
2.97 KB
alexpott’s picture

Issue summary: View changes
dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Well, I also doubt you can have a service modifier before the core one, which is IMHO impossible, see \Drupal\Core\DrupalKernel::discoverServiceProviders.

  • catch committed 4c3b376 on 8.2.x
    Issue #2708379 by alexpott: Add uuid service to core.services.yml
    
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 4c3b376 and pushed to 8.2.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.