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.

Property::getName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Isolate\UnitOfWork\Entity\Definition;
4
5
use Isolate\UnitOfWork\Exception\InvalidArgumentException;
6
7
/**
8
 * @api
9
 */
10
final class Property
11
{
12
    /**
13
     * @var string
14
     */
15
    private $name;
16
17
    /**
18
     * @var null|Association
19
     */
20
    private $association;
21
22
    /**
23
     * @param string $name
24
     * @param null|Association $association
25
     * @throws InvalidArgumentException
26
     */
27
    public function __construct($name, Association $association = null)
28
    {
29
        if (empty($name)) {
30
            throw new InvalidArgumentException("Property name can't be empty.");
31
        }
32
33
        if (!is_string($name)) {
34
            throw new InvalidArgumentException("Property name must be a valid string.");
35
        }
36
37
        $this->name = $name;
38
        $this->association = $association;
39
    }
40
41
    public function __toString()
42
    {
43
        return $this->name;
44
    }
45
46
    /**
47
     * @return string
48
     * 
49
     * @api
50
     */
51
    public function getName()
52
    {
53
        return $this->name;
54
    }
55
56
    /**
57
     * @return bool
58
     * 
59
     * @api
60
     */
61
    public function isAssociated()
62
    {
63
        return !is_null($this->association);
64
    }
65
66
    /**
67
     * @return null|Association
68
     * 
69
     * @api
70
     */
71
    public function getAssociation()
72
    {
73
        return $this->association;
74
    }
75
}
76