X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContact%2FBAO%2FProximityQuery.php;h=5bf8209940c2f36ef38d738af21ad39f1e1a75de;hb=bed983430218b8ec5be970ba52fa7300142565d3;hp=64a3e85e0a5a3132819583a1de357735a6c431eb;hpb=5552f12522cb2481ce8f8ccf028148084367237f;p=civicrm-core.git diff --git a/CRM/Contact/BAO/ProximityQuery.php b/CRM/Contact/BAO/ProximityQuery.php index 64a3e85e0a..5bf8209940 100644 --- a/CRM/Contact/BAO/ProximityQuery.php +++ b/CRM/Contact/BAO/ProximityQuery.php @@ -50,7 +50,7 @@ class CRM_Contact_BAO_ProximityQuery { * earth_eccentricity_sq = 2*$earth_flattening - pow($earth_flattening, 2); * This library is an implementation of UCB CS graduate student, Ka-Ping Yee (http://www.zesty.ca). * This version has been taken from Drupal's location module: http://drupal.org/project/location - **/ + */ static protected $_earthFlattening; static protected $_earthRadiusSemiMinor; @@ -206,8 +206,8 @@ class CRM_Contact_BAO_ProximityQuery { } /** - * @param float $longitude * @param float $latitude + * @param float $longitude * @param float $distance * @param string $tablePrefix * @@ -219,17 +219,8 @@ class CRM_Contact_BAO_ProximityQuery { $params = array(); $clause = array(); - list($minLongitude, $maxLongitude) = - self::earthLongitudeRange($longitude, - $latitude, - $distance - ); - list($minLatitude, $maxLatitude) = - self::earthLatitudeRange( - $longitude, - $latitude, - $distance - ); + list($minLongitude, $maxLongitude) = self::earthLongitudeRange($longitude, $latitude, $distance); + list($minLatitude, $maxLatitude) = self::earthLatitudeRange($longitude, $latitude, $distance); // DONT consider NAN values (which is returned by rad2deg php function) // for checking BETWEEN geo_code's criteria as it throws obvious 'NAN' field not found DB: Error @@ -266,6 +257,7 @@ ACOS( * @param array $values * * @throws Exception + * @return void */ public static function process(&$query, &$values) { list($name, $op, $distance, $grouping, $wildcard) = $values; @@ -297,7 +289,7 @@ ACOS( } if (empty($proximityAddress)) { - return; + return NULL; } if (isset($proximityAddress['state_province_id'])) { @@ -321,7 +313,6 @@ ACOS( $qill[] = $proximityAddress['country']; } - if ( isset($proximityAddress['distance_unit']) && $proximityAddress['distance_unit'] == 'miles' @@ -358,7 +349,7 @@ ACOS( $qill .= ': ' . ts('We could not geocode the destination address.'); $query->_qill[$grouping][] = $qill; $query->_where[$grouping][] = ' (0) '; - return; + return NULL; } $query->_qill[$grouping][] = $qill; @@ -368,11 +359,12 @@ ACOS( $distance ); - return; + return NULL; } /** * @param array $input + * retun void */ public static function fixInputParams(&$input) { foreach ($input as $param) { @@ -395,7 +387,7 @@ ACOS( } } } - return; + return NULL; } } }