| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function transform(Geoip $geoip): array |
||
| 19 | { |
||
| 20 | $country = $geoip->country_code ? country($geoip->country_code) : null; |
||
| 21 | |||
| 22 | return $this->escape([ |
||
| 23 | 'client_ip' => (string) $geoip->client_ip, |
||
| 24 | 'latitude' => (string) $geoip->latitude, |
||
| 25 | 'longitude' => (string) $geoip->longitude, |
||
| 26 | 'country_code' => (string) optional($country)->getName(), |
||
| 27 | 'country_emoji' => (string) optional($country)->getEmoji(), |
||
| 28 | 'client_ips' => (string) $geoip->client_ips, |
||
| 29 | 'is_from_trusted_proxy' => (bool) $geoip->is_from_trusted_proxy, |
||
| 30 | 'division_code' => (string) $geoip->division_code, |
||
| 31 | 'postal_code' => (string) $geoip->postal_code, |
||
| 32 | 'timezone' => (string) $geoip->timezone, |
||
| 33 | 'city' => (string) $geoip->city, |
||
| 34 | 'count' => (int) $geoip->count, |
||
| 35 | ]); |
||
| 36 | } |
||
| 37 | } |
||
| 38 |