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

Breadcrumb

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

function PassConfig::addPass

Adds a pass.

Throws

InvalidArgumentException when a pass type doesn't exist

File

vendor/symfony/dependency-injection/Compiler/PassConfig.php, line 128

Class

PassConfig
Compiler Pass Configuration.

Namespace

Symfony\Component\DependencyInjection\Compiler

Code

public function addPass(CompilerPassInterface $pass, string $type = self::TYPE_BEFORE_OPTIMIZATION, int $priority = 0) : void {
    $property = $type . 'Passes';
    if (!isset($this->{$property})) {
        throw new InvalidArgumentException(\sprintf('Invalid type "%s".', $type));
    }
    $passes =& $this->{$property};
    if (!isset($passes[$priority])) {
        $passes[$priority] = [];
    }
    $passes[$priority][] = $pass;
}
RSS feed
Powered by Drupal