diff --git a/core/lib/Drupal/Component/DependencyInjection/ContainerInterface.php b/core/lib/Drupal/Component/DependencyInjection/ContainerInterface.php index 121a57dadc..9a74abbe00 100644 --- a/core/lib/Drupal/Component/DependencyInjection/ContainerInterface.php +++ b/core/lib/Drupal/Component/DependencyInjection/ContainerInterface.php @@ -5,7 +5,10 @@ use Symfony\Component\DependencyInjection\ContainerInterface as BaseContainerInterface; /** - * Documents the existing getServiceIds method. + * The interface for Drupal service container classes. + * + * This interface extends Symfony's ContainerInterface and adds methods for + * managing mappins of instantiated services to its IDs. */ interface ContainerInterface extends BaseContainerInterface { diff --git a/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php b/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php index d567c394cc..69f7d35ad1 100644 --- a/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php +++ b/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php @@ -429,8 +429,8 @@ protected function dumpValue($value) { } elseif (is_object($value)) { // Drupal specific: Instantiated objects have a _serviceId parameter. - @trigger_error('_serviceId is deprecated in drupal:9.5.0 and is removed from drupal:10.0.0. Use DrupalKernelInterface::getServiceIdMapping() instead. See https://www.drupal.org/node/3292540', E_USER_DEPRECATED); if (isset($value->_serviceId)) { + @trigger_error('_serviceId is deprecated in drupal:9.5.0 and is removed from drupal:10.0.0. Use DrupalKernelInterface::getServiceIdMapping() instead. See https://www.drupal.org/node/3292540', E_USER_DEPRECATED); return $this->getReferenceCall($value->_serviceId); } throw new RuntimeException('Unable to dump a service container if a parameter is an object without _serviceId.'); diff --git a/core/lib/Drupal/Component/DependencyInjection/ServiceIdHashTrait.php b/core/lib/Drupal/Component/DependencyInjection/ServiceIdHashTrait.php index dc92b298c9..d53f9cb650 100644 --- a/core/lib/Drupal/Component/DependencyInjection/ServiceIdHashTrait.php +++ b/core/lib/Drupal/Component/DependencyInjection/ServiceIdHashTrait.php @@ -15,7 +15,7 @@ trait ServiceIdHashTrait { public function getServiceIdMappings(): array { $mapping = []; foreach ($this->getServiceIds() as $service_id) { - if ($this->initialized($service_id) && $service_id != 'service_container') { + if ($this->initialized($service_id) && $service_id !== 'service_container') { $mapping[$this->generateServiceIdHash($this->get($service_id))] = $service_id; } } diff --git a/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php b/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php index 005d76ea54..a23a2f487a 100644 --- a/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php +++ b/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php @@ -38,7 +38,7 @@ public function __sleep() { foreach ($vars as $key => $value) { if ($value instanceof EntityStorageInterface) { // If a class member is an entity storage, only store the entity type - // ID the storage is for so it can be used to get a fresh object on + // ID the storage is for, so it can be used to get a fresh object on // unserialization. By doing this we prevent possible memory leaks // when the storage is serialized and it contains a static cache of // entity objects. Additionally we ensure that we'll not have multiple