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

CurrentPlaybackState::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 9
ccs 6
cts 6
cp 1
rs 10
cc 1
nc 1
nop 3
crap 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