Passed
Push — master ( b464b5...fd08ce )
by Maximilian
45s queued 11s
created

LocationServices::fromAmazonRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace MaxBeckers\AmazonAlexa\Request;
4
5
/**
6
 * @author Brandon Olivares <[email protected]>
7
 */
8
class LocationServices
9
{
10
    const ACCESS_ENABLED  = 'ENABLED';
11
    const ACCESS_DISABLED = 'DISABLED';
12
13
    const STATUS_RUNNING = 'RUNNING';
14
    const STATUS_STOPPED = 'STOPPED';
15
16
    /**
17
     * @var string
18
     */
19
    public $access;
20
21
    /**
22
     * @var string
23
     */
24
    public $status;
25
26
    /**
27
     * @param array $amazonRequest
28
     *
29
     * @return LocationServices
30
     */
31
    public static function fromAmazonRequest(array $amazonRequest): self
32
    {
33
        $locationServices = new self();
34
35
        $locationServices->access   = $amazonRequest['access'];
36
        $locationServices->status   = $amazonRequest['status'];
37
38
        return $locationServices;
39
    }
40
}
41