interface ContainerInterface
Same name in this branch
- 11.1.x vendor/psr/container/src/ContainerInterface.php \Psr\Container\ContainerInterface
- 11.1.x core/lib/Drupal/Component/DependencyInjection/ContainerInterface.php \Drupal\Component\DependencyInjection\ContainerInterface
ContainerInterface is the interface implemented by service container classes.
@author Fabien Potencier <fabien@symfony.com> @author Johannes M. Schmitt <schmittjoh@gmail.com>
Hierarchy
- interface \Psr\Container\ContainerInterface
- interface \Symfony\Component\DependencyInjection\ContainerInterface extends \Psr\Container\ContainerInterface
Expanded class hierarchy of ContainerInterface
All classes that implement ContainerInterface
630 files declare their use of ContainerInterface
- AccountForm.php in core/
modules/ user/ src/ AccountForm.php - AccountSettingsForm.php in core/
modules/ user/ src/ AccountSettingsForm.php - AddFormBase.php in core/
modules/ media_library/ src/ Form/ AddFormBase.php - AddItemToToolbar.php in core/
modules/ ckeditor5/ src/ Plugin/ ConfigAction/ AddItemToToolbar.php - AddModeration.php in core/
modules/ content_moderation/ src/ Plugin/ ConfigAction/ AddModeration.php
File
-
vendor/
symfony/ dependency-injection/ ContainerInterface.php, line 25
Namespace
Symfony\Component\DependencyInjectionView source
interface ContainerInterface extends PsrContainerInterface {
public const RUNTIME_EXCEPTION_ON_INVALID_REFERENCE = 0;
public const EXCEPTION_ON_INVALID_REFERENCE = 1;
public const NULL_ON_INVALID_REFERENCE = 2;
public const IGNORE_ON_INVALID_REFERENCE = 3;
public const IGNORE_ON_UNINITIALIZED_REFERENCE = 4;
public function set(string $id, ?object $service) : void;
/**
* @template B of self::*_REFERENCE
*
* @param B $invalidBehavior
*
* @psalm-return (B is self::EXCEPTION_ON_INVALID_REFERENCE|self::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE ? object : object|null)
*
* @throws ServiceCircularReferenceException When a circular reference is detected
* @throws ServiceNotFoundException When the service is not defined
*
* @see Reference
*/
public function get(string $id, int $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) : ?object;
public function has(string $id) : bool;
/**
* Check for whether or not a service has been initialized.
*/
public function initialized(string $id) : bool;
/**
* @throws ParameterNotFoundException if the parameter is not defined
*/
public function getParameter(string $name) : array|bool|string|int|float|\UnitEnum|null;
public function hasParameter(string $name) : bool;
public function setParameter(string $name, array|bool|string|int|float|\UnitEnum|null $value) : void;
}