Completed
Push — master ( b4f572...d20dd2 )
by Alex
13s queued 11s
created

AbstractFixture   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 51
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A hasCollectionReference() 0 3 1
A addCollectionReference() 0 3 1
A getCollectionReference() 0 3 1
A __construct() 0 3 1
A setCollectionReference() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arp\LaminasDoctrineFixtures\Service\Fixture;
6
7
use Arp\LaminasDoctrineFixtures\Service\Repository\ReferenceRepository;
8
9
/**
10
 * @author  Alex Patterson <[email protected]>
11
 * @package Arp\LaminasDoctrineFixtures\Service\Fixture
12
 */
13
abstract class AbstractFixture extends \Doctrine\Common\DataFixtures\AbstractFixture
14
{
15
    /**
16
     * @var ReferenceRepository
17
     */
18
    protected $referenceRepository;
19
20
    /**
21
     * @param ReferenceRepository $referenceRepository
22
     */
23
    public function __construct(ReferenceRepository $referenceRepository)
24
    {
25
        $this->referenceRepository = $referenceRepository;
26
    }
27
28
    /**
29
     * @param string $name
30
     *
31
     * @return bool
32
     */
33
    public function hasCollectionReference(string $name): bool
34
    {
35
        return $this->referenceRepository->hasCollectionReference($name);
36
    }
37
38
    /**
39
     * @param string $name
40
     *
41
     * @return iterable
42
     */
43
    public function getCollectionReference(string $name): iterable
44
    {
45
        return $this->referenceRepository->getCollectionReference($name);
46
    }
47
48
    /**
49
     * @param string   $name
50
     * @param iterable $collection
51
     */
52
    public function setCollectionReference(string $name, iterable $collection): void
53
    {
54
        $this->referenceRepository->setCollectionReference($name, $collection);
55
    }
56
57
    /**
58
     * @param string $name
59
     * @param iterable $collection
60
     */
61
    public function addCollectionReference(string $name, iterable $collection): void
62
    {
63
        $this->referenceRepository->addCollectionReference($name, $collection);
64
    }
65
}
66