SetLightDirective   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 11
dl 0
loc 36
ccs 7
cts 7
cp 1
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 10 1
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 1
    public static function create(array $targetGadgets = [], Parameters $parameters = null, int $version = 1): self
37
    {
38 1
        $setLight = new self();
39
40 1
        $setLight->type          = self::TYPE;
41 1
        $setLight->targetGadgets = $targetGadgets;
42 1
        $setLight->parameters    = $parameters;
43 1
        $setLight->version       = $version;
44
45 1
        return $setLight;
46
    }
47
}
48