Completed
Pull Request — master (#32)
by Maximilian
05:43
created

SetLightDirective::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 3
1
<?php
2
3
namespace MaxBeckers\AmazonAlexa\Response\Directives\GadgetController;
4
5
use MaxBeckers\AmazonAlexa\Response\Directives\Directive;
6
7
/**
8
 * @author Maximilian Beckers <[email protected]>
9
 */
10
class SetLightDirective extends Directive
11
{
12
    const TYPE = 'GadgetController.SetLight';
13
14
    /**
15
     * @var int|null
16
     */
17
    public $version;
18
19
    /**
20
     * @var array
21
     */
22
    public $targetGadgets = [];
23
24
    /**
25
     * @var Parameters|null
26
     */
27
    public $parameters;
28
29
    /**
30
     * @param array           $targetGadgets
31
     * @param Parameters|null $parameters
32
     * @param int             $version
33
     *
34
     * @return SetLightDirective
35
     */
36
    public static function create(array $targetGadgets = [], Parameters $parameters = null, int $version = 1): self
37
    {
38
        $setLight = new self();
39
40
        $setLight->type          = self::TYPE;
41
        $setLight->targetGadgets = $targetGadgets;
42
        $setLight->parameters    = $parameters;
43
        $setLight->version       = $version;
44
45
        return $setLight;
46
    }
47
}
48