Passed
Push — develop ( e0f0df...fa4b42 )
by Daniel
05:31
created

ComponentGroupFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 20
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A defaultOps() 0 4 1
A create() 0 6 1
1
<?php
2
3
namespace Silverback\ApiComponentBundle\Factory\Entity\Content;
4
5
use Silverback\ApiComponentBundle\Entity\Content\ComponentGroup;
6
use Silverback\ApiComponentBundle\Factory\Entity\AbstractFactory;
7
8
class ComponentGroupFactory extends AbstractFactory
9
{
10
    /**
11
     * @inheritdoc
12
     */
13 1
    public function create(?array $ops = null): ComponentGroup
14
    {
15 1
        $component = new ComponentGroup();
16 1
        $this->init($component, $ops);
17 1
        $this->validate($component);
18 1
        return $component;
19
    }
20
21
    /**
22
     * @inheritdoc
23
     */
24 2
    protected static function defaultOps(): array
25
    {
26
        return [
27 2
            'parent' => null
28
        ];
29
    }
30
}
31