From: Tim Otten Date: Tue, 6 Jan 2015 21:35:24 +0000 (-0800) Subject: INFRA-132 - bin/ - phpcbf X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a9e80afcf3faf29b2ed7d5f2ce4c981622524cae;p=civicrm-core.git INFRA-132 - bin/ - phpcbf --- diff --git a/bin/ContributionProcessor.php b/bin/ContributionProcessor.php index 3cb3ae3a30..7f516197fc 100644 --- a/bin/ContributionProcessor.php +++ b/bin/ContributionProcessor.php @@ -283,9 +283,10 @@ class CiviContributeProcessor { } foreach ($response[1][$response[0]]['notifications']['charge-amount-notification'] - as $amtData + as $amtData ) { - $searchParams = array('order-numbers' => array($amtData['google-order-number']['VALUE']), + $searchParams = array( + 'order-numbers' => array($amtData['google-order-number']['VALUE']), 'notification-types' => array('risk-information', 'new-order', 'charge-amount'), ); $response = CRM_Core_Payment_Google::invokeAPI($paymentProcessor, @@ -434,4 +435,3 @@ else { $lock->release(); echo "Done processing

"; - diff --git a/bin/cleanup42.php b/bin/cleanup42.php index b7b8a6a44f..1c5f86792c 100644 --- a/bin/cleanup42.php +++ b/bin/cleanup42.php @@ -28,7 +28,7 @@ /** * A PHP script which deletes extraneous civicrm_membership_payment rows * in order to correct the condition where a contribution row is linked to > 1 membership. - */ + */ function initialize() { session_start(); diff --git a/bin/cli.class.php b/bin/cli.class.php index 8942abbaf6..924e5a0076 100644 --- a/bin/cli.class.php +++ b/bin/cli.class.php @@ -175,7 +175,7 @@ class civicrm_cli { $this->_joblog = TRUE; } else { - while(list($short, $long) = each ($this->_additional_arguments)) { + while(list($short, $long) = each($this->_additional_arguments)) { if ($arg == '-' . $short || $arg == '--' . $long) { $property = '_' . $long; $this->$property = $value; @@ -211,7 +211,7 @@ class civicrm_cli { $civicrm_root = dirname(__DIR__); chdir($civicrm_root); - require_once ('civicrm.config.php'); + require_once 'civicrm.config.php'; // autoload if ( !class_exists('CRM_Core_ClassLoader') ) { require_once $civicrm_root . '/CRM/Core/ClassLoader.php'; @@ -223,7 +223,7 @@ class civicrm_cli { // HTTP_HOST will be 'localhost' unless overwritten with the -s argument. // Now we have a Config object, we can set it from the Base URL. if ($_SERVER['HTTP_HOST'] == 'localhost') { - $_SERVER['HTTP_HOST'] = preg_replace( + $_SERVER['HTTP_HOST'] = preg_replace( '!^https?://([^/]+)/$!i', '$1', $this->_config->userFrameworkBaseURL); @@ -332,18 +332,18 @@ class civicrm_cli_csv_exporter extends civicrm_cli { $this->row = 1; $result = civicrm_api($this->_entity, 'Get', $this->_params); - $first = true; + $first = TRUE; foreach ($result['values'] as $row) { if($first) { $columns = array_keys($row); fputcsv($out, $columns, $this->separator, '"'); - $first = false; + $first = FALSE; } //handle values returned as arrays (i.e. custom fields that allow multiple selections) by inserting a control character foreach ($row as &$field) { if(is_array($field)) { //convert to string - $field = implode($field,CRM_Core_DAO::VALUE_SEPARATOR) . CRM_Core_DAO::VALUE_SEPARATOR; + $field = implode($field, CRM_Core_DAO::VALUE_SEPARATOR) . CRM_Core_DAO::VALUE_SEPARATOR; } } fputcsv($out, $row, $this->separator, '"'); @@ -368,7 +368,7 @@ class civicrm_cli_csv_file extends civicrm_cli { * */ function __construct() { - $this->_required_arguments = array('entity','file'); + $this->_required_arguments = array('entity', 'file'); $this->_additional_arguments = array('f' => 'file'); parent::initialize(); } @@ -397,7 +397,8 @@ class civicrm_cli_csv_file extends civicrm_cli { $this->header = $header; while (($data = fgetcsv($handle, 0, $this->separator)) !== FALSE) { // skip blank lines - if(count($data) == 1 && is_null($data[0])) continue; + if(count($data) == 1 && is_null($data[0])) { continue; + } $this->row++; $params = $this->convertLine($data); $this->processLine($params); @@ -417,7 +418,7 @@ class civicrm_cli_csv_file extends civicrm_cli { foreach ($this->header as $i => $field) { //split any multiselect data, denoted with CRM_Core_DAO::VALUE_SEPARATOR if (strpos($data[$i], CRM_Core_DAO::VALUE_SEPARATOR) !== FALSE) { - $data[$i] = explode(CRM_Core_DAO::VALUE_SEPARATOR,$data[$i]); + $data[$i] = explode(CRM_Core_DAO::VALUE_SEPARATOR, $data[$i]); $data[$i] = array_combine($data[$i], $data[$i]); } $params[$field] = $data[$i]; diff --git a/bin/cli.php b/bin/cli.php index c63152d003..21a8e15acf 100644 --- a/bin/cli.php +++ b/bin/cli.php @@ -25,7 +25,7 @@ */ -require_once ('cli.class.php'); +require_once 'cli.class.php'; $cli = new civicrm_Cli(); $cli->initialize() || die( 'Died during initialization' ); $cli->callApi() || die( 'Died during callApi' ); diff --git a/bin/cron.php b/bin/cron.php index ed42f7d693..1eef6574d9 100644 --- a/bin/cron.php +++ b/bin/cron.php @@ -52,4 +52,3 @@ else { $facility->setSingleRunParams('job', $job, $params, 'From cron.php'); $facility->executeJobByAction('job', $job); } - diff --git a/bin/csv/delete.php b/bin/csv/delete.php index 5e7757e682..eb0b85ec5f 100644 --- a/bin/csv/delete.php +++ b/bin/csv/delete.php @@ -33,9 +33,7 @@ * **/ -require_once (dirname(__DIR__) . '/cli.class.php'); +require_once dirname(__DIR__) . '/cli.class.php'; $entityImporter = new civicrm_cli_csv_deleter(); $entityImporter->run(); - - diff --git a/bin/csv/export.php b/bin/csv/export.php index b3eb45d4b7..370c50dcbf 100644 --- a/bin/csv/export.php +++ b/bin/csv/export.php @@ -34,7 +34,7 @@ * e.g.: php bin/csv/export.php -e Contact --email=jamie@progressivetech.org * **/ -require_once (dirname(__DIR__) . '/cli.class.php'); +require_once dirname(__DIR__) . '/cli.class.php'; $entityExporter = new civicrm_cli_csv_exporter(); $entityExporter->run(); diff --git a/bin/csv/import.php b/bin/csv/import.php index 46f6b9ac69..3495865184 100644 --- a/bin/csv/import.php +++ b/bin/csv/import.php @@ -31,9 +31,7 @@ * e.g.: php bin/csv/import.php -e Contact --file /tmp/import.csv * **/ -require_once (dirname(__DIR__) . '/cli.class.php'); +require_once dirname(__DIR__) . '/cli.class.php'; $entityImporter = new civicrm_cli_csv_importer(); $entityImporter->run(); - - diff --git a/bin/deprecated/CiviReportMail.php b/bin/deprecated/CiviReportMail.php index 66cfcad74a..9c9c66570f 100644 --- a/bin/deprecated/CiviReportMail.php +++ b/bin/deprecated/CiviReportMail.php @@ -75,4 +75,3 @@ class CiviReportMail { session_start(); $obj = new CiviReportMail; $obj->run(); - diff --git a/bin/deprecated/EmailProcessor.php b/bin/deprecated/EmailProcessor.php index f025fc0306..84a0e52fb5 100644 --- a/bin/deprecated/EmailProcessor.php +++ b/bin/deprecated/EmailProcessor.php @@ -34,7 +34,7 @@ */ /** - *When runing script from cli : + * When runing script from cli : * 1. By default script is being used for civimail processing. * eg : nice -19 php bin/EmailProcessor.php -u -p -s * @@ -46,7 +46,7 @@ // bootstrap the environment and run the processor // you can run this program either from an apache command, or from the cli if (php_sapi_name() == "cli") { - require_once ("bin/cli.php"); + require_once "bin/cli.php"; $cli = new civicrm_cli(); //if it doesn't die, it's authenticated //log the execution of script @@ -108,4 +108,3 @@ else { $lock->release(); } - diff --git a/bin/deprecated/ParticipantProcessor.php b/bin/deprecated/ParticipantProcessor.php index c1b3fa2413..ecb028ecab 100644 --- a/bin/deprecated/ParticipantProcessor.php +++ b/bin/deprecated/ParticipantProcessor.php @@ -264,5 +264,3 @@ $obj = new CRM_ParticipantProcessor(); echo "Updating.."; $obj->updateParticipantStatus(); echo "
Participant records updated. (Done)"; - - diff --git a/bin/deprecated/RespondentProcessor.php b/bin/deprecated/RespondentProcessor.php index 3d7304a5f2..452969c45b 100644 --- a/bin/deprecated/RespondentProcessor.php +++ b/bin/deprecated/RespondentProcessor.php @@ -108,5 +108,3 @@ $obj = new CRM_RespondentProcessor(); echo "Releasing.."; $obj->releaseRespondent(); echo "

Respondent Release Done"; - - diff --git a/bin/deprecated/UpdateAddress.php b/bin/deprecated/UpdateAddress.php index b917a2835e..030aec5ce0 100644 --- a/bin/deprecated/UpdateAddress.php +++ b/bin/deprecated/UpdateAddress.php @@ -176,7 +176,7 @@ WHERE {$whereClause} $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray); if ($processGeocode) { - require_once (str_replace('_', DIRECTORY_SEPARATOR, $config->geocodeMethod) . '.php'); + require_once str_replace('_', DIRECTORY_SEPARATOR, $config->geocodeMethod) . '.php'; } require_once 'CRM/Core/DAO/Address.php'; @@ -278,4 +278,3 @@ WHERE {$whereClause} } run(); - diff --git a/bin/deprecated/UpdateGreeting.php b/bin/deprecated/UpdateGreeting.php index e4db31d3af..6d2c76e9d5 100644 --- a/bin/deprecated/UpdateGreeting.php +++ b/bin/deprecated/UpdateGreeting.php @@ -237,4 +237,3 @@ UPDATE civicrm_contact $obj = new CRM_UpdateGreeting(); $obj->updateGreeting(); echo "\n\n Greeting is updated for contact(s). (Done) \n"; - diff --git a/bin/deprecated/UpdateMembershipRecord.php b/bin/deprecated/UpdateMembershipRecord.php index bd64e2da12..cf51117d88 100644 --- a/bin/deprecated/UpdateMembershipRecord.php +++ b/bin/deprecated/UpdateMembershipRecord.php @@ -49,7 +49,7 @@ class CRM_UpdateMembershipRecord { function __construct() { // you can run this program either from an apache command, or from the cli if (php_sapi_name() == "cli") { - require_once ("cli.php"); + require_once "cli.php"; $cli = new civicrm_cli(); //if it doesn't die, it's authenticated } @@ -85,4 +85,3 @@ $obj = new CRM_UpdateMembershipRecord(); echo "\n Updating "; $obj->updateMembershipStatus(); echo "\n\n Membership records updated. (Done) \n"; - diff --git a/bin/deprecated/UpdateMembershipReminderDate.php b/bin/deprecated/UpdateMembershipReminderDate.php index e5d93ea0df..ee6f7e2fcf 100644 --- a/bin/deprecated/UpdateMembershipReminderDate.php +++ b/bin/deprecated/UpdateMembershipReminderDate.php @@ -41,7 +41,7 @@ class CRM_UpdateMembershipReminderDate { function __construct() { // you can run this program either from an apache command, or from the cli if (php_sapi_name() == "cli") { - require_once ("cli.php"); + require_once "cli.php"; $cli = new civicrm_cli(); //if it doesn't die, it's authenticated } @@ -114,4 +114,3 @@ $reminderDate = new CRM_UpdateMembershipReminderDate(); echo "\n Updating... "; $reminderDate->updateMembershipReminderDate(); echo "\n\n Membership(s) reminder date updated. (Done) \n"; - diff --git a/bin/deprecated/UpdatePledgeRecord.php b/bin/deprecated/UpdatePledgeRecord.php index 529f02251c..981b8c3482 100644 --- a/bin/deprecated/UpdatePledgeRecord.php +++ b/bin/deprecated/UpdatePledgeRecord.php @@ -170,7 +170,8 @@ SELECT pledge.contact_id as contact_id, require_once 'CRM/Core/BAO/Domain.php'; require_once 'CRM/Core/SelectValues.php'; $domain = CRM_Core_BAO_Domain::getDomain(); - $tokens = array('domain' => array('name', 'phone', 'address', 'email'), + $tokens = array( + 'domain' => array('name', 'phone', 'address', 'email'), 'contact' => CRM_Core_SelectValues::contactTokens(), ); @@ -303,5 +304,3 @@ $obj = new CRM_UpdatePledgeRecord(); echo "Updating
"; $obj->updatePledgeStatus(); echo "
Pledge records update script finished."; - - diff --git a/bin/deprecated/action.cronjob.php b/bin/deprecated/action.cronjob.php index 3f9b366688..1bb7b84e5d 100644 --- a/bin/deprecated/action.cronjob.php +++ b/bin/deprecated/action.cronjob.php @@ -39,7 +39,7 @@ class CRM_Cron_Action { function __construct() { // you can run this program either from an apache command, or from the cli if (php_sapi_name() == "cli") { - require_once ("cli.php"); + require_once "cli.php"; $cli = new civicrm_cli(); //if it doesn't die, it's authenticated } @@ -75,4 +75,3 @@ class CRM_Cron_Action { $cron = new CRM_Cron_Action(); $cron->run(); - diff --git a/bin/deprecated/civimail.cronjob.php b/bin/deprecated/civimail.cronjob.php index 093efe18c9..522f564e54 100644 --- a/bin/deprecated/civimail.cronjob.php +++ b/bin/deprecated/civimail.cronjob.php @@ -53,7 +53,7 @@ function run() { // you can run this program either from an apache command, or from the cli if (php_sapi_name() == "cli") { - require_once ("bin/cli.php"); + require_once "bin/cli.php"; $cli = new civicrm_cli(); require_once 'CRM/Mailing/BAO/Mailing.php'; @@ -64,4 +64,3 @@ if (php_sapi_name() == "cli") { else { run(); } - diff --git a/bin/encryptDB.php b/bin/encryptDB.php index 83f55113f4..ab93c12081 100644 --- a/bin/encryptDB.php +++ b/bin/encryptDB.php @@ -100,4 +100,3 @@ function run() { } run(); - diff --git a/bin/migrate/export.php b/bin/migrate/export.php index 9541b5f070..f4b3d509ed 100644 --- a/bin/migrate/export.php +++ b/bin/migrate/export.php @@ -49,4 +49,3 @@ function run() { } run(); - diff --git a/bin/migrate/exportJSON.php b/bin/migrate/exportJSON.php index 1c9eb9d31a..2e1d993c74 100644 --- a/bin/migrate/exportJSON.php +++ b/bin/migrate/exportJSON.php @@ -50,4 +50,3 @@ function run() { } run(); - diff --git a/bin/migrate/import.php b/bin/migrate/import.php index 5c3b2c54d3..28915d58cd 100644 --- a/bin/migrate/import.php +++ b/bin/migrate/import.php @@ -58,4 +58,3 @@ function run() { } run(); - diff --git a/bin/migrate/importJSON.php b/bin/migrate/importJSON.php index 15e74d59c6..680d55b7ae 100644 --- a/bin/migrate/importJSON.php +++ b/bin/migrate/importJSON.php @@ -49,4 +49,3 @@ function run() { } run(); - diff --git a/bin/migrate/move.php b/bin/migrate/move.php index 33bf0c6c95..c2c15d9d11 100644 --- a/bin/migrate/move.php +++ b/bin/migrate/move.php @@ -43,4 +43,3 @@ function run() { } run(); -