Passed
Push — master ( a85f02...995ee0 )
by Maximilian
47s
created

Parameters::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

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