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.

getChangesForRemovedEntities()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
c 0
b 0
f 0
rs 9.4285
cc 3
eloc 6
nc 3
nop 0
1
<?php
2
3
namespace Isolate\UnitOfWork\Entity\Value\Change;
4
5
use Isolate\UnitOfWork\Entity\Definition\Property;
6
use Isolate\UnitOfWork\Entity\Value\Change;
7
use Isolate\UnitOfWork\Entity\Value\Change\EditedEntity;
8
use Isolate\UnitOfWork\Entity\Value\Change\NewEntity;
9
use Isolate\UnitOfWork\Entity\Value\Change\RemovedEntity;
10
11
final class AssociatedCollection implements Change
12
{
13
    /**
14
     * @var mixed
15
     */
16
    private $originValue;
17
18
    /**
19
     * @var mixed
20
     */
21
    private $newValue;
22
23
    /**
24
     * @var Property
25
     */
26
    private $property;
27
    /**
28
     * @var array
29
     */
30
    private $changes;
31
32
    /**
33
     * @param Property $property
34
     * @param $originValue
35
     * @param $newValue
36
     * @param array $changes
37
     */
38
    public function __construct(Property $property, $originValue, $newValue, array $changes)
39
    {
40
        $this->property = $property;
41
        $this->originValue = $originValue;
42
        $this->newValue = $newValue;
43
        $this->changes = $changes;
44
    }
45
46
    /**
47
     * @return mixed
48
     */
49
    public function getOriginValue()
50
    {
51
        return $this->originValue;
52
    }
53
54
    /**
55
     * @return mixed
56
     */
57
    public function getNewValue()
58
    {
59
        return $this->newValue;
60
    }
61
62
    /**
63
     * @return Property
64
     */
65
    public function getProperty()
66
    {
67
        return $this->property;
68
    }
69
70
    /**
71
     * @return array|NewEntity[]
72
     * 
73
     * @api
74
     */
75
    public function getChangeForNewEntities()
76
    {
77
        $new = [];
78
        foreach ($this->changes as $change) {
79
            if ($change instanceof NewEntity) {
80
                $new[] = $change;
81
            }
82
        }
83
84
        return $new;
85
    }
86
87
    /**
88
     * @return array|RemovedEntity[]
89
     * 
90
     * @api
91
     */
92
    public function getChangesForRemovedEntities()
93
    {
94
        $removed = [];
95
        foreach ($this->changes as $change) {
96
            if ($change instanceof RemovedEntity) {
97
                $removed[] = $change;
98
            }
99
        }
100
101
        return $removed;
102
    }
103
104
    /**
105
     * @return array|EditedEntity[]
106
     * 
107
     * @api
108
     */
109
    public function getChangesForEditedEntities()
110
    {
111
        $edited = [];
112
        foreach ($this->changes as $change) {
113
            if ($change instanceof EditedEntity) {
114
                $edited[] = $change;
115
            }
116
        }
117
118
        return $edited;
119
    }
120
121
    /**
122
     * @param $propertyName
123
     * @return bool
124
     */
125
    public function isFor($propertyName)
126
    {
127
        return $this->property->getName() === $propertyName;
128
    }
129
}
130