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

Breadcrumb

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

function ParameterBag::deprecate

Deprecates a service container parameter.

Throws

ParameterNotFoundException if the parameter is not defined

1 method overrides ParameterBag::deprecate()
FrozenParameterBag::deprecate in vendor/symfony/dependency-injection/ParameterBag/FrozenParameterBag.php
Deprecates a service container parameter.

File

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

Class

ParameterBag
Holds parameters.

Namespace

Symfony\Component\DependencyInjection\ParameterBag

Code

public function deprecate(string $name, string $package, string $version, string $message = 'The parameter "%s" is deprecated.') : void {
    if (!\array_key_exists($name, $this->parameters)) {
        throw new ParameterNotFoundException($name);
    }
    $this->deprecatedParameters[$name] = [
        $package,
        $version,
        $message,
        $name,
    ];
}

API Navigation

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