Passed
Pull Request — master (#33)
by Maximilian
03:06
created

Pattern   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 12
dl 0
loc 37
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 9 1
1
<?php
2
3
namespace MaxBeckers\AmazonAlexa\Response\Directives\GameEngine;
4
5
/**
6
 * @author Maximilian Beckers <[email protected]>
7
 */
8
class Pattern
9
{
10
    const ACTION_DOWN    = 'down';
11
    const ACTION_UP      = 'up';
12
    const ACTION_SILENCE = 'silence';
13
14
    /**
15
     * @var array
16
     */
17
    public $gadgetIds = [];
18
19
    /**
20
     * @var array
21
     */
22
    public $colors = [];
23
24
    /**
25
     * @var string|null
26
     */
27
    public $action;
28
29
    /**
30
     * @param string|null $action
31
     * @param array       $gadgetIds
32
     * @param array       $colors
33
     *
34
     * @return Pattern
35
     */
36
    public static function create(string $action = null, array $gadgetIds = [], array $colors = []): self
37
    {
38
        $pattern = new self();
39
40
        $pattern->action    = $action;
41
        $pattern->gadgetIds = $gadgetIds;
42
        $pattern->colors    = $colors;
43
44
        return $pattern;
45
    }
46
}
47