Passed
Push — develop ( 06ad9c...85b5fc )
by Daniel
05:05
created

FeatureColumnsFactory::getItemFactory()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Silverback\ApiComponentBundle\Factory\Entity\Content\Component\Feature\Columns;
4
5
use Doctrine\Common\Persistence\ObjectManager;
6
use Silverback\ApiComponentBundle\Entity\Content\Component\Feature\Columns\FeatureColumns;
7
use Silverback\ApiComponentBundle\Factory\Entity\Content\Component\AbstractComponentFactory;
8
use Symfony\Component\Validator\Validator\ValidatorInterface;
9
10
class FeatureColumnsFactory extends AbstractComponentFactory
11
{
12
    /** @var FeatureColumnsItemFactory  */
13
    private $featureColumnsItemFactory;
14
15 3
    public function __construct(ObjectManager $manager, ValidatorInterface $validator, FeatureColumnsItemFactory $featureColumnsItemFactory)
16
    {
17 3
        $this->featureColumnsItemFactory = $featureColumnsItemFactory;
18 3
        parent::__construct($manager, $validator);
19 3
    }
20
21
    public function getItemFactory()
22
    {
23
        return $this->featureColumnsItemFactory;
24
    }
25
26
    /**
27
     * @inheritdoc
28
     */
29 2
    public function create(?array $ops = null): FeatureColumns
30
    {
31 2
        $component = new FeatureColumns();
32 2
        $this->init($component, $ops);
33 2
        $this->validate($component);
34 2
        return $component;
35
    }
36
37
    /**
38
     * @inheritdoc
39
     */
40 3
    public static function defaultOps(): array
41
    {
42 3
        return array_merge(
43 3
            parent::defaultOps(),
44
            [
45 3
                'title' => null
46
            ]
47
        );
48
    }
49
}
50