]> git.openstreetmap.org Git - nominatim.git/commitdiff
phpcs fixes. Mostly spacing and single quotes
authorMarc Tobias Metten <mtmail@gmx.net>
Fri, 23 Feb 2018 00:16:01 +0000 (01:16 +0100)
committerMarc Tobias Metten <mtmail@gmx.net>
Fri, 23 Feb 2018 00:16:01 +0000 (01:16 +0100)
lib/template/address-json.php
lib/template/address-jsonv2.php
lib/template/address-xml.php
lib/template/search-batch-json.php
lib/template/search-json.php
lib/template/search-jsonv2.php
lib/template/search-xml.php
test/bdd/steps/cgi-with-coverage.php
test/php/Nominatim/PhraseTest.php
test/php/Nominatim/SearchContextTest.php

index 93abb6017308b485c7634bc9a89fe1d670a07f03..cea8774549cef955eb4c91a783cdccbb835f692c 100644 (file)
@@ -2,20 +2,15 @@
 
 $aFilteredPlaces = array();
 
-if (!sizeof($aPlace))
-{
+if (!sizeof($aPlace)) {
     if (isset($sError))
         $aFilteredPlaces['error'] = $sError;
-    else
-        $aFilteredPlaces['error'] = 'Unable to geocode';
-}
-else
-{
+    else $aFilteredPlaces['error'] = 'Unable to geocode';
+} else {
     if (isset($aPlace['place_id'])) $aFilteredPlaces['place_id'] = $aPlace['place_id'];
-    $aFilteredPlaces['licence'] = "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright";
+    $aFilteredPlaces['licence'] = 'Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright';
     $sOSMType = formatOSMType($aPlace['osm_type']);
-    if ($sOSMType)
-    {
+    if ($sOSMType) {
         $aFilteredPlaces['osm_type'] = $sOSMType;
         $aFilteredPlaces['osm_id'] = $aPlace['osm_id'];
     }
@@ -26,31 +21,25 @@ else
     if (isset($aPlace['sExtraTags'])) $aFilteredPlaces['extratags'] = $aPlace['sExtraTags'];
     if (isset($aPlace['sNameDetails'])) $aFilteredPlaces['namedetails'] = $aPlace['sNameDetails'];
 
-    if (isset($aPlace['aBoundingBox']))
-    {
+    if (isset($aPlace['aBoundingBox'])) {
         $aFilteredPlaces['boundingbox'] = $aPlace['aBoundingBox'];
     }
 
-    if (isset($aPlace['asgeojson']))
-    {
+    if (isset($aPlace['asgeojson'])) {
         $aFilteredPlaces['geojson'] = json_decode($aPlace['asgeojson']);
     }
 
-    if (isset($aPlace['assvg']))
-    {
+    if (isset($aPlace['assvg'])) {
         $aFilteredPlaces['svg'] = $aPlace['assvg'];
     }
 
-    if (isset($aPlace['astext']))
-    {
+    if (isset($aPlace['astext'])) {
         $aFilteredPlaces['geotext'] = $aPlace['astext'];
     }
 
-    if (isset($aPlace['askml']))
-    {
+    if (isset($aPlace['askml'])) {
         $aFilteredPlaces['geokml'] = $aPlace['askml'];
     }
 }
 
 javascript_renderData($aFilteredPlaces);
-
index 229303be6e7325bb19de208299b7323300c3c977..399c978f6701d823539af592a678526f33091e9c 100644 (file)
@@ -2,20 +2,15 @@
 
 $aFilteredPlaces = array();
 
-if (!sizeof($aPlace))
-{
+if (!sizeof($aPlace)) {
     if (isset($sError))
         $aFilteredPlaces['error'] = $sError;
-    else
-        $aFilteredPlaces['error'] = 'Unable to geocode';
-}
-else
-{
+    else $aFilteredPlaces['error'] = 'Unable to geocode';
+} else {
     if ($aPlace['place_id']) $aFilteredPlaces['place_id'] = $aPlace['place_id'];
-    $aFilteredPlaces['licence'] = "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright";
+    $aFilteredPlaces['licence'] = 'Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright';
     $sOSMType = formatOSMType($aPlace['osm_type']);
-    if ($sOSMType)
-    {
+    if ($sOSMType) {
         $aFilteredPlaces['osm_type'] = $sOSMType;
         $aFilteredPlaces['osm_id'] = $aPlace['osm_id'];
     }
@@ -38,31 +33,25 @@ else
     if (isset($aPlace['sExtraTags'])) $aFilteredPlaces['extratags'] = $aPlace['sExtraTags'];
     if (isset($aPlace['sNameDetails'])) $aFilteredPlaces['namedetails'] = $aPlace['sNameDetails'];
 
-    if (isset($aPlace['aBoundingBox']))
-    {
+    if (isset($aPlace['aBoundingBox'])) {
         $aFilteredPlaces['boundingbox'] = $aPlace['aBoundingBox'];
     }
 
-    if (isset($aPlace['asgeojson']))
-    {
+    if (isset($aPlace['asgeojson'])) {
         $aFilteredPlaces['geojson'] = json_decode($aPlace['asgeojson']);
     }
 
-    if (isset($aPlace['assvg']))
-    {
+    if (isset($aPlace['assvg'])) {
         $aFilteredPlaces['svg'] = $aPlace['assvg'];
     }
 
-    if (isset($aPlace['astext']))
-    {
+    if (isset($aPlace['astext'])) {
         $aFilteredPlaces['geotext'] = $aPlace['astext'];
     }
 
-    if (isset($aPlace['askml']))
-    {
+    if (isset($aPlace['askml'])) {
         $aFilteredPlaces['geokml'] = $aPlace['askml'];
     }
-
 }
 
 javascript_renderData($aFilteredPlaces);
index d3db2eddaeb04ac376e0535b1499587fc94c7470..6183b284dbc3e8df471ffc719e438e1de83dd17a 100644 (file)
 <?php
-header("content-type: text/xml; charset=UTF-8");
+header('content-type: text/xml; charset=UTF-8');
 
-echo "<";
-echo "?xml version=\"1.0\" encoding=\"UTF-8\" ?";
+echo '<';
+echo '?xml version="1.0" encoding="UTF-8" ?';
 echo ">\n";
 
-echo "<reversegeocode";
+echo '<reversegeocode';
 echo " timestamp='".date(DATE_RFC822)."'";
 echo " attribution='Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright'";
 echo " querystring='".htmlspecialchars($_SERVER['QUERY_STRING'], ENT_QUOTES)."'";
 echo ">\n";
 
-if (!sizeof($aPlace))
-{
+if (!sizeof($aPlace)) {
     if (isset($sError))
         echo "<error>$sError</error>";
-    else
-        echo "<error>Unable to geocode</error>";
-}
-else
-{
-    echo "<result";
+    else echo '<error>Unable to geocode</error>';
+} else {
+    echo '<result';
     if ($aPlace['place_id']) echo ' place_id="'.$aPlace['place_id'].'"';
     $sOSMType = formatOSMType($aPlace['osm_type']);
     if ($sOSMType) echo ' osm_type="'.$sOSMType.'"'.' osm_id="'.$aPlace['osm_id'].'"';
     if ($aPlace['ref']) echo ' ref="'.htmlspecialchars($aPlace['ref']).'"';
     if (isset($aPlace['lat'])) echo ' lat="'.htmlspecialchars($aPlace['lat']).'"';
     if (isset($aPlace['lon'])) echo ' lon="'.htmlspecialchars($aPlace['lon']).'"';
-    if (isset($aPlace['aBoundingBox']))
-    {
+    if (isset($aPlace['aBoundingBox'])) {
         echo ' boundingbox="';
         echo join(',', $aPlace['aBoundingBox']);
         echo '"';
     }
 
-    if (isset($aPlace['asgeojson']))
-    {
+    if (isset($aPlace['asgeojson'])) {
         echo ' geojson=\'';
         echo $aPlace['asgeojson'];
         echo '\'';
     }
 
-    if (isset($aPlace['assvg']))
-    {
+    if (isset($aPlace['assvg'])) {
         echo ' geosvg=\'';
         echo $aPlace['assvg'];
         echo '\'';
     }
 
-    if (isset($aPlace['astext']))
-    {
+    if (isset($aPlace['astext'])) {
         echo ' geotext=\'';
         echo $aPlace['astext'];
         echo '\'';
     }
-    echo ">".htmlspecialchars($aPlace['langaddress'])."</result>";
+    echo '>'.htmlspecialchars($aPlace['langaddress']).'</result>';
 
-    if (isset($aPlace['aAddress']))
-    {
-        echo "<addressparts>";
-        foreach($aPlace['aAddress'] as $sKey => $sValue)
-        {
-            $sKey = str_replace(' ','_',$sKey);
+    if (isset($aPlace['aAddress'])) {
+        echo '<addressparts>';
+        foreach ($aPlace['aAddress'] as $sKey => $sValue) {
+            $sKey = str_replace(' ', '_', $sKey);
             echo "<$sKey>";
             echo htmlspecialchars($sValue);
             echo "</$sKey>";
         }
-        echo "</addressparts>";
+        echo '</addressparts>';
     }
 
-    if (isset($aPlace['sExtraTags']))
-    {
-        echo "<extratags>";
-        foreach ($aPlace['sExtraTags'] as $sKey => $sValue)
-        {
+    if (isset($aPlace['sExtraTags'])) {
+        echo '<extratags>';
+        foreach ($aPlace['sExtraTags'] as $sKey => $sValue) {
             echo '<tag key="'.htmlspecialchars($sKey).'" value="'.htmlspecialchars($sValue).'"/>';
         }
-        echo "</extratags>";
+        echo '</extratags>';
     }
 
-    if (isset($aPlace['sNameDetails']))
-    {
-        echo "<namedetails>";
-        foreach ($aPlace['sNameDetails'] as $sKey => $sValue)
-        {
+    if (isset($aPlace['sNameDetails'])) {
+        echo '<namedetails>';
+        foreach ($aPlace['sNameDetails'] as $sKey => $sValue) {
             echo '<name desc="'.htmlspecialchars($sKey).'">';
             echo htmlspecialchars($sValue);
-            echo "</name>";
+            echo '</name>';
         }
-        echo "</namedetails>";
+        echo '</namedetails>';
     }
 
-    if (isset($aPlace['askml']))
-    {
+    if (isset($aPlace['askml'])) {
         echo "\n<geokml>";
         echo $aPlace['askml'];
-        echo "</geokml>";
+        echo '</geokml>';
     }
-
 }
 
-echo "</reversegeocode>";
+echo '</reversegeocode>';
index a3ced45bc35bb46ec3fab5be00f04229a952a507..09ea48b63bdbc2a964ac4134de5fcd0d43084dfb 100644 (file)
@@ -1,42 +1,37 @@
 <?php
 
 $aOutput = array();
-$aOutput['licence'] = "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright";
+$aOutput['licence'] = 'Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright';
 $aOutput['batch'] = array();
 
-foreach($aBatchResults as $aSearchResults)
-{
+foreach ($aBatchResults as $aSearchResults) {
     if (!$aSearchResults) $aSearchResults = array();
     $aFilteredPlaces = array();
-    foreach($aSearchResults as $iResNum => $aPointDetails)
-    {
+    foreach ($aSearchResults as $iResNum => $aPointDetails) {
         $aPlace = array(
-                    'place_id'=>$aPointDetails['place_id'],
-                );
+                   'place_id'=>$aPointDetails['place_id'],
+                  );
 
         $sOSMType = formatOSMType($aPointDetails['osm_type']);
-        if ($sOSMType)
-        {
+        if ($sOSMType) {
             $aPlace['osm_type'] = $sOSMType;
             $aPlace['osm_id'] = $aPointDetails['osm_id'];
         }
 
-        if (isset($aPointDetails['aBoundingBox']))
-        {
+        if (isset($aPointDetails['aBoundingBox'])) {
             $aPlace['boundingbox'] = array(
-                $aPointDetails['aBoundingBox'][0],
-                $aPointDetails['aBoundingBox'][1],
-                $aPointDetails['aBoundingBox'][2],
-                $aPointDetails['aBoundingBox'][3]);
+                                      $aPointDetails['aBoundingBox'][0],
+                                      $aPointDetails['aBoundingBox'][1],
+                                      $aPointDetails['aBoundingBox'][2],
+                $aPointDetails['aBoundingBox'][3]
+                                     );
 
-            if (isset($aPointDetails['aPolyPoints']) && $bShowPolygons)
-            {
+            if (isset($aPointDetails['aPolyPoints']) && $bShowPolygons) {
                 $aPlace['polygonpoints'] = $aPointDetails['aPolyPoints'];
             }
         }
 
-        if (isset($aPointDetails['zoom']))
-        {
+        if (isset($aPointDetails['zoom'])) {
             $aPlace['zoom'] = $aPointDetails['zoom'];
         }
 
@@ -50,33 +45,27 @@ foreach($aBatchResults as $aSearchResults)
 
         $aPlace['importance'] = $aPointDetails['importance'];
 
-        if (isset($aPointDetails['icon']))
-        {
+        if (isset($aPointDetails['icon'])) {
             $aPlace['icon'] = $aPointDetails['icon'];
         }
 
-        if (isset($aPointDetails['address']) && sizeof($aPointDetails['address'])>0)
-        {
+        if (isset($aPointDetails['address']) && sizeof($aPointDetails['address'])>0) {
             $aPlace['address'] = $aPointDetails['address'];
         }
 
-        if (isset($aPointDetails['asgeojson']))
-        {
+        if (isset($aPointDetails['asgeojson'])) {
             $aPlace['geojson'] = json_decode($aPointDetails['asgeojson']);
         }
 
-        if (isset($aPointDetails['assvg']))
-        {
+        if (isset($aPointDetails['assvg'])) {
             $aPlace['svg'] = $aPointDetails['assvg'];
         }
 
-        if (isset($aPointDetails['astext']))
-        {
+        if (isset($aPointDetails['astext'])) {
             $aPlace['geotext'] = $aPointDetails['astext'];
         }
 
-        if (isset($aPointDetails['askml']))
-        {
+        if (isset($aPointDetails['askml'])) {
             $aPlace['geokml'] = $aPointDetails['askml'];
         }
 
index 846d654c5e3b5fb5da8b317ccb5cf9319d03a268..b997f6d97b1fcb01f7ed12b74f8f3468b5d8377a 100644 (file)
@@ -1,33 +1,28 @@
 <?php
-header("content-type: application/json; charset=UTF-8");
+header('content-type: application/json; charset=UTF-8');
 
 $aFilteredPlaces = array();
-foreach($aSearchResults as $iResNum => $aPointDetails)
-{
+foreach ($aSearchResults as $iResNum => $aPointDetails) {
     $aPlace = array(
-            'place_id'=>$aPointDetails['place_id'],
-            'licence'=>"Data © OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright",
-        );
+               'place_id'=>$aPointDetails['place_id'],
+               'licence'=>'Data © OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright',
+              );
     
     $sOSMType = formatOSMType($aPointDetails['osm_type']);
-    if ($sOSMType)
-    {
+    if ($sOSMType) {
         $aPlace['osm_type'] = $sOSMType;
         $aPlace['osm_id'] = $aPointDetails['osm_id'];
     }
 
-    if (isset($aPointDetails['aBoundingBox']))
-    {
+    if (isset($aPointDetails['aBoundingBox'])) {
         $aPlace['boundingbox'] = $aPointDetails['aBoundingBox'];
 
-        if (isset($aPointDetails['aPolyPoints']))
-        {
+        if (isset($aPointDetails['aPolyPoints'])) {
             $aPlace['polygonpoints'] = $aPointDetails['aPolyPoints'];
         }
     }
 
-    if (isset($aPointDetails['zoom']))
-    {
+    if (isset($aPointDetails['zoom'])) {
         $aPlace['zoom'] = $aPointDetails['zoom'];
     }
 
@@ -40,33 +35,27 @@ foreach($aSearchResults as $iResNum => $aPointDetails)
 
     $aPlace['importance'] = $aPointDetails['importance'];
 
-    if (isset($aPointDetails['icon']) && $aPointDetails['icon'])
-    {
+    if (isset($aPointDetails['icon']) && $aPointDetails['icon']) {
         $aPlace['icon'] = $aPointDetails['icon'];
     }
 
-    if (isset($aPointDetails['address']))
-    {
+    if (isset($aPointDetails['address'])) {
         $aPlace['address'] = $aPointDetails['address'];
     }
 
-    if (isset($aPointDetails['asgeojson']))
-    {
+    if (isset($aPointDetails['asgeojson'])) {
         $aPlace['geojson'] = json_decode($aPointDetails['asgeojson']);
     }
 
-    if (isset($aPointDetails['assvg']))
-    {
+    if (isset($aPointDetails['assvg'])) {
         $aPlace['svg'] = $aPointDetails['assvg'];
     }
 
-    if (isset($aPointDetails['astext']))
-    {
+    if (isset($aPointDetails['astext'])) {
         $aPlace['geotext'] = $aPointDetails['astext'];
     }
 
-    if (isset($aPointDetails['askml']))
-    {
+    if (isset($aPointDetails['askml'])) {
         $aPlace['geokml'] = $aPointDetails['askml'];
     }
 
index 5d2802afe60b36f8d5351410832adaf5a9feb4bf..7610330419435279101c01b432d3f468fb97f525 100644 (file)
@@ -1,32 +1,27 @@
 <?php
 
 $aFilteredPlaces = array();
-foreach($aSearchResults as $iResNum => $aPointDetails)
-{
+foreach ($aSearchResults as $iResNum => $aPointDetails) {
     $aPlace = array(
-            'place_id'=>$aPointDetails['place_id'],
-            'licence'=>"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
-        );
+               'place_id'=>$aPointDetails['place_id'],
+               'licence'=>'Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright',
+              );
 
     $sOSMType = formatOSMType($aPointDetails['osm_type']);
-    if ($sOSMType)
-    {
+    if ($sOSMType) {
         $aPlace['osm_type'] = $sOSMType;
         $aPlace['osm_id'] = $aPointDetails['osm_id'];
     }
 
-    if (isset($aPointDetails['aBoundingBox']))
-    {
+    if (isset($aPointDetails['aBoundingBox'])) {
         $aPlace['boundingbox'] = $aPointDetails['aBoundingBox'];
 
-        if (isset($aPointDetails['aPolyPoints']))
-        {
+        if (isset($aPointDetails['aPolyPoints'])) {
             $aPlace['polygonpoints'] = $aPointDetails['aPolyPoints'];
         }
     }
 
-    if (isset($aPointDetails['zoom']))
-    {
+    if (isset($aPointDetails['zoom'])) {
         $aPlace['zoom'] = $aPointDetails['zoom'];
     }
 
@@ -40,33 +35,27 @@ foreach($aSearchResults as $iResNum => $aPointDetails)
 
     $aPlace['importance'] = $aPointDetails['importance'];
 
-    if (isset($aPointDetails['icon']))
-    {
+    if (isset($aPointDetails['icon'])) {
         $aPlace['icon'] = $aPointDetails['icon'];
     }
 
-    if (isset($aPointDetails['address']) && sizeof($aPointDetails['address'])>0)
-    {
+    if (isset($aPointDetails['address']) && sizeof($aPointDetails['address'])>0) {
         $aPlace['address'] = $aPointDetails['address'];
     }
 
-    if (isset($aPointDetails['asgeojson']))
-    {
+    if (isset($aPointDetails['asgeojson'])) {
         $aPlace['geojson'] = json_decode($aPointDetails['asgeojson']);
     }
 
-    if (isset($aPointDetails['assvg']))
-    {
+    if (isset($aPointDetails['assvg'])) {
         $aPlace['svg'] = $aPointDetails['assvg'];
     }
 
-    if (isset($aPointDetails['astext']))
-    {
+    if (isset($aPointDetails['astext'])) {
         $aPlace['geotext'] = $aPointDetails['astext'];
     }
 
-    if (isset($aPointDetails['askml']))
-    {
+    if (isset($aPointDetails['askml'])) {
         $aPlace['geokml'] = $aPointDetails['askml'];
     }
 
index 80414fce6829be2f18534e06431aabbb2b9f8db3..94bb7ec96a44cdbfae7a150e6044883650a4ead2 100644 (file)
@@ -1,72 +1,63 @@
 <?php
-header("content-type: text/xml; charset=UTF-8");
+header('content-type: text/xml; charset=UTF-8');
 
-echo "<";
-echo "?xml version=\"1.0\" encoding=\"UTF-8\" ?";
+echo '<';
+echo '?xml version="1.0" encoding="UTF-8" ?';
 echo ">\n";
 
-echo "<";
+echo '<';
 echo (isset($sXmlRootTag)?$sXmlRootTag:'searchresults');
 echo " timestamp='".date(DATE_RFC822)."'";
 echo " attribution='Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright'";
 echo " querystring='".htmlspecialchars($sQuery, ENT_QUOTES)."'";
 if (isset($aMoreParams['viewbox'])) echo " viewbox='".htmlspecialchars($aMoreParams['viewbox'], ENT_QUOTES)."'";
 echo " polygon='".(isset($aMoreParams['polygon'])?'true':'false')."'";
-if (isset($aMoreParams['exclude_place_ids']))
-{
+if (isset($aMoreParams['exclude_place_ids'])) {
     echo " exclude_place_ids='".htmlspecialchars($aMoreParams['exclude_place_ids'])."'";
 }
 echo " more_url='".htmlspecialchars($sMoreURL)."'";
 echo ">\n";
 
-foreach($aSearchResults as $iResNum => $aResult)
-{
+foreach ($aSearchResults as $iResNum => $aResult) {
     echo "<place place_id='".$aResult['place_id']."'";
     $sOSMType = formatOSMType($aResult['osm_type']);
-    if ($sOSMType)
-    {
+    if ($sOSMType) {
         echo " osm_type='$sOSMType'";
         echo " osm_id='".$aResult['osm_id']."'";
     }
     echo " place_rank='".$aResult['rank_search']."'";
 
-    if (isset($aResult['aBoundingBox']))
-    {
+    if (isset($aResult['aBoundingBox'])) {
         echo ' boundingbox="';
-        echo join(',',$aResult['aBoundingBox']);
+        echo join(',', $aResult['aBoundingBox']);
         echo '"';
 
-        if (isset($aResult['aPolyPoints']))
-        {
+        if (isset($aResult['aPolyPoints'])) {
             echo ' polygonpoints=\'';
             echo json_encode($aResult['aPolyPoints']);
             echo '\'';
         }
     }
 
-    if (isset($aResult['asgeojson']))
-    {
+    if (isset($aResult['asgeojson'])) {
         echo ' geojson=\'';
         echo $aResult['asgeojson'];
         echo '\'';
     }
 
-    if (isset($aResult['assvg']))
-    {
+    if (isset($aResult['assvg'])) {
         echo ' geosvg=\'';
         echo $aResult['assvg'];
         echo '\'';
     }
 
-    if (isset($aResult['astext']))
-    {
+    if (isset($aResult['astext'])) {
         echo ' geotext=\'';
         echo $aResult['astext'];
         echo '\'';
     }
 
-    if (isset($aResult['zoom']))
-    {
+    if (isset($aResult['zoom'])) {
         echo " zoom='".$aResult['zoom']."'";
     }
 
@@ -77,82 +68,67 @@ foreach($aSearchResults as $iResNum => $aResult)
     echo " class='".htmlspecialchars($aResult['class'])."'";
     echo " type='".htmlspecialchars($aResult['type'], ENT_QUOTES)."'";
     echo " importance='".htmlspecialchars($aResult['importance'])."'";
-    if (isset($aResult['icon']) && $aResult['icon'])
-    {
+    if (isset($aResult['icon']) && $aResult['icon']) {
         echo " icon='".htmlspecialchars($aResult['icon'], ENT_QUOTES)."'";
     }
 
     $bHasDelim = false;
 
-    if (isset($aResult['askml']))
-    {
-        if (!$bHasDelim)
-        {
+    if (isset($aResult['askml'])) {
+        if (!$bHasDelim) {
             $bHasDelim = true;
-            echo ">";
+            echo '>';
         }
         echo "\n<geokml>";
         echo $aResult['askml'];
-        echo "</geokml>";
+        echo '</geokml>';
     }
 
-    if (isset($aResult['sExtraTags']))
-    {
-        if (!$bHasDelim)
-        {
+    if (isset($aResult['sExtraTags'])) {
+        if (!$bHasDelim) {
             $bHasDelim = true;
-            echo ">";
+            echo '>';
         }
         echo "\n<extratags>";
-        foreach ($aResult['sExtraTags'] as $sKey => $sValue)
-        {
+        foreach ($aResult['sExtraTags'] as $sKey => $sValue) {
             echo '<tag key="'.htmlspecialchars($sKey).'" value="'.htmlspecialchars($sValue).'"/>';
         }
-        echo "</extratags>";
+        echo '</extratags>';
     }
 
-    if (isset($aResult['sNameDetails']))
-    {
-        if (!$bHasDelim)
-        {
+    if (isset($aResult['sNameDetails'])) {
+        if (!$bHasDelim) {
             $bHasDelim = true;
-            echo ">";
+            echo '>';
         }
         echo "\n<namedetails>";
-        foreach ($aResult['sNameDetails'] as $sKey => $sValue)
-        {
+        foreach ($aResult['sNameDetails'] as $sKey => $sValue) {
             echo '<name desc="'.htmlspecialchars($sKey).'">';
             echo htmlspecialchars($sValue);
-            echo "</name>";
+            echo '</name>';
         }
-        echo "</namedetails>";
+        echo '</namedetails>';
     }
 
-    if (isset($aResult['address']))
-    {
-        if (!$bHasDelim)
-        {
+    if (isset($aResult['address'])) {
+        if (!$bHasDelim) {
             $bHasDelim = true;
-            echo ">";
+            echo '>';
         }
         echo "\n";
-        foreach($aResult['address'] as $sKey => $sValue)
-        {
-            $sKey = str_replace(' ','_',$sKey);
+        foreach ($aResult['address'] as $sKey => $sValue) {
+            $sKey = str_replace(' ', '_', $sKey);
             echo "<$sKey>";
             echo htmlspecialchars($sValue);
             echo "</$sKey>";
         }
     }
 
-    if ($bHasDelim)
-    {
-        echo "</place>";
-    }
-    else
-    {
-        echo "/>";
+    if ($bHasDelim) {
+        echo '</place>';
+    } else {
+        echo '/>';
     }
 }
 
-echo "</" . (isset($sXmlRootTag)?$sXmlRootTag:'searchresults') . ">";
+echo '</' . (isset($sXmlRootTag)?$sXmlRootTag:'searchresults') . '>';
index 165a1b0cd9b312870b4bff750287e865f9ee9e51..47d3cc9ac6760c248cda6a0f56a33f726b302a90 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 require_once 'SebastianBergmann/CodeCoverage/autoload.php';
 
+
 function coverage_shutdown($oCoverage)
 {
     $oCoverage->stop();
@@ -16,5 +17,3 @@ $coverage->start($_SERVER['COV_TEST_NAME']);
 register_shutdown_function('coverage_shutdown', $coverage);
 
 include $_SERVER['COV_SCRIPT_FILENAME'];
-
-
index db8d8b50808ad8325dbcc769908d5fcbe0ee7d7b..b5e6c1bf6e666b0f3a6c631648f3bc24865566e6 100644 (file)
@@ -6,6 +6,8 @@ require_once '../../lib/Phrase.php';
 
 class PhraseTest extends \PHPUnit_Framework_TestCase
 {
+
+
     private function serializeSets($aSets)
     {
         $aParts = array();
index a40d0716aa25a9f635b6b1919f4a2342a88b4ab3..2a74dc41c5b6a21cb14bab50257b95e5e19c309f 100644 (file)
@@ -10,6 +10,7 @@ class SearchContextTest extends \PHPUnit_Framework_TestCase
 {
     private $oCtx;
 
+
     protected function setUp()
     {
         $this->oCtx = new SearchContext();