Pattern::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 4
dl 0
loc 6
ccs 1
cts 1
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MaxBeckers\AmazonAlexa\Response\Directives\GameEngine;
6
7
class Pattern
8
{
9
    public const ACTION_DOWN = 'down';
10
    public const ACTION_UP = 'up';
11
    public const ACTION_SILENCE = 'silence';
12
13 2
    public function __construct(
14
        public ?array $gadgetIds = null,
15
        public ?array $colors = null,
16
        public ?string $action = null,
17
        public ?int $repeat = null
18
    ) {
19 2
    }
20
21 2
    public static function create(?string $action = null, ?array $gadgetIds = null, ?array $colors = null, ?int $repeat = null): self
22
    {
23 2
        return new self($gadgetIds, $colors, $action, $repeat);
24
    }
25
}
26