GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( b06310...01ffbc )
by Mario
02:36
created

RepositoryAggregate   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 2
cbo 2
dl 0
loc 64
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A createMain() 0 8 1
A createChild() 0 9 1
1
<?php
2
3
namespace Netgen\Bundle\InformationCollectionBundle\Repository;
4
5
use eZ\Publish\API\Repository\Values\Content\Location;
6
use eZ\Publish\API\Repository\Values\User\User;
7
use Netgen\Bundle\InformationCollectionBundle\Entity\EzInfoCollection;
8
use Netgen\Bundle\InformationCollectionBundle\Entity\EzInfoCollectionAttribute;
9
use Netgen\Bundle\InformationCollectionBundle\Value\LegacyData;
10
11
class RepositoryAggregate
12
{
13
    /**
14
     * @var EzInfoCollectionRepository
15
     */
16
    protected $infoCollectionRepository;
17
18
    /**
19
     * @var EzInfoCollectionAttributeRepository
20
     */
21
    protected $infoCollectionAttributeRepository;
22
23
    /**
24
     * RepositoryAggregate constructor.
25
     *
26
     * @param EzInfoCollectionRepository $infoCollectionRepository
27
     * @param EzInfoCollectionAttributeRepository $infoCollectionAttributeRepository
28
     */
29
    public function __construct(
30
        EzInfoCollectionRepository $infoCollectionRepository,
31
        EzInfoCollectionAttributeRepository $infoCollectionAttributeRepository
32
    )
33
    {
34
        $this->infoCollectionRepository = $infoCollectionRepository;
35
        $this->infoCollectionAttributeRepository = $infoCollectionAttributeRepository;
36
    }
37
38
    /**
39
     * Creates EzInfoCollection instance
40
     *
41
     * @param Location $location
42
     * @param User $currentUser
43
     *
44
     * @return \Netgen\Bundle\InformationCollectionBundle\Entity\EzInfoCollection
45
     */
46
    public function createMain(Location $location, User $currentUser)
47
    {
48
        $main = $this->infoCollectionRepository->createWithValues($location, $currentUser);
49
50
        $this->infoCollectionRepository->save($main);
51
52
        return $main;
53
    }
54
55
    /**
56
     * Creates EzInfoCollectionAttribute instance
57
     *
58
     * @param Location $location
59
     * @param EzInfoCollection $ezInfoCollection
60
     * @param int $fieldId
61
     * @param LegacyData $value
62
     *
63
     * @return \Netgen\Bundle\InformationCollectionBundle\Entity\EzInfoCollectionAttribute
64
     */
65
    public function createChild(Location $location, EzInfoCollection $ezInfoCollection, $fieldId, LegacyData $value)
66
    {
67
        $child = $this->infoCollectionAttributeRepository
68
            ->createWithValues($location, $ezInfoCollection, $fieldId, $value);
69
70
        $this->infoCollectionAttributeRepository->save($child);
71
72
        return $child;
73
    }
74
}
75