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

Operations   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 12
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A from() 0 10 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