PlaybackFailed::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 7
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MaxBeckers\AmazonAlexa\Response\Directives\AudioPlayer;
6
7
use MaxBeckers\AmazonAlexa\Response\Directives\System\Error;
8
9
class PlaybackFailed extends AbstractPlaybackDirective
10
{
11
    public const TYPE = 'AudioPlayer.PlaybackFailed';
12
13 5
    public function __construct(
14
        public ?Error $error = null,
15
        public ?CurrentPlaybackState $currentPlaybackState = null,
16
        string $requestId = '',
17
        string $timestamp = '',
18
        string $token = '',
19
        int $offsetInMilliseconds = 0,
20
        string $locale = ''
21
    ) {
22 5
        parent::__construct($requestId, $timestamp, $token, $offsetInMilliseconds, $locale);
23 5
        $this->type = self::TYPE;
24
    }
25
26 5
    public static function create(string $requestId, string $timestamp, string $token, int $offsetInMilliseconds, string $locale, Error $error, CurrentPlaybackState $currentPlaybackState): self
27
    {
28 5
        return new self($error, $currentPlaybackState, $requestId, $timestamp, $token, $offsetInMilliseconds, $locale);
29
    }
30
}
31