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

LocationServices   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 11
dl 0
loc 31
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromAmazonRequest() 0 8 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