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