From 257e766661dd8d801835a792082b14d80926107e Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 13 Jan 2015 14:28:30 +1300 Subject: [PATCH] a few mre comment block fixes --- CRM/Core/Smarty/plugins/compiler.continue.php | 3 +++ Civi/API/Provider/AdhocProvider.php | 7 +++++++ Civi/API/Provider/MagicFunctionProvider.php | 7 +++++++ Civi/API/Provider/ReflectionProvider.php | 8 ++++++++ Civi/API/Subscriber/APIv3SchemaAdapter.php | 4 ++++ Civi/API/Subscriber/ChainSubscriber.php | 6 ++++++ Civi/API/Subscriber/I18nSubscriber.php | 2 ++ Civi/CiUtil/PHPUnitScanner.php | 9 ++++++--- Civi/Core/Transaction/Frame.php | 1 + sql/GenerateData.php | 18 +++++++++++++++++- sql/GenerateReportData.php | 5 ++++- tests/phpunit/CiviTest/CiviUnitTestCase.php | 7 ++++--- 12 files changed, 69 insertions(+), 8 deletions(-) diff --git a/CRM/Core/Smarty/plugins/compiler.continue.php b/CRM/Core/Smarty/plugins/compiler.continue.php index 2c4b202110..90e369a30f 100644 --- a/CRM/Core/Smarty/plugins/compiler.continue.php +++ b/CRM/Core/Smarty/plugins/compiler.continue.php @@ -2,6 +2,9 @@ /** * Skip remaining logic in the current iteration of a loop. + * @param $contents + * @param $smarty + * @return string */ function smarty_compiler_continue($contents, &$smarty) { return 'continue;'; diff --git a/Civi/API/Provider/AdhocProvider.php b/Civi/API/Provider/AdhocProvider.php index 7bb62be87f..e6147c12c2 100644 --- a/Civi/API/Provider/AdhocProvider.php +++ b/Civi/API/Provider/AdhocProvider.php @@ -124,6 +124,8 @@ class AdhocProvider implements EventSubscriberInterface, ProviderInterface { /** * {inheritdoc} + * @param array $apiRequest + * @return array|mixed */ public function invoke($apiRequest) { return call_user_func($this->actions[strtolower($apiRequest['action'])]['callback'], $apiRequest); @@ -131,6 +133,8 @@ class AdhocProvider implements EventSubscriberInterface, ProviderInterface { /** * {inheritdoc} + * @param int $version + * @return array */ public function getEntityNames($version) { return array($this->entity); @@ -138,6 +142,9 @@ class AdhocProvider implements EventSubscriberInterface, ProviderInterface { /** * {inheritdoc} + * @param int $version + * @param string $entity + * @return array */ public function getActionNames($version, $entity) { if ($version == $this->version && $entity == $this->entity) { diff --git a/Civi/API/Provider/MagicFunctionProvider.php b/Civi/API/Provider/MagicFunctionProvider.php index 8dd97a6289..81772020b4 100644 --- a/Civi/API/Provider/MagicFunctionProvider.php +++ b/Civi/API/Provider/MagicFunctionProvider.php @@ -74,6 +74,8 @@ class MagicFunctionProvider implements EventSubscriberInterface, ProviderInterfa /** * {inheritdoc} + * @param array $apiRequest + * @return array */ public function invoke($apiRequest) { $function = $apiRequest['function']; @@ -91,6 +93,8 @@ class MagicFunctionProvider implements EventSubscriberInterface, ProviderInterfa /** * {inheritdoc} + * @param int $version + * @return array */ public function getEntityNames($version) { $entities = array(); @@ -131,6 +135,9 @@ class MagicFunctionProvider implements EventSubscriberInterface, ProviderInterfa /** * {inheritdoc} + * @param int $version + * @param string $entity + * @return array */ public function getActionNames($version, $entity) { $entity = _civicrm_api_get_camel_name($entity); diff --git a/Civi/API/Provider/ReflectionProvider.php b/Civi/API/Provider/ReflectionProvider.php index c6cecdec3d..b865f9d058 100644 --- a/Civi/API/Provider/ReflectionProvider.php +++ b/Civi/API/Provider/ReflectionProvider.php @@ -108,6 +108,9 @@ class ReflectionProvider implements EventSubscriberInterface, ProviderInterface /** * {inheritdoc} + * @param array $apiRequest + * @return array + * @throws \API_Exception */ public function invoke($apiRequest) { if (strtolower($apiRequest['entity']) == 'entity' && $apiRequest['action'] == 'get') { @@ -129,6 +132,8 @@ class ReflectionProvider implements EventSubscriberInterface, ProviderInterface /** * {inheritdoc} + * @param int $version + * @return array */ public function getEntityNames($version) { return array('Entity'); @@ -136,6 +141,9 @@ class ReflectionProvider implements EventSubscriberInterface, ProviderInterface /** * {inheritdoc} + * @param int $version + * @param string $entity + * @return array */ public function getActionNames($version, $entity) { $entity = _civicrm_api_get_camel_name($entity, $version); diff --git a/Civi/API/Subscriber/APIv3SchemaAdapter.php b/Civi/API/Subscriber/APIv3SchemaAdapter.php index 8d25276215..4c615913c4 100644 --- a/Civi/API/Subscriber/APIv3SchemaAdapter.php +++ b/Civi/API/Subscriber/APIv3SchemaAdapter.php @@ -92,6 +92,8 @@ class APIv3SchemaAdapter implements EventSubscriberInterface { /** * Return array of defaults for the given API (function is a wrapper on getfields). + * @param $fields + * @return array */ public function getDefaults($fields) { $defaults = array(); @@ -106,6 +108,8 @@ class APIv3SchemaAdapter implements EventSubscriberInterface { /** * Return array of required fields for the given API (function is a wrapper on getfields). + * @param $fields + * @return array */ public function getRequired($fields) { $required = array('version'); diff --git a/Civi/API/Subscriber/ChainSubscriber.php b/Civi/API/Subscriber/ChainSubscriber.php index 651229e67b..947371d0f6 100644 --- a/Civi/API/Subscriber/ChainSubscriber.php +++ b/Civi/API/Subscriber/ChainSubscriber.php @@ -78,6 +78,12 @@ class ChainSubscriber implements EventSubscriberInterface { * Call any nested api calls * * TODO: We don't really need this to be a separate function. + * @param $params + * @param $result + * @param $action + * @param $entity + * @param $version + * @throws \Exception */ protected function callNestedApi(&$params, &$result, $action, $entity, $version) { $entity = _civicrm_api_get_entity_name_from_camel($entity); diff --git a/Civi/API/Subscriber/I18nSubscriber.php b/Civi/API/Subscriber/I18nSubscriber.php index 2f11eb88dd..2aba5693ff 100644 --- a/Civi/API/Subscriber/I18nSubscriber.php +++ b/Civi/API/Subscriber/I18nSubscriber.php @@ -63,6 +63,8 @@ class I18nSubscriber implements EventSubscriberInterface { * Sets the tsLocale and dbLocale for multi-lingual sites. * Some code duplication from CRM/Core/BAO/ConfigSetting.php retrieve() * to avoid regressions from refactoring. + * @param $lcMessagesRequest + * @throws \API_Exception */ public function setLocale($lcMessagesRequest) { // We must validate whether the locale is valid, otherwise setting a bad diff --git a/Civi/CiUtil/PHPUnitScanner.php b/Civi/CiUtil/PHPUnitScanner.php index d534bc7e2f..61534bf535 100644 --- a/Civi/CiUtil/PHPUnitScanner.php +++ b/Civi/CiUtil/PHPUnitScanner.php @@ -8,7 +8,8 @@ use Symfony\Component\Finder\Finder; */ class PHPUnitScanner { /** - * @return array class names + * @param $path + * @return array class names */ public static function _findTestClasses($path) { // print_r(array( @@ -27,8 +28,10 @@ class PHPUnitScanner { } /** - * @return array - * (string $file => string $class) + * @param $paths + * @return array (string $file => string $class) + * (string $file => string $class) + * @throws \Exception */ public static function findTestClasses($paths) { $testClasses = array(); diff --git a/Civi/Core/Transaction/Frame.php b/Civi/Core/Transaction/Frame.php index ea0a8b9e7d..d07de48e67 100644 --- a/Civi/Core/Transaction/Frame.php +++ b/Civi/Core/Transaction/Frame.php @@ -162,6 +162,7 @@ class Frame { * A PHP callback. * @param array|NULL $params Optional values to pass to callback. * See php manual call_user_func_array for details. + * @param null $id */ public function addCallback($phase, $callback, $params = NULL, $id = NULL) { if ($id) { diff --git a/sql/GenerateData.php b/sql/GenerateData.php index cb50417ede..cc97eb9677 100644 --- a/sql/GenerateData.php +++ b/sql/GenerateData.php @@ -147,6 +147,7 @@ class CRM_GCD { /** * Public wrapper for calling private "add" functions * Provides user feedback + * @param $itemName */ public function generate($itemName) { echo "Generating $itemName\n"; @@ -260,7 +261,10 @@ class CRM_GCD { /********************************* * private methods - *********************************/ + ******************************** + * @param int $size + * @return string + */ // get a randomly generated string private function randomString($size = 32) { @@ -388,6 +392,9 @@ class CRM_GCD { /** * Automatically manage the is_primary field by tracking which contacts have each item + * @param $cid + * @param $type + * @return int */ private function isPrimary($cid, $type) { if (empty($this->location[$type][$cid])) { @@ -400,6 +407,9 @@ class CRM_GCD { /** * Execute a query unless we are doing a dry run * Note: this wrapper should not be used for SELECT queries + * @param $query + * @param array $params + * @return \CRM_Core_DAO */ private function _query($query, $params = array()) { if (self::ADD_TO_DB) { @@ -409,6 +419,7 @@ class CRM_GCD { /** * Call dao insert method unless we are doing a dry run + * @param $dao */ private function _insert(&$dao) { if (self::ADD_TO_DB) { @@ -422,6 +433,7 @@ class CRM_GCD { /** * Call dao update method unless we are doing a dry run + * @param $dao */ private function _update(&$dao) { if (self::ADD_TO_DB) { @@ -435,6 +447,8 @@ class CRM_GCD { /** * Add core DAO object + * @param $type + * @param $params */ private function _addDAO($type, $params) { $daoName = "CRM_Core_DAO_$type"; @@ -450,6 +464,8 @@ class CRM_GCD { /** * Fetch contact type based on stored mapping + * @param $id + * @return */ private function getContactType($id) { foreach (array('Individual', 'Household', 'Organization') as $type) { diff --git a/sql/GenerateReportData.php b/sql/GenerateReportData.php index fd73ea0cd1..265acfa94b 100644 --- a/sql/GenerateReportData.php +++ b/sql/GenerateReportData.php @@ -240,7 +240,10 @@ class CRM_GCD { /********************************* * private methods - *********************************/ + ******************************** + * @param int $size + * @return string + */ // get a randomly generated string private function _getRandomString($size = 32) { diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 04299f181f..e16a0232d0 100755 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -1850,9 +1850,10 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * * @params array to add group * - * @param array $params - * @return int - * groupId of created group + * @param int $groupID + * @param int $totalCount + * @return int groupId of created group + * groupId of created group */ public function groupContactCreate($groupID, $totalCount = 10) { $params = array('group_id' => $groupID); -- 2.25.1