Remove ContainerAwareInterface from CustomFieldProvider.php

This commit is contained in:
Julie Lenaerts 2025-05-26 14:55:39 +02:00
parent 262b7c5db3
commit 1321f5c734
2 changed files with 3 additions and 25 deletions

View File

@ -11,9 +11,6 @@ declare(strict_types=1);
namespace Chill\CustomFieldsBundle\Service; namespace Chill\CustomFieldsBundle\Service;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
* Receive all the services tagged with 'chill.custom_field'. * Receive all the services tagged with 'chill.custom_field'.
* *
@ -28,13 +25,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* tags: * tags:
* - { name: 'chill.custom_field', type: 'ICPC2' } * - { 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 * @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'); 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;
}
} }

View File

@ -5,8 +5,8 @@ services:
chill.custom_field.provider: chill.custom_field.provider:
class: Chill\CustomFieldsBundle\Service\CustomFieldProvider class: Chill\CustomFieldsBundle\Service\CustomFieldProvider
calls: # calls:
- [setContainer, ["@service_container"]] # - [setContainer, ["@service_container"]]
Chill\CustomFieldsBundle\Service\CustomFieldProvider: '@chill.custom_field.provider' Chill\CustomFieldsBundle\Service\CustomFieldProvider: '@chill.custom_field.provider'