Conditions | 6 |
Paths | 8 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | 9 | public static function fromAmazonRequest(array $amazonRequest): self |
|
31 | { |
||
32 | 9 | $resolution = new self(); |
|
33 | |||
34 | 9 | $resolution->authority = isset($amazonRequest['authority']) ? $amazonRequest['authority'] : null; |
|
35 | 9 | $resolution->status = isset($amazonRequest['status']) ? IntentStatus::fromAmazonRequest($amazonRequest['status']) : null; |
|
36 | |||
37 | 9 | if (isset($amazonRequest['values'])) { |
|
38 | 9 | foreach ($amazonRequest['values'] as $value) { |
|
39 | 9 | if (isset($value['value'])) { |
|
40 | 9 | $resolution->values[] = IntentValue::fromAmazonRequest($value['value']); |
|
41 | } |
||
42 | } |
||
43 | } |
||
44 | |||
45 | 9 | return $resolution; |
|
46 | } |
||
72 |