You are here

public function RepeatedPass::__construct in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php \Symfony\Component\DependencyInjection\Compiler\RepeatedPass::__construct()

Constructor.

Parameters

RepeatablePassInterface[] $passes An array of RepeatablePassInterface objects:

Throws

InvalidArgumentException when the passes don't implement RepeatablePassInterface

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php, line 41

Class

RepeatedPass
A pass that might be run repeatedly.

Namespace

Symfony\Component\DependencyInjection\Compiler

Code

public function __construct(array $passes) {
  foreach ($passes as $pass) {
    if (!$pass instanceof RepeatablePassInterface) {
      throw new InvalidArgumentException('$passes must be an array of RepeatablePassInterface.');
    }
    $pass
      ->setRepeatedPass($this);
  }
  $this->passes = $passes;
}