AbstractFixture   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 6
c 1
b 0
f 0
dl 0
loc 47
rs 10

4 Methods

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