Conditions | 5 |
Paths | 9 |
Total Lines | 19 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
25 | public static function merge(IndexingInterface ...$indexings): Indexing |
||
26 | { |
||
27 | $analysis = new Analysis(); |
||
28 | $target = (new Indexing())->setAnalysis($analysis); |
||
29 | foreach ($indexings as $source) { |
||
30 | $target->setType($source->getType()); |
||
31 | if (!empty($source->getReadIndices())) { |
||
32 | $target->setReadIndices($source->getReadIndices()); |
||
33 | } |
||
34 | if (!empty($source->getWriteIndices())) { |
||
35 | $target->setWriteIndices($source->getWriteIndices()); |
||
36 | } |
||
37 | foreach ($source->getOptions() as $option => $value) { |
||
38 | $target->setOption($option, $value); |
||
39 | } |
||
40 | $analysis = AnalysisOperations::merge($target->getAnalysis(), $source->getAnalysis()); |
||
41 | $target->setAnalysis($analysis); |
||
42 | } |
||
43 | return $target; |
||
44 | } |
||
46 |