Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ContainerInterface.php

function ContainerInterface::get

Same name in this branch
  1. 11.1.x vendor/psr/container/src/ContainerInterface.php \Psr\Container\ContainerInterface::get()

@template B of self::*_REFERENCE

@psalm-return (B is self::EXCEPTION_ON_INVALID_REFERENCE|self::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE ? object : object|null)

Parameters

B $invalidBehavior:

Throws

ServiceCircularReferenceException When a circular reference is detected

ServiceNotFoundException When the service is not defined

Overrides ContainerInterface::get

See also

Reference

2 methods override ContainerInterface::get()
Container::get in core/lib/Drupal/Component/DependencyInjection/Container.php
@template B of self::*_REFERENCE
Container::get in vendor/symfony/dependency-injection/Container.php
Gets a service.

File

vendor/symfony/dependency-injection/ContainerInterface.php, line 47

Class

ContainerInterface
ContainerInterface is the interface implemented by service container classes.

Namespace

Symfony\Component\DependencyInjection

Code

public function get(string $id, int $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) : ?object;

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal