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

Breadcrumb

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

function ContainerBuilder::deprecateParameter

Deprecates a service container parameter.

Throws

ParameterNotFoundException if the parameter is not defined

File

vendor/symfony/dependency-injection/ContainerBuilder.php, line 762

Class

ContainerBuilder
ContainerBuilder is a DI container that provides an API to easily describe services.

Namespace

Symfony\Component\DependencyInjection

Code

public function deprecateParameter(string $name, string $package, string $version, string $message = 'The parameter "%s" is deprecated.') : void {
    if (!$this->parameterBag instanceof ParameterBag) {
        throw new BadMethodCallException(\sprintf('The parameter bag must be an instance of "%s" to call "%s".', ParameterBag::class, __METHOD__));
    }
    $this->parameterBag
        ->deprecate($name, $package, $version, $message);
}

API Navigation

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