From 1321f5c734dd2a53f478a410b59f5421d6b163a2 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 26 May 2025 14:55:39 +0200 Subject: [PATCH] Remove ContainerAwareInterface from CustomFieldProvider.php --- .../Service/CustomFieldProvider.php | 24 +------------------ .../config/services.yaml | 4 ++-- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldProvider.php b/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldProvider.php index 8f84c3fbd..56bb46099 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldProvider.php +++ b/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldProvider.php @@ -11,9 +11,6 @@ declare(strict_types=1); namespace Chill\CustomFieldsBundle\Service; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; - /** * Receive all the services tagged with 'chill.custom_field'. * @@ -28,13 +25,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface; * tags: * - { name: 'chill.custom_field', type: 'ICPC2' } */ -class CustomFieldProvider implements ContainerAwareInterface +class CustomFieldProvider { - /** - * @var Container The container - */ - private $container; - /** * @var array The services indexes by the type */ @@ -78,18 +70,4 @@ class CustomFieldProvider implements ContainerAwareInterface throw new \LogicException('the custom field with type '.$type.' is not found'); } - - /** - * (non-PHPdoc). - * - * @see \Symfony\Component\DependencyInjection\ContainerAwareInterface::setContainer() - */ - public function setContainer(?ContainerInterface $container = null): void - { - if (null === $container) { - throw new \LogicException('container should not be null'); - } - - $this->container = $container; - } } diff --git a/src/Bundle/ChillCustomFieldsBundle/config/services.yaml b/src/Bundle/ChillCustomFieldsBundle/config/services.yaml index d27323a0a..96f70d352 100644 --- a/src/Bundle/ChillCustomFieldsBundle/config/services.yaml +++ b/src/Bundle/ChillCustomFieldsBundle/config/services.yaml @@ -5,8 +5,8 @@ services: chill.custom_field.provider: class: Chill\CustomFieldsBundle\Service\CustomFieldProvider - calls: - - [setContainer, ["@service_container"]] +# calls: +# - [setContainer, ["@service_container"]] Chill\CustomFieldsBundle\Service\CustomFieldProvider: '@chill.custom_field.provider'