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.

PropertyList::getIterator()   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 Emarref\Jwt\Token;
4
5
class PropertyList implements \JsonSerializable, \IteratorAggregate
6
{
7
    /**
8
     * @var \ArrayObject
9
     */
10
    protected $properties;
11
12
    public function __construct()
13
    {
14
        $this->properties = new \ArrayObject();
15
    }
16
17
    /**
18
     * @param PropertyInterface $property
19
     */
20
    public function setProperty(PropertyInterface $property)
21
    {
22
        $this->properties[$property->getName()] = $property;
23
    }
24
25
    /**
26
     * @return string
27
     */
28
    public function jsonSerialize()
29
    {
30
        $properties = new \stdClass();
31
32
        foreach ($this->properties as $property) {
33
            $name  = $property->getName();
34
            $value = $property->getValue();
35
36
            if (empty($name) || empty($value)) {
37
                continue;
38
            }
39
40
            $properties->$name = $value;
41
        }
42
43
        return json_encode($properties);
44
    }
45
46
    /**
47
     * @return PropertyInterface[]
48
     */
49
    public function getIterator()
50
    {
51
        return $this->properties;
52
    }
53
}
54