From 4e87860d88f2807aac1eec4d0f6d1d2a2f343931 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sat, 24 May 2014 15:14:18 +1200 Subject: [PATCH] bin add missing comment blocks (autogenerated) --- .../Form/Search/Custom/ContribSYBNT.php | 3 + api/v3/Generic.php | 3 + bin/ContributionProcessor.php | 12 +++ bin/cli.class.php | 47 ++++++++++- bin/deprecated/CiviReportMail.php | 3 + bin/deprecated/ParticipantProcessor.php | 7 ++ bin/deprecated/RespondentProcessor.php | 7 ++ bin/deprecated/UpdateAddress.php | 7 ++ bin/deprecated/UpdateGreeting.php | 7 ++ bin/deprecated/UpdateMembershipRecord.php | 7 ++ .../UpdateMembershipReminderDate.php | 7 ++ bin/deprecated/UpdatePledgeRecord.php | 12 +++ bin/deprecated/action.cronjob.php | 10 +++ bin/givi | 77 +++++++++++++++++++ 14 files changed, 207 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/Form/Search/Custom/ContribSYBNT.php b/CRM/Contact/Form/Search/Custom/ContribSYBNT.php index a07b5c3f60..5eee5ea65b 100644 --- a/CRM/Contact/Form/Search/Custom/ContribSYBNT.php +++ b/CRM/Contact/Form/Search/Custom/ContribSYBNT.php @@ -112,6 +112,9 @@ class CRM_Contact_Form_Search_Custom_ContribSYBNT implements CRM_Contact_Form_Se // @TODO: Add rule to ensure that exclusion dates are not in the inclusion range } + /** + * @return mixed + */ function count() { $sql = $this->all(); diff --git a/api/v3/Generic.php b/api/v3/Generic.php index 78ca31f209..d274ce5321 100644 --- a/api/v3/Generic.php +++ b/api/v3/Generic.php @@ -205,6 +205,9 @@ function civicrm_api3_generic_getvalue($apiRequest) { return civicrm_api3_create_error("missing param return=field you want to read the value of", array('error_type' => 'mandatory_missing', 'missing_param' => 'return')); } +/** + * @param $params + */ function _civicrm_api3_generic_getrefcount_spec(&$params) { $params['id']['api.required'] = 1; } diff --git a/bin/ContributionProcessor.php b/bin/ContributionProcessor.php index f46c458c4e..3451e1b545 100644 --- a/bin/ContributionProcessor.php +++ b/bin/ContributionProcessor.php @@ -136,6 +136,12 @@ class CiviContributeProcessor { ), ); + /** + * @param $paymentProcessor + * @param $paymentMode + * @param $start + * @param $end + */ static function paypal($paymentProcessor, $paymentMode, $start, $end) { $url = "{$paymentProcessor['url_api']}nvp"; @@ -236,6 +242,12 @@ class CiviContributeProcessor { } while ($result['l_errorcode0'] == '11002'); } + /** + * @param $paymentProcessor + * @param $paymentMode + * @param $start + * @param $end + */ static function google($paymentProcessor, $paymentMode, $start, $end) { require_once "CRM/Contribute/BAO/Contribution/Utils.php"; diff --git a/bin/cli.class.php b/bin/cli.class.php index a821dc21e6..c9215ec861 100644 --- a/bin/cli.class.php +++ b/bin/cli.class.php @@ -59,6 +59,9 @@ class civicrm_cli { var $_errors = array(); + /** + * @return bool + */ public function initialize() { if (!$this->_accessing_from_cli()) { return FALSE; @@ -84,6 +87,9 @@ class civicrm_cli { } } + /** + * @return bool + */ public function callApi() { require_once 'api/api.php'; @@ -110,6 +116,9 @@ class civicrm_cli { return TRUE; } + /** + * @return bool + */ private function _parseOptions() { $args = $_SERVER['argv']; // remove the first argument, which is the name @@ -181,6 +190,9 @@ class civicrm_cli { return TRUE; } + /** + * @return bool + */ private function _bootstrap() { // so the configuration works with php-cli $_SERVER['PHP_SELF'] = "/index.php"; @@ -207,12 +219,12 @@ class civicrm_cli { CRM_Core_ClassLoader::singleton()->register(); $this->_config = CRM_Core_Config::singleton(); - + // 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( - '!^https?://([^/]+)/$!i', + '!^https?://([^/]+)/$!i', '$1', $this->_config->userFrameworkBaseURL); } @@ -246,6 +258,9 @@ class civicrm_cli { return TRUE; } + /** + * @return bool + */ private function _validateOptions() { $required = $this->_required_arguments; while (list(, $var) = each($required)) { @@ -260,12 +275,20 @@ class civicrm_cli { return TRUE; } + /** + * @param $value + * + * @return string + */ private function _sanitize($value) { // restrict user input - we should not be needing anything // other than normal alpha numeric plus - and _. return trim(preg_replace('#^[^a-zA-Z0-9\-_=/]$#', '', $value)); } + /** + * @return string + */ private function _getUsage() { $out = "Usage: cli.php -e entity -a action [-u user] [-s site] [--output] [PARAMS]\n"; $out .= " entity is the name of the entity, e.g. Contact, Event, etc.\n"; @@ -277,6 +300,9 @@ class civicrm_cli { return ts($out); } + /** + * @param $error + */ private function _log($error) { // fixme, this should call some CRM_Core_Error:: function // that properly logs @@ -292,6 +318,9 @@ class civicrm_cli { class civicrm_cli_csv_exporter extends civicrm_cli { var $separator = ','; + /** + * + */ function __construct() { $this->_required_arguments = array('entity'); parent::initialize(); @@ -335,6 +364,9 @@ class civicrm_cli_csv_file extends civicrm_cli { var $header; var $separator = ','; + /** + * + */ function __construct() { $this->_required_arguments = array('entity','file'); $this->_additional_arguments = array('f' => 'file'); @@ -375,6 +407,11 @@ class civicrm_cli_csv_file extends civicrm_cli { } /* return a params as expected */ + /** + * @param $data + * + * @return array + */ function convertLine($data) { $params = array(); foreach ($this->header as $i => $field) { @@ -397,6 +434,9 @@ class civicrm_cli_csv_file extends civicrm_cli { **/ class civicrm_cli_csv_importer extends civicrm_cli_csv_file { + /** + * @param $params + */ function processline($params) { $result = civicrm_api($this->_entity, 'Create', $params); if ($result['is_error']) { @@ -415,6 +455,9 @@ class civicrm_cli_csv_importer extends civicrm_cli_csv_file { **/ class civicrm_cli_csv_deleter extends civicrm_cli_csv_file { + /** + * @param $params + */ function processline($params) { $result = civicrm_api($this->_entity, 'Delete', $params); if ($result['is_error']) { diff --git a/bin/deprecated/CiviReportMail.php b/bin/deprecated/CiviReportMail.php index 75516f49e7..b5a99bdb91 100644 --- a/bin/deprecated/CiviReportMail.php +++ b/bin/deprecated/CiviReportMail.php @@ -30,6 +30,9 @@ * recipients mentioned for that report */ class CiviReportMail { + /** + * + */ function __construct() { $this->initialize(); diff --git a/bin/deprecated/ParticipantProcessor.php b/bin/deprecated/ParticipantProcessor.php index ea33f26754..9086e50fb6 100644 --- a/bin/deprecated/ParticipantProcessor.php +++ b/bin/deprecated/ParticipantProcessor.php @@ -34,7 +34,14 @@ require_once '../civicrm.config.php'; require_once 'CRM/Core/Config.php'; + +/** + * Class CRM_ParticipantProcessor + */ class CRM_ParticipantProcessor { + /** + * + */ function __construct() { $config = CRM_Core_Config::singleton(); diff --git a/bin/deprecated/RespondentProcessor.php b/bin/deprecated/RespondentProcessor.php index 37194c3646..c17e8ef1bd 100644 --- a/bin/deprecated/RespondentProcessor.php +++ b/bin/deprecated/RespondentProcessor.php @@ -33,7 +33,14 @@ require_once '../civicrm.config.php'; require_once 'CRM/Core/Config.php'; + +/** + * Class CRM_RespondentProcessor + */ class CRM_RespondentProcessor { + /** + * + */ function __construct() { $config = CRM_Core_Config::singleton(); diff --git a/bin/deprecated/UpdateAddress.php b/bin/deprecated/UpdateAddress.php index 767f503106..27ca82ca51 100644 --- a/bin/deprecated/UpdateAddress.php +++ b/bin/deprecated/UpdateAddress.php @@ -132,6 +132,13 @@ function run() { processContacts($config, $processGeocode, $parseStreetAddress, $start, $end); } +/** + * @param $config + * @param $processGeocode + * @param $parseStreetAddress + * @param null $start + * @param null $end + */ function processContacts(&$config, $processGeocode, $parseStreetAddress, $start = NULL, $end = NULL) { // build where clause. $clause = array('( c.id = a.contact_id )'); diff --git a/bin/deprecated/UpdateGreeting.php b/bin/deprecated/UpdateGreeting.php index 331a73ee6e..c7004cd7d6 100644 --- a/bin/deprecated/UpdateGreeting.php +++ b/bin/deprecated/UpdateGreeting.php @@ -37,7 +37,14 @@ * IMPORTANT: You must first create valid option value before using via admin interface. * Check option lists for Email Greetings, Postal Greetings and Addressee */ + +/** + * Class CRM_UpdateGreeting + */ class CRM_UpdateGreeting { + /** + * + */ function __construct() { $this->initialize(); diff --git a/bin/deprecated/UpdateMembershipRecord.php b/bin/deprecated/UpdateMembershipRecord.php index fe6787be93..ec6cf569ba 100644 --- a/bin/deprecated/UpdateMembershipRecord.php +++ b/bin/deprecated/UpdateMembershipRecord.php @@ -38,7 +38,14 @@ * * Save the file as UpdateMembershipRecord.php prior to running this script. */ + +/** + * Class CRM_UpdateMembershipRecord + */ class CRM_UpdateMembershipRecord { + /** + * + */ function __construct() { // you can run this program either from an apache command, or from the cli if (php_sapi_name() == "cli") { diff --git a/bin/deprecated/UpdateMembershipReminderDate.php b/bin/deprecated/UpdateMembershipReminderDate.php index 5e21faf49a..4274244144 100644 --- a/bin/deprecated/UpdateMembershipReminderDate.php +++ b/bin/deprecated/UpdateMembershipReminderDate.php @@ -30,7 +30,14 @@ * This file updates the Reminder dates of all valid membership records. * */ + +/** + * Class CRM_UpdateMembershipReminderDate + */ class CRM_UpdateMembershipReminderDate { + /** + * + */ function __construct() { // you can run this program either from an apache command, or from the cli if (php_sapi_name() == "cli") { diff --git a/bin/deprecated/UpdatePledgeRecord.php b/bin/deprecated/UpdatePledgeRecord.php index c64ee715f9..eafc94cb9e 100644 --- a/bin/deprecated/UpdatePledgeRecord.php +++ b/bin/deprecated/UpdatePledgeRecord.php @@ -35,7 +35,14 @@ require_once '../civicrm.config.php'; require_once 'CRM/Core/Config.php'; + +/** + * Class CRM_UpdatePledgeRecord + */ class CRM_UpdatePledgeRecord { + /** + * + */ function __construct() { $config = CRM_Core_Config::singleton(); // this does not return on failure @@ -49,6 +56,11 @@ class CRM_UpdatePledgeRecord { CRM_Core_Error::debug_log_message('UpdatePledgeRecord.php'); } + /** + * @param bool $sendReminders + * + * @throws Exception + */ public function updatePledgeStatus($sendReminders = FALSE) { // *** Uncomment the next line if you want automated reminders to be sent diff --git a/bin/deprecated/action.cronjob.php b/bin/deprecated/action.cronjob.php index 6c75291487..7d432b9c66 100644 --- a/bin/deprecated/action.cronjob.php +++ b/bin/deprecated/action.cronjob.php @@ -28,7 +28,14 @@ /* */ + +/** + * Class CRM_Cron_Action + */ 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") { @@ -57,6 +64,9 @@ class CRM_Cron_Action { $config = CRM_Core_Config::singleton(); } + /** + * @param null $now + */ public function run($now = NULL) { require_once 'CRM/Core/BAO/ActionSchedule.php'; CRM_Core_BAO_ActionSchedule::processQueue($now); diff --git a/bin/givi b/bin/givi index c0f3f5c07f..2ea009ce9d 100755 --- a/bin/givi +++ b/bin/givi @@ -10,10 +10,18 @@ class DirStack { protected $dirs; + /** + * @param array $dirs + */ function __construct($dirs = array()) { $this->dirs = $dirs; } + /** + * @param $dir + * + * @throws Exception + */ function push($dir) { $this->dirs[] = getcwd(); if (!chdir($dir)) { @@ -66,6 +74,9 @@ class PullRequest { protected $data; + /** + * @return mixed + */ public function getNumber() { return $this->data->number; } @@ -85,6 +96,9 @@ class PullRequest { } } +/** + * Class Givi + */ class Givi { /** @@ -167,6 +181,9 @@ class Givi { */ protected $dirStack; + /** + * + */ function __construct() { $this->dirStack = new DirStack(); $this->repos = array( @@ -178,6 +195,11 @@ class Givi { ); } + /** + * @param $args + * + * @throws Exception + */ function main($args) { if (!$this->parseOptions($args)) { printf("Error parsing arguments\n"); @@ -350,6 +372,11 @@ class Givi { echo "local branches.\n"; } + /** + * @param null $baseBranch + * + * @return bool + */ function doCheckoutAll($baseBranch = NULL) { if (!$baseBranch) { return $this->returnError("Missing \n"); @@ -366,6 +393,9 @@ class Givi { return TRUE; } + /** + * @return bool + */ function doStatusAll() { foreach ($this->repos as $repo => $relPath) { $this->run($repo, $relPath, 'git', 'status'); @@ -373,6 +403,11 @@ class Givi { return TRUE; } + /** + * @param null $baseBranch + * + * @return bool + */ function doBegin($baseBranch = NULL) { if (!$baseBranch) { return $this->returnError("Missing \n"); @@ -400,6 +435,12 @@ class Givi { return TRUE; } + /** + * @param null $baseBranch + * + * @return bool + * @throws Exception + */ function doResume($baseBranch = NULL) { if (!$baseBranch) { return $this->returnError("Missing \n"); @@ -426,6 +467,11 @@ class Givi { return TRUE; } + /** + * @param null $baseBranch + * + * @return bool + */ function doReview($baseBranch = NULL) { if (! $this->doCheckoutAll($baseBranch)) { return FALSE; @@ -491,6 +537,12 @@ class Givi { } */ + /** + * @param $newBranchRepo + * @param $newBranchNames + * + * @return bool + */ function doPush($newBranchRepo, $newBranchNames) { if (!$newBranchRepo) { return $this->returnError("Missing \n"); @@ -608,6 +660,12 @@ class Givi { return $branches; } + /** + * @param $repoName + * @param $branchName + * + * @return string + */ function filterBranchName($repoName, $branchName) { if ($branchName == '') { return ''; @@ -645,6 +703,11 @@ class Givi { return $repos; } + /** + * @param $message + * + * @return bool + */ function returnError($message) { echo "\nERROR: ", $message, "\n\n"; $this->doHelp(); @@ -652,7 +715,16 @@ class Givi { } } +/** + * Class HttpClient + */ class HttpClient { + /** + * @param $url + * @param $file + * + * @return bool + */ static function download($url, $file) { // PHP native client is unreliable PITA for HTTPS if (exec("which wget")) { @@ -665,6 +737,11 @@ class HttpClient { return TRUE; } + /** + * @param $url + * + * @return mixed + */ static function getJson($url) { $file = tempnam(sys_get_temp_dir(), 'givi-json-'); HttpClient::download($url, $file); -- 2.25.1