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