]> git.openstreetmap.org Git - nominatim.git/commitdiff
avoid passing temporary array by reference
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 9 Oct 2016 19:14:59 +0000 (21:14 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 9 Oct 2016 19:14:59 +0000 (21:14 +0200)
PHP7 complains: Only variables should be passed by reference.

lib/Geocode.php

index cf05df12d4497ac3202b2b12e1b8363a0aad7103..21f3686939567c15de494aef7f0271a573ac4cae 100644 (file)
@@ -1552,7 +1552,7 @@ class Geocode
                 // getAddressDetails() is defined in lib.php and uses the SQL function get_addressdata in functions.sql
                 $aResult['address'] = getAddressDetails($this->oDB, $sLanguagePrefArraySQL, $aResult['place_id'], $aResult['country_code'], $aResultPlaceIDs[$aResult['place_id']]);
                 if ($aResult['extra_place'] == 'city' && !isset($aResult['address']['city'])) {
-                    $aResult['address'] = array_merge(array('city' => array_shift(array_values($aResult['address']))), $aResult['address']);
+                    $aResult['address'] = array_merge(array('city' => array_values($aResult['address'])[0]), $aResult['address']);
                 }
             }