You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Symfony\Component\DependencyInjection\ContainerAwareTrait And Symfony\Component\DependencyInjection\ContainerAwareInterface are being deprecated in Symfony 6.4 and removed in 7.0.
Both Drupal\Core\DependencyInjection\ClassResolver and Drupal\Core\Entity\EntityTypeManager depend on retrieving any arbitrary service from the container, so they still need full access to the container.
We now inject the service_container as an argument in their constructor, instead of making them ContainerAware.
https://www.drupal.org/node/3419963
Introduced in branch/version: 10.3.x / 10.3.0
Symfony\Component\DependencyInjection\ContainerAwareTrait
AndSymfony\Component\DependencyInjection\ContainerAwareInterface
are being deprecated in Symfony 6.4 and removed in 7.0.Both
Drupal\Core\DependencyInjection\ClassResolver
andDrupal\Core\Entity\EntityTypeManager
depend on retrieving any arbitrary service from the container, so they still need full access to the container.We now inject the
service_container
as an argument in their constructor, instead of making themContainerAware
.Drupal\Core\DependencyInjection\ClassResolver
before:Drupal\Core\DependencyInjection\ClassResolver
after:$class_resolver = new ClassResolver($container);
Drupal\Core\Entity\EntityTypeManager
before:Drupal\Core\Entity\EntityTypeManager
after:$entity_type_manager = new EntityTypeManager($namespaces, $module_handler, $cache, $string_translation, $class_resolver, $entity_last_installed_schema_repository, $container);
The
setContainer
methods in both classes are now deprecated and will be removed from Drupal 11.0.0.The text was updated successfully, but these errors were encountered: