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\CompilerCode
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;
}