| Conditions | 5 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 5 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | 9 | public static function fromAmazonRequest(array $amazonRequest): self |
|
| 16 | { |
||
| 17 | 9 | $resolution = new self(); |
|
| 18 | |||
| 19 | 9 | $resolution->authority = $amazonRequest['authority'] ?? null; |
|
| 20 | 9 | $resolution->status = isset($amazonRequest['status']) ? IntentStatus::fromAmazonRequest($amazonRequest['status']) : null; |
|
| 21 | |||
| 22 | 9 | if (isset($amazonRequest['values'])) { |
|
| 23 | 9 | foreach ($amazonRequest['values'] as $value) { |
|
| 24 | 9 | if (isset($value['value'])) { |
|
| 25 | 9 | $resolution->values[] = IntentValue::fromAmazonRequest($value['value']); |
|
| 26 | } |
||
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 30 | 9 | return $resolution; |
|
| 31 | } |
||
| 54 |