| Conditions | 3 |
| Paths | 4 |
| Total Lines | 21 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | public function toArray(): array |
||
| 21 | { |
||
| 22 | $location = [ |
||
| 23 | 'latitude' => (string) $this->latitude, |
||
| 24 | 'longitude' => (string) $this->longitude, |
||
| 25 | ]; |
||
| 26 | |||
| 27 | if ($this->name !== null) { |
||
| 28 | $location['name'] = $this->name; |
||
| 29 | } |
||
| 30 | |||
| 31 | if ($this->address !== null) { |
||
| 32 | $location['address'] = $this->address; |
||
| 33 | } |
||
| 34 | |||
| 35 | $baseArray = [ |
||
| 36 | 'type' => 'location', |
||
| 37 | 'location' => $location, |
||
| 38 | ]; |
||
| 39 | |||
| 40 | return $this->buildParameterArray($baseArray); |
||
| 41 | } |
||
| 43 |