Passed
Push — feature/initial-implementation ( fae671...591f29 )
by Fike
02:37
created

Operations::from()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 8
nc 1
nop 1
1
<?php
2
3
namespace AmaTeam\ElasticSearch\Entity;
4
5
use AmaTeam\ElasticSearch\API\Entity;
6
use AmaTeam\ElasticSearch\API\EntityInterface;
7
8
class Operations
9
{
10
    public static function from(EntityInterface $entity): Entity
11
    {
12
        return (new Entity($entity->getName()))
13
            ->setParentNames($entity->getParentNames())
14
            ->setOriginalDescriptor($entity->getOriginalDescriptor())
15
            ->setHierarchy($entity->getHierarchy())
16
            ->setCompiledDescriptor($entity->getCompiledDescriptor())
17
            ->setRootLevelDocument($entity->isRootLevelDocument())
18
            ->setIndexing($entity->getIndexing())
19
            ->setMapping($entity->getMapping());
20
    }
21
}
22