mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
replace PHP sizeof() with either count() or empty()
This commit is contained in:
@@ -62,7 +62,7 @@ $oPlaceLookup->setIncludeAddressDetails(true);
|
||||
|
||||
$aPlaceAddress = array_reverse($oPlaceLookup->getAddressDetails($iPlaceID));
|
||||
|
||||
if (!sizeof($aPlaceAddress)) userError('Unknown place id.');
|
||||
if (empty($aPlaceAddress)) userError('Unknown place id.');
|
||||
|
||||
$aBreadcrums = array();
|
||||
foreach ($aPlaceAddress as $i => $aPlace) {
|
||||
@@ -100,7 +100,7 @@ $sSQL .= ' where parent_place_id in ('.join(',', $aRelatedPlaceIDs).') and name
|
||||
$sSQL .= ' order by rank_address asc,rank_search asc,localname,class, type,housenumber';
|
||||
$aParentOfLines = chksql($oDB->getAll($sSQL));
|
||||
|
||||
if (sizeof($aParentOfLines)) {
|
||||
if (!empty($aParentOfLines)) {
|
||||
echo '<h2>Parent Of:</h2>';
|
||||
$aClassType = getClassTypesWithImportance();
|
||||
$aGroupedAddressLines = array();
|
||||
@@ -136,7 +136,7 @@ if (sizeof($aParentOfLines)) {
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
if (sizeof($aParentOfLines) >= 500) {
|
||||
if (count($aParentOfLines) >= 500) {
|
||||
echo '<p>There are more child objects which are not shown.</p>';
|
||||
}
|
||||
echo '</div>';
|
||||
|
||||
@@ -18,7 +18,7 @@ $oDB =& getDB();
|
||||
$iTotalBroken = (int) chksql($oDB->getOne('select count(*) from import_polygon_error'));
|
||||
|
||||
$aPolygons = array();
|
||||
while ($iTotalBroken && !sizeof($aPolygons)) {
|
||||
while ($iTotalBroken && empty($aPolygons)) {
|
||||
$sSQL = 'select osm_type as "type",osm_id as "id",class as "key",type as "value",name->\'name\' as "name",';
|
||||
$sSQL .= 'country_code as "country",errormessage as "error message",updated';
|
||||
$sSQL .= ' from import_polygon_error';
|
||||
@@ -32,7 +32,7 @@ while ($iTotalBroken && !sizeof($aPolygons)) {
|
||||
if ($bReduced) $aWhere[] = "errormessage like 'Area reduced%'";
|
||||
if ($sClass) $sWhere[] = "class = '".pg_escape_string($sClass)."'";
|
||||
|
||||
if (sizeof($aWhere)) {
|
||||
if (!empty($aWhere)) {
|
||||
$sSQL .= ' where '.join(' and ', $aWhere);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ if ($sOsmType && $iOsmId > 0) {
|
||||
|
||||
if ($oLookup) {
|
||||
$aPlaces = $oPlaceLookup->lookup(array($oLookup->iId => $oLookup));
|
||||
if (sizeof($aPlaces)) {
|
||||
if (!empty($aPlaces)) {
|
||||
$aPlace = reset($aPlaces);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ $aSearchResults = $oGeocode->lookup();
|
||||
if ($sOutputFormat=='html') {
|
||||
$sDataDate = chksql($oDB->getOne("select TO_CHAR(lastimportdate,'YYYY/MM/DD HH24:MI')||' GMT' from import_status limit 1"));
|
||||
}
|
||||
logEnd($oDB, $hLog, sizeof($aSearchResults));
|
||||
logEnd($oDB, $hLog, count($aSearchResults));
|
||||
|
||||
$sQuery = $oGeocode->getQueryString();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user