| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public static function from(DescriptorInterface $source): Descriptor |
||
| 13 | { |
||
| 14 | $target = new Descriptor( |
||
| 15 | $source->getName(), |
||
| 16 | $source->getMapping(), |
||
| 17 | $source->getIndexing() |
||
| 18 | ); |
||
| 19 | if ($source->getParentNames() !== null) { |
||
| 20 | $target->setParentNames($source->getParentNames()); |
||
| 21 | } |
||
| 22 | $target->setRootLevelDocument($source->isRootLevelDocument()); |
||
| 23 | return $target; |
||
| 24 | } |
||
| 36 |