Passed
Pull Request — master (#83)
by Maximilian
06:40
created

SkillDisabledBody   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
c 1
b 0
f 0
dl 0
loc 22
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromAmazonRequest() 0 7 2
1
<?php
2
3
namespace MaxBeckers\AmazonAlexa\Request\Request\AlexaSkillEvent;
4
5
/**
6
 * @author Maximilian Beckers <[email protected]>
7
 */
8
class SkillDisabledBody
9
{
10
    const PERSISTED     = 'PERSISTED';
11
    const NOT_PERSISTED = 'NOT_PERSISTED';
12
13
    /**
14
     * @var string|null
15
     */
16
    public $userInformationPersistenceStatus;
17
18
    /**
19
     * @param array $amazonRequest
20
     *
21
     * @return SkillDisabledBody
22
     */
23
    public static function fromAmazonRequest(array $amazonRequest): self
24
    {
25
        $body = new self();
26
27
        $body->userInformationPersistenceStatus = isset($amazonRequest['userInformationPersistenceStatus']) ? $amazonRequest['userInformationPersistenceStatus'] : null;
28
29
        return $body;
30
    }
31
}
32