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 ( eb5d91...88919e )
by Christian
01:39
created

NowPlaying   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 117
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setAlbum() 0 4 1
A setTrackNumber() 0 4 1
A setContext() 0 4 1
A setMbid() 0 4 1
A setDuration() 0 4 1
A setAlbumArtist() 0 4 1
A toArray() 0 13 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\LastFm\Model;
13
14
final class NowPlaying
15
{
16
    /**
17
     * @var string
18
     */
19
    private $artist;
20
21
    /**
22
     * @var string
23
     */
24
    private $track;
25
26
    /**
27
     * @var string
28
     */
29
    private $album;
30
31
    /**
32
     * @var int|null
33
     */
34
    private $trackNumber;
35
36
    /**
37
     * @var string|null
38
     */
39
    private $context;
40
41
    /**
42
     * @var string|null
43
     */
44
    private $mbid;
45
46
    /**
47
     * @var string|null
48
     */
49
    private $duration;
50
51
    /**
52
     * @var string|null
53
     */
54
    private $albumArtist;
55
56
    /**
57
     * @param string $artist
58
     * @param string $track
59
     */
60
    public function __construct(string $artist, string $track)
61
    {
62
        $this->artist = $artist;
63
        $this->track  = $track;
64
    }
65
66
    /**
67
     * @param string $album
68
     */
69
    public function setAlbum(string $album): void
70
    {
71
        $this->album = $album;
72
    }
73
74
    /**
75
     * @param int|null $trackNumber
76
     */
77
    public function setTrackNumber(?int $trackNumber): void
78
    {
79
        $this->trackNumber = $trackNumber;
80
    }
81
82
    /**
83
     * @param string|null $context
84
     */
85
    public function setContext(?string $context): void
86
    {
87
        $this->context = $context;
88
    }
89
90
    /**
91
     * @param string|null $mbid
92
     */
93
    public function setMbid(?string $mbid): void
94
    {
95
        $this->mbid = $mbid;
96
    }
97
98
    /**
99
     * @param string|null $duration
100
     */
101
    public function setDuration(?string $duration): void
102
    {
103
        $this->duration = $duration;
104
    }
105
106
    /**
107
     * @param string|null $albumArtist
108
     */
109
    public function setAlbumArtist(?string $albumArtist): void
110
    {
111
        $this->albumArtist = $albumArtist;
112
    }
113
114
    /**
115
     * @return array
116
     */
117
    public function toArray(): array
118
    {
119
        return [
120
            'artist'      => $this->artist,
121
            'track'       => $this->track,
122
            'album'       => $this->album,
123
            'trackNumber' => $this->trackNumber,
124
            'context'     => $this->context,
125
            'mbid'        => $this->mbid,
126
            'duration'    => $this->duration,
127
            'albumArtist' => $this->albumArtist,
128
        ];
129
    }
130
}
131