Conditions | 6 |
Paths | 32 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
45 | 1 | public static function fromAmazonRequest(array $amazonRequest): self |
|
46 | { |
||
47 | 1 | $geolocation = new self(); |
|
48 | |||
49 | 1 | $geolocation->locationServices = isset($amazonRequest['locationServices']) ? LocationServices::fromAmazonRequest($amazonRequest['locationServices']) : null; |
|
50 | 1 | $geolocation->timestamp = new \DateTime($amazonRequest['timestamp']); |
|
51 | 1 | $geolocation->coordinate = isset($amazonRequest['coordinate']) ? Coordinate::fromAmazonRequest($amazonRequest['coordinate']) : null; |
|
52 | 1 | $geolocation->altitude = isset($amazonRequest['altitude']) ? Altitude::fromAmazonRequest($amazonRequest['altitude']) : null; |
|
53 | 1 | $geolocation->heading = isset($amazonRequest['heading']) ? Heading::fromAmazonRequest($amazonRequest['heading']) : null; |
|
54 | 1 | $geolocation->speed = isset($amazonRequest['speed']) ? Speed::fromAmazonRequest($amazonRequest['speed']) : null; |
|
55 | |||
56 | 1 | return $geolocation; |
|
57 | } |
||
59 |