Passed
Push — develop ( 4ccf1b...14897c )
by Daniel
04:51
created

GalleryFactory::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\Gallery;
4
5
use Doctrine\Common\Persistence\ObjectManager;
6
use Silverback\ApiComponentBundle\Entity\Content\Component\Gallery\Gallery;
7
use Silverback\ApiComponentBundle\Factory\Entity\Content\Component\AbstractComponentFactory;
8
use Symfony\Component\Validator\Validator\ValidatorInterface;
9
10
/**
11
 * @author Daniel West <[email protected]>
12
 */
13
final class GalleryFactory extends AbstractComponentFactory
14
{
15
    /** @var GalleryItemFactory  */
16
    private $itemFactory;
17
18 3
    public function __construct(ObjectManager $manager, ValidatorInterface $validator, GalleryItemFactory $itemFactory)
19
    {
20 3
        $this->itemFactory = $itemFactory;
21 3
        parent::__construct($manager, $validator);
22 3
    }
23
24
    public function getItemFactory()
25
    {
26
        return $this->itemFactory;
27
    }
28
29
    /**
30
     * @inheritdoc
31
     */
32 2
    public function create(?array $ops = null): Gallery
33
    {
34 2
        $component = new Gallery();
35 2
        $this->init($component, $ops);
36 2
        $this->validate($component);
37 2
        return $component;
38
    }
39
}
40