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

Breadcrumb

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

class ServiceClosureArgument

Represents a service wrapped in a memoizing closure.

@author Nicolas Grekas <p@tchwork.com>

Hierarchy

  • class \Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument implements \Symfony\Component\DependencyInjection\Argument\ArgumentInterface

Expanded class hierarchy of ServiceClosureArgument

16 files declare their use of ServiceClosureArgument
AbstractConfigurator.php in vendor/symfony/dependency-injection/Loader/Configurator/AbstractConfigurator.php
AddConsoleCommandPass.php in vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php
AutowireServiceClosure.php in vendor/symfony/dependency-injection/Attribute/AutowireServiceClosure.php
CheckTypeDeclarationsPass.php in vendor/symfony/dependency-injection/Compiler/CheckTypeDeclarationsPass.php
ContainerBuilder.php in vendor/symfony/dependency-injection/ContainerBuilder.php

... See full list

File

vendor/symfony/dependency-injection/Argument/ServiceClosureArgument.php, line 21

Namespace

Symfony\Component\DependencyInjection\Argument
View source
class ServiceClosureArgument implements ArgumentInterface {
    private array $values;
    public function __construct(mixed $value) {
        $this->values = [
            $value,
        ];
    }
    public function getValues() : array {
        return $this->values;
    }
    public function setValues(array $values) : void {
        if ([
            0,
        ] !== array_keys($values)) {
            throw new InvalidArgumentException('A ServiceClosureArgument must hold one and only one value.');
        }
        $this->values = $values;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
ServiceClosureArgument::$values private property
ServiceClosureArgument::getValues public function Overrides ArgumentInterface::getValues
ServiceClosureArgument::setValues public function Overrides ArgumentInterface::setValues
ServiceClosureArgument::__construct public function

API Navigation

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