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

PlaybackFailed::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 10
ccs 7
cts 7
cp 1
rs 10
cc 1
nc 1
nop 7
crap 1
1
<?php
2
3
namespace MaxBeckers\AmazonAlexa\Response\Directives\AudioPlayer;
4
5
use MaxBeckers\AmazonAlexa\Response\Directives\System\Error;
6
7
/**
8
 * @author Maximilian Beckers <[email protected]>
9
 */
10
class PlaybackFailed extends AbstractPlaybackDirective
11
{
12
    const TYPE = 'AudioPlayer.PlaybackFailed';
13
14
    /**
15
     * @var Error
16
     */
17
    public $error;
18
19
    /**
20
     * @var CurrentPlaybackState
21
     */
22
    public $currentPlaybackState;
23
24
    /**
25
     * @param string               $requestId
26
     * @param string               $timestamp
27
     * @param string               $token
28
     * @param int                  $offsetInMilliseconds
29
     * @param string               $locale
30
     * @param Error                $error
31
     * @param CurrentPlaybackState $currentPlaybackState
32
     *
33
     * @return PlaybackFailed
34
     */
35 5
    public static function create(string $requestId, string $timestamp, string $token, int $offsetInMilliseconds, string $locale, Error $error, CurrentPlaybackState $currentPlaybackState): self
36
    {
37 5
        $playbackFailed = new self();
38
39 5
        $playbackFailed->type                 = self::TYPE;
40 5
        $playbackFailed->error                = $error;
41 5
        $playbackFailed->currentPlaybackState = $currentPlaybackState;
42 5
        $playbackFailed->setProperties($requestId, $timestamp, $token, $offsetInMilliseconds, $locale);
43
44 5
        return $playbackFailed;
45
    }
46
}
47