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.

Attribute::getId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Netgen\InformationCollection\API\Value;
6
7
use eZ\Publish\API\Repository\Values\Content\Field;
8
use eZ\Publish\API\Repository\Values\ContentType\FieldDefinition;
9
use Netgen\InformationCollection\Doctrine\Entity\EzInfoCollectionAttribute;
10
11
final class Attribute extends ValueObject
12
{
13
    /**
14
     * @var \eZ\Publish\API\Repository\Values\Content\Field
15
     */
16
    protected $field;
17
18
    /**
19
     * @var \eZ\Publish\API\Repository\Values\ContentType\FieldDefinition
20
     */
21
    protected $fieldDefinition;
22
23
    /**
24
     * @var int
25
     */
26
    protected $id;
27
28
    /**
29
     * @var \Netgen\InformationCollection\API\Value\AttributeValue
30
     */
31
    protected $value;
32
33
    public function __construct(
34
        int $id,
35
        Field $field,
36
        FieldDefinition $fieldDefinition,
37
        AttributeValue $value
38
    ) {
39
        $this->id = $id;
40
        $this->field = $field;
41
        $this->fieldDefinition = $fieldDefinition;
42
        $this->value = $value;
43
    }
44
45
    public static function createFromAttributeAndValue(Attribute $attribute, AttributeValue $attributeValue)
46
    {
47
        return new self($attribute->getId(), $attribute->getField(), $attribute->getFieldDefinition(), $attributeValue);
48
    }
49
50
    /**
51
     * @return Field
52
     */
53
    public function getField(): Field
54
    {
55
        return $this->field;
56
    }
57
58
    /**
59
     * @return FieldDefinition
60
     */
61
    public function getFieldDefinition(): FieldDefinition
62
    {
63
        return $this->fieldDefinition;
64
    }
65
66
    /**
67
     * @return int
68
     */
69
    public function getId(): int
70
    {
71
        return $this->id;
72
    }
73
74
    /**
75
     * @return AttributeValue
76
     */
77
    public function getValue(): AttributeValue
78
    {
79
        return $this->value;
80
    }
81
}
82