Merge pull request #5235 from atif-shaikh/CRM-5039MinorFixes
[civicrm-core.git] / CRM / Utils / Address / BatchUpdate.php
index 3e6b455715b8ace8e1cb9f59a5be309f6a77169b..4e3f24f7bb8ea23c412fffb6e9481683b41bc1dc 100644 (file)
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  * A PHP cron script to format all the addresses in the database. Currently
@@ -122,7 +122,7 @@ class CRM_Utils_Address_BatchUpdate {
    * @return array
    * @throws Exception
    */
-  function processContacts(&$config, $processGeocode, $parseStreetAddress) {
+  public function processContacts(&$config, $processGeocode, $parseStreetAddress) {
     // build where clause.
     $clause = array('( c.id = a.contact_id )');
     $params = array();
@@ -164,10 +164,9 @@ class CRM_Utils_Address_BatchUpdate {
 
     $dao = CRM_Core_DAO::executeQuery($query, $params);
     if ($processGeocode) {
-      require_once (str_replace('_', DIRECTORY_SEPARATOR, $config->geocodeMethod) . '.php');
+      require_once str_replace('_', DIRECTORY_SEPARATOR, $config->geocodeMethod) . '.php';
     }
 
-
     $unparseableContactAddress = array();
     while ($dao->fetch()) {
       $totalAddresses++;
@@ -194,7 +193,7 @@ class CRM_Utils_Address_BatchUpdate {
           }
 
           $className = $config->geocodeMethod;
-          $className::format( $params, true );
+          $className::format($params, TRUE);
 
           // see if we got a geocode error, in this case we'll trigger a fatal
           // CRM-13760
@@ -257,14 +256,17 @@ class CRM_Utils_Address_BatchUpdate {
     }
 
     $this->returnMessages[] = ts("Addresses Evaluated: %1", array(
-      1 => $totalAddresses)) . "\n";
+      1 => $totalAddresses,
+      )) . "\n";
     if ($processGeocode) {
       $this->returnMessages[] = ts("Addresses Geocoded: %1", array(
-        1 => $totalGeocoded)) . "\n";
+          1 => $totalGeocoded,
+        )) . "\n";
     }
     if ($parseStreetAddress) {
       $this->returnMessages[] = ts("Street Addresses Parsed: %1", array(
-        1 => $totalAddressParsed)) . "\n";
+          1 => $totalAddressParsed,
+        )) . "\n";
       if ($unparseableContactAddress) {
         $this->returnMessages[] = "<br />\n" . ts("Following is the list of contacts whose address is not parsed:") . "<br />\n";
         foreach ($unparseableContactAddress as $contactLink) {
@@ -279,11 +281,11 @@ class CRM_Utils_Address_BatchUpdate {
   /**
    * @return array
    */
-  function returnResult() {
-    $result             = array();
+  public function returnResult() {
+    $result = array();
     $result['is_error'] = $this->returnError;
     $result['messages'] = implode("", $this->returnMessages);
     return $result;
   }
-}
 
+}