Passed
Push — master ( 792d70...44c05d )
by Maximilian
01:22 queued 16s
created

CurrentPlaybackState   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 14
c 1
b 0
f 0
dl 0
loc 39
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 9 1
1
<?php
2
3
namespace MaxBeckers\AmazonAlexa\Response\Directives\AudioPlayer;
4
5
/**
6
 * @author Maximilian Beckers <[email protected]>
7
 */
8
class CurrentPlaybackState
9
{
10
    const PLAYER_ACTIVITY_PLAYING         = 'PLAYING';
11
    const PLAYER_ACTIVITY_PAUSED          = 'PAUSED';
12
    const PLAYER_ACTIVITY_FINISHED        = 'FINISHED';
13
    const PLAYER_ACTIVITY_BUFFER_UNDERRUN = 'BUFFER_UNDERRUN';
14
    const PLAYER_ACTIVITY_IDLE            = 'IDLE';
15
16
    /**
17
     * @var string
18
     */
19
    public $token;
20
21
    /**
22
     * @var int
23
     */
24
    public $offsetInMilliseconds;
25
26
    /**
27
     * @var string
28
     */
29
    public $playerActivity;
30
31
    /**
32
     * @param string $token
33
     * @param int    $offsetInMilliseconds
34
     * @param string $playerActivity
35
     *
36
     * @return CurrentPlaybackState
37
     */
38 5
    public static function create(string $token, int $offsetInMilliseconds, string $playerActivity): self
39
    {
40 5
        $currentPlaybackState = new self();
41
42 5
        $currentPlaybackState->token                = $token;
43 5
        $currentPlaybackState->offsetInMilliseconds = $offsetInMilliseconds;
44 5
        $currentPlaybackState->playerActivity       = $playerActivity;
45
46 5
        return $currentPlaybackState;
47
    }
48
}
49