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

Breadcrumb

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

function ParameterBag::set

Same name in this branch
  1. 11.1.x vendor/symfony/http-foundation/ParameterBag.php \Symfony\Component\HttpFoundation\ParameterBag::set()

Overrides ParameterBagInterface::set

1 call to ParameterBag::set()
ParameterBag::add in vendor/symfony/dependency-injection/ParameterBag/ParameterBag.php
Adds parameters to the service container parameters.
1 method overrides ParameterBag::set()
FrozenParameterBag::set in vendor/symfony/dependency-injection/ParameterBag/FrozenParameterBag.php
Sets a service container parameter.

File

vendor/symfony/dependency-injection/ParameterBag/ParameterBag.php, line 113

Class

ParameterBag
Holds parameters.

Namespace

Symfony\Component\DependencyInjection\ParameterBag

Code

public function set(string $name, array|bool|string|int|float|\UnitEnum|null $value) : void {
    if (is_numeric($name)) {
        throw new InvalidArgumentException(\sprintf('The parameter name "%s" cannot be numeric.', $name));
    }
    $this->parameters[$name] = $value;
}

API Navigation

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