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.

Artist   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 93
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 0
dl 0
loc 93
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 15 1
A getName() 0 4 1
A getMbid() 0 4 1
A getTmid() 0 4 1
A getSortName() 0 4 1
A getDisambiguation() 0 4 1
A getUrl() 0 4 1
A fromApi() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * (c) Christian Gripp <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Core23\SetlistFm\Model;
13
14
final class Artist
15
{
16
    /**
17
     * @var string
18
     */
19
    private $name;
20
21
    /**
22
     * @var string|null
23
     */
24
    private $mbid;
25
26
    /**
27
     * @var int|null
28
     */
29
    private $tmid;
30
31
    /**
32
     * @var string|null
33
     */
34
    private $sortName;
35
36
    /**
37
     * @var string|null
38
     */
39
    private $disambiguation;
40
41
    /**
42
     * @var string|null
43
     */
44
    private $url;
45
46
    public function __construct(
47
        string $name,
48
        ?string $mbid,
49
        ?int $tmid,
50
        ?string $sortName,
51
        ?string $disambiguation,
52
        ?string $url
53
    ) {
54
        $this->name           = $name;
55
        $this->mbid           = $mbid;
56
        $this->tmid           = $tmid;
57
        $this->sortName       = $sortName;
58
        $this->disambiguation = $disambiguation;
59
        $this->url            = $url;
60
    }
61
62
    public function getName(): string
63
    {
64
        return $this->name;
65
    }
66
67
    public function getMbid(): ?string
68
    {
69
        return $this->mbid;
70
    }
71
72
    public function getTmid(): ?int
73
    {
74
        return $this->tmid;
75
    }
76
77
    public function getSortName(): ?string
78
    {
79
        return $this->sortName;
80
    }
81
82
    public function getDisambiguation(): ?string
83
    {
84
        return $this->disambiguation;
85
    }
86
87
    public function getUrl(): ?string
88
    {
89
        return $this->url;
90
    }
91
92
    /**
93
     * @return Artist
94
     */
95
    public static function fromApi(array $data): self
96
    {
97
        return new self(
98
            $data['name'],
99
            $data['mbid'] ?? null,
100
            $data['tmid'] ?? null,
101
            $data['sortName'] ?? null,
102
            $data['disambiguation'] ?? null,
103
            $data['url'] ?? null
104
        );
105
    }
106
}
107