Total Complexity | 7 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
10 | class CompositeDataHandler implements DataHandlerInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var iterable<DataHandlerInterface> |
||
14 | */ |
||
15 | private iterable $dataHandlers; |
||
16 | |||
17 | public function __construct(iterable $dataHandlers) |
||
18 | { |
||
19 | $this->dataHandlers = $dataHandlers; |
||
20 | } |
||
21 | |||
22 | public function supports(DataSourceInterface $dataSource): bool |
||
23 | { |
||
24 | foreach ($this->dataHandlers as $dataHandler) { |
||
25 | if ($dataHandler->supports($dataSource)) { |
||
26 | return true; |
||
27 | } |
||
28 | } |
||
29 | |||
30 | return false; |
||
31 | } |
||
32 | |||
33 | public function handle(DataSourceInterface $dataSource) |
||
42 | } |
||
43 | } |
||
44 |