| 1 | <?php |
||
| 23 | class ProcessorChain |
||
| 24 | { |
||
| 25 | /** |
||
| 26 | * @var ProcessorInterface[] |
||
| 27 | */ |
||
| 28 | private $processors; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param ProcessorInterface[] $processors |
||
| 32 | * |
||
| 33 | * @throws \InvalidArgumentException |
||
| 34 | */ |
||
| 35 | 45 | public function __construct(array $processors) |
|
| 36 | { |
||
| 37 | 45 | foreach ($processors as $processor) { |
|
| 38 | 27 | if (false === $processor instanceof ProcessorInterface) { |
|
| 39 | 3 | throw new \InvalidArgumentException('Expected a Nelmio\Alice\ProcessorInterface instance'); |
|
| 40 | } |
||
| 41 | 45 | } |
|
| 42 | |||
| 43 | 45 | $this->processors = $processors; |
|
| 44 | 45 | } |
|
| 45 | |||
| 46 | /** |
||
| 47 | * @return array |
||
| 48 | */ |
||
| 49 | 30 | public function getProcessors() |
|
| 53 | } |
||
| 54 |