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.

Payload   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 52
c 0
b 0
f 0
wmc 7
lcom 1
cbo 2
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setClaim() 0 4 1
A findClaimByName() 0 11 3
A getClaims() 0 4 1
A jsonSerialize() 0 4 1
1
<?php
2
3
namespace Emarref\Jwt\Token;
4
5
use Emarref\Jwt\Claim;
6
7
class Payload implements \JsonSerializable
8
{
9
    /**
10
     * @var PropertyList
11
     */
12
    protected $propertyList;
13
14
    public function __construct()
15
    {
16
        $this->propertyList = new PropertyList();
17
    }
18
19
    /**
20
     * @param Claim\ClaimInterface $claim
21
     */
22
    public function setClaim(Claim\ClaimInterface $claim)
23
    {
24
        $this->propertyList->setProperty($claim);
25
    }
26
27
    /**
28
     * @param string $name
29
     * @return Claim\ClaimInterface|null
30
     */
31
    public function findClaimByName($name)
32
    {
33
        foreach ($this->propertyList as $claim) {
34
            /** @var Claim\ClaimInterface $claim */
35
            if ($claim->getName() === $name) {
36
                return $claim;
37
            }
38
        }
39
40
        return null;
41
    }
42
43
    /**
44
     * @return PropertyList
45
     */
46
    public function getClaims()
47
    {
48
        return $this->propertyList;
49
    }
50
51
    /**
52
     * @return string
53
     */
54
    public function jsonSerialize()
55
    {
56
        return $this->propertyList->jsonSerialize();
57
    }
58
}
59