| Total Complexity | 4 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 8 | class CombineInputSource implements InputSourceInterface |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var \Level23\Druid\InputSources\InputSourceInterface[] |
||
| 12 | */ |
||
| 13 | protected array $inputSources; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @param array<\Level23\Druid\InputSources\InputSourceInterface> $inputSources |
||
| 17 | */ |
||
| 18 | 2 | public function __construct(array $inputSources) |
|
| 19 | { |
||
| 20 | // Validate the input sources. |
||
| 21 | 2 | foreach ($inputSources as $inputSource) { |
|
| 22 | 2 | if (!$inputSource instanceof InputSourceInterface) { |
|
| 23 | 1 | throw new InvalidArgumentException('Only input sources are allowed!'); |
|
| 24 | } |
||
| 25 | } |
||
| 26 | |||
| 27 | 1 | $this->inputSources = $inputSources; |
|
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @return array<string,string|array<array<string,string|array<mixed>|bool|int>>> |
||
| 32 | */ |
||
| 33 | 1 | public function toArray(): array |
|
| 40 | ), |
||
| 41 | ]; |
||
| 43 | } |