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

PlaybackFailed   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 10
c 1
b 0
f 0
dl 0
loc 35
ccs 7
cts 7
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 10 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