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 ( 6a4c44...6f222d )
by Mario
02:28
created

ValueObject::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 1
1
<?php
2
3
namespace Netgen\Bundle\InformationCollectionBundle\Value;
4
5
use Netgen\Bundle\InformationCollectionBundle\Exception\PropertyNotFoundException;
6
use Netgen\Bundle\InformationCollectionBundle\Exception\PropertyReadOnlyException;
7
8
abstract class ValueObject
9
{
10
    /**
11
     * ValueObject constructor.
12
     *
13
     * @param array $properties
14
     */
15
    public function __construct(array $properties = array())
16
    {
17
        foreach ($properties as $property => $value) {
18
            $this->$property = $value;
19
        }
20
    }
21
22
    /**
23
     * Disables magic set
24
     *
25
     * @param string $property
26
     * @param mixed $value
27
     *
28
     * @throws PropertyNotFoundException
29
     * @throws PropertyReadOnlyException
30
     */
31 View Code Duplication
    public function __set($property, $value)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
32
    {
33
        if (property_exists($this, $property)) {
34
            throw new PropertyReadOnlyException($property, get_class($this));
35
        }
36
        throw new PropertyNotFoundException($property, get_class($this));
37
    }
38
39
    /**
40
     * Magic get
41
     *
42
     * @param string $property
43
     *
44
     * @return mixed
45
     *
46
     * @throws PropertyNotFoundException
47
     */
48 View Code Duplication
    public function __get($property)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
49
    {
50
        if (property_exists($this, $property)) {
51
            return $this->$property;
52
        }
53
54
        throw new PropertyNotFoundException($property, get_class($this));
55
    }
56
}
57