Completed
Pull Request — master (#33)
by Maximilian
06:26
created

Pattern::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 9
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
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