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 ( c7f4e3...a41792 )
by Mario
18:09
created

Attribute::getValue()   A

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\Content;
0 ignored issues
show
Bug introduced by
This use statement conflicts with another class in this namespace, Netgen\InformationCollection\API\Value\Content.

Let’s assume that you have a directory layout like this:

.
|-- OtherDir
|   |-- Bar.php
|   `-- Foo.php
`-- SomeDir
    `-- Foo.php

and let’s assume the following content of Bar.php:

// Bar.php
namespace OtherDir;

use SomeDir\Foo; // This now conflicts the class OtherDir\Foo

If both files OtherDir/Foo.php and SomeDir/Foo.php are loaded in the same runtime, you will see a PHP error such as the following:

PHP Fatal error:  Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php

However, as OtherDir/Foo.php does not necessarily have to be loaded and the error is only triggered if it is loaded before OtherDir/Bar.php, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias:

// Bar.php
namespace OtherDir;

use SomeDir\Foo as SomeDirFoo; // There is no conflict anymore.
Loading history...
8
use eZ\Publish\API\Repository\Values\Content\Field;
9
use eZ\Publish\API\Repository\Values\ContentType\FieldDefinition;
10
use Netgen\InformationCollection\Doctrine\Entity\EzInfoCollectionAttribute;
11
12
final class Attribute extends ValueObject
13
{
14
    /**
15
     * @var \Netgen\InformationCollection\Doctrine\Entity\EzInfoCollectionAttribute
16
     */
17
    protected $attribute;
18
19
    /**
20
     * @var \eZ\Publish\API\Repository\Values\Content\Field
21
     */
22
    protected $field;
23
24
    /**
25
     * @var \eZ\Publish\API\Repository\Values\ContentType\FieldDefinition
26
     */
27
    protected $fieldDefinition;
28
29
    /**
30
     * @var int
31
     */
32
    protected $id;
33
34
    /**
35
     * @var \eZ\Publish\API\Repository\Values\Content\Content
36
     */
37
    protected $content;
38
39
    /**
40
     * @var \Netgen\InformationCollection\API\Value\AttributeValue
41
     */
42
    protected $value;
43
44
    public function __construct(
45
        int $id,
46
        Content $content,
47
        Field $field,
48
        FieldDefinition $fieldDefinition,
49
        AttributeValue $value
50
    )
51
    {
52
        $this->id = $id;
53
        $this->content = $content;
54
        $this->field = $field;
55
        $this->fieldDefinition = $fieldDefinition;
56
        $this->value = $value;
57
    }
58
59
    /**
60
     * @return EzInfoCollectionAttribute
61
     */
62
    public function getAttribute(): EzInfoCollectionAttribute
63
    {
64
        return $this->attribute;
65
    }
66
67
    /**
68
     * @return Field
69
     */
70
    public function getField(): Field
71
    {
72
        return $this->field;
73
    }
74
75
    /**
76
     * @return FieldDefinition
77
     */
78
    public function getFieldDefinition(): FieldDefinition
79
    {
80
        return $this->fieldDefinition;
81
    }
82
83
    /**
84
     * @return int
85
     */
86
    public function getId(): int
87
    {
88
        return $this->id;
89
    }
90
91
    /**
92
     * @return Content
93
     */
94
    public function getContent(): Content
95
    {
96
        return $this->content;
97
    }
98
99
    /**
100
     * @return AttributeValue
101
     */
102
    public function getValue(): AttributeValue
103
    {
104
        return $this->value;
105
    }
106
}
107