From 402aa41db75cc89a1bd19430d0023ce2048c941d Mon Sep 17 00:00:00 2001 From: Bradley Taylor Date: Mon, 2 Jan 2023 16:52:10 +0000 Subject: [PATCH] PHPDoc corrections --- CRM/Case/Form/Activity.php | 4 ++-- CRM/Case/XMLProcessor/Process.php | 2 +- CRM/Contact/BAO/ContactType.php | 2 +- CRM/Contact/BAO/RelationshipType.php | 2 +- CRM/Contribute/Import/Parser/Contribution.php | 2 +- CRM/Core/Payment/FirstData.php | 2 +- CRM/Core/Payment/PayJunction.php | 2 +- CRM/Core/Smarty/plugins/function.crmKey.php | 2 +- CRM/Event/Page/ParticipantListing/Simple.php | 3 +++ CRM/Event/Selector/Search.php | 2 +- CRM/Export/Form/Select.php | 2 +- CRM/Financial/BAO/Order.php | 2 +- CRM/Mailing/Event/BAO/MailingEventReply.php | 4 ++-- CRM/Utils/Date.php | 2 +- CRM/Utils/String.php | 4 ++-- Civi/Api4/Query/SqlEquation.php | 2 +- Civi/Api4/Query/SqlExpression.php | 2 +- Civi/Api4/Query/SqlFunction.php | 4 ++-- Civi/Core/CiviEventDispatcher.php | 2 +- .../Service/Spec/Provider/SearchSegmentExtraFieldProvider.php | 2 +- 20 files changed, 26 insertions(+), 23 deletions(-) diff --git a/CRM/Case/Form/Activity.php b/CRM/Case/Form/Activity.php index 7b04c4a14b..e0ed82cf2e 100644 --- a/CRM/Case/Form/Activity.php +++ b/CRM/Case/Form/Activity.php @@ -23,14 +23,14 @@ class CRM_Case_Form_Activity extends CRM_Activity_Form_Activity { /** * Cases this activity belongs to. * - * @var []int + * @var int[] */ public $_caseId; /** * The default case type variable defined. * - * @var []int + * @var int[] */ public $_caseType; diff --git a/CRM/Case/XMLProcessor/Process.php b/CRM/Case/XMLProcessor/Process.php index 0d6c3ed976..97fc4e0459 100644 --- a/CRM/Case/XMLProcessor/Process.php +++ b/CRM/Case/XMLProcessor/Process.php @@ -78,7 +78,7 @@ class CRM_Case_XMLProcessor_Process extends CRM_Case_XMLProcessor { } /** - * @param $xml + * @param SimpleXMLElement $xml * @param array $params * * @throws Exception diff --git a/CRM/Contact/BAO/ContactType.php b/CRM/Contact/BAO/ContactType.php index e867e13be9..d02752fe9d 100644 --- a/CRM/Contact/BAO/ContactType.php +++ b/CRM/Contact/BAO/ContactType.php @@ -526,7 +526,7 @@ WHERE contact_sub_type LIKE '%{$subType}%'"; * @param array $params * An assoc array of name/value pairs. * - * @return object|void + * @return CRM_Contact_DAO_ContactType|NULL * @throws \CRM_Core_Exception */ public static function add($params) { diff --git a/CRM/Contact/BAO/RelationshipType.php b/CRM/Contact/BAO/RelationshipType.php index 0a24566a96..3daef9e626 100644 --- a/CRM/Contact/BAO/RelationshipType.php +++ b/CRM/Contact/BAO/RelationshipType.php @@ -129,7 +129,7 @@ class CRM_Contact_BAO_RelationshipType extends CRM_Contact_DAO_RelationshipType * We check that contact_type_a is Individual, but not contact_type_b because there's * nowhere in the code that requires it to be Organization. * - * @return int|string + * @return int * * @throws \CRM_Core_Exception */ diff --git a/CRM/Contribute/Import/Parser/Contribution.php b/CRM/Contribute/Import/Parser/Contribution.php index 2f54ac9554..535c955621 100644 --- a/CRM/Contribute/Import/Parser/Contribution.php +++ b/CRM/Contribute/Import/Parser/Contribution.php @@ -501,7 +501,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Import_Parser { * * @throws \CRM_Core_Exception * - * @return array|null + * @return array */ private function lookupContribution(array $params): array { $where = []; diff --git a/CRM/Core/Payment/FirstData.php b/CRM/Core/Payment/FirstData.php index e0e6cdd427..6623c43658 100644 --- a/CRM/Core/Payment/FirstData.php +++ b/CRM/Core/Payment/FirstData.php @@ -138,7 +138,7 @@ class CRM_Core_Payment_FirstData extends CRM_Core_Payment { * This function sends request and receives response from * the processor * - * @param array|PropertyBag $params + * @param array|\Civi\Payment\PropertyBag $params * * @param string $component * diff --git a/CRM/Core/Payment/PayJunction.php b/CRM/Core/Payment/PayJunction.php index 2d0de55d3f..42f67140ea 100644 --- a/CRM/Core/Payment/PayJunction.php +++ b/CRM/Core/Payment/PayJunction.php @@ -41,7 +41,7 @@ class CRM_Core_Payment_PayJunction extends CRM_Core_Payment { * This function sends request and receives response from * PayJunction payment process * - * @param array|PropertyBag $params + * @param array|\Civi\Payment\PropertyBag $params * * @param string $component * diff --git a/CRM/Core/Smarty/plugins/function.crmKey.php b/CRM/Core/Smarty/plugins/function.crmKey.php index c0ea442692..31a7128fb9 100644 --- a/CRM/Core/Smarty/plugins/function.crmKey.php +++ b/CRM/Core/Smarty/plugins/function.crmKey.php @@ -18,7 +18,7 @@ /** * Generate a CRM_Core_Key of a given name * - * @param string $params + * @param array $params * Params of the {crmKey} call, with the ‘name’ key holding the name of the key. * @param CRM_Core_Smarty $smarty * The Smarty object. diff --git a/CRM/Event/Page/ParticipantListing/Simple.php b/CRM/Event/Page/ParticipantListing/Simple.php index 5452d805dd..10d1f69e5a 100644 --- a/CRM/Event/Page/ParticipantListing/Simple.php +++ b/CRM/Event/Page/ParticipantListing/Simple.php @@ -22,6 +22,9 @@ class CRM_Event_Page_ParticipantListing_Simple extends CRM_Core_Page { protected $_eventTitle; + /** + * @var CRM_Utils_Pager + */ protected $_pager; public function preProcess() { diff --git a/CRM/Event/Selector/Search.php b/CRM/Event/Selector/Search.php index 3ff31c429b..156caf5e73 100644 --- a/CRM/Event/Selector/Search.php +++ b/CRM/Event/Selector/Search.php @@ -516,7 +516,7 @@ class CRM_Event_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co } /** - * @return string + * @return CRM_Contact_BAO_Query */ public function &getQuery() { return $this->_query; diff --git a/CRM/Export/Form/Select.php b/CRM/Export/Form/Select.php index 6a3198f275..5c3e46d580 100644 --- a/CRM/Export/Form/Select.php +++ b/CRM/Export/Form/Select.php @@ -428,7 +428,7 @@ FROM {$this->_componentTable} /** * Get the name of the component. * - * @return array + * @return string */ protected function getComponentName(): string { // CRM_Export_Controller_Standalone has this method diff --git a/CRM/Financial/BAO/Order.php b/CRM/Financial/BAO/Order.php index f1ed6c04da..26998f08a7 100644 --- a/CRM/Financial/BAO/Order.php +++ b/CRM/Financial/BAO/Order.php @@ -1125,7 +1125,7 @@ class CRM_Financial_BAO_Order { /** * Get the line items from a template. * - * @return \Civi\Api4\Generic\Result + * @return array * * @throws \CRM_Core_Exception */ diff --git a/CRM/Mailing/Event/BAO/MailingEventReply.php b/CRM/Mailing/Event/BAO/MailingEventReply.php index abe1026cf5..15cf74d63f 100644 --- a/CRM/Mailing/Event/BAO/MailingEventReply.php +++ b/CRM/Mailing/Event/BAO/MailingEventReply.php @@ -34,7 +34,7 @@ class CRM_Mailing_Event_BAO_MailingEventReply extends CRM_Mailing_Event_DAO_Mail * * @param null $replyto * - * @return object|null + * @return CRM_Mailing_BAO_Mailing|null * The mailing object, or null on failure */ public static function &reply($job_id, $queue_id, $hash, $replyto = NULL) { @@ -78,7 +78,7 @@ class CRM_Mailing_Event_BAO_MailingEventReply extends CRM_Mailing_Event_DAO_Mail * * @param int $queue_id * Queue event ID of the sender. - * @param string $mailing + * @param CRM_Mailing_BAO_Mailing $mailing * The mailing object. * @param string $bodyTxt * Text part of the body (ignored if $fullEmail provided). diff --git a/CRM/Utils/Date.php b/CRM/Utils/Date.php index b486579477..f97951a1ba 100644 --- a/CRM/Utils/Date.php +++ b/CRM/Utils/Date.php @@ -2231,7 +2231,7 @@ class CRM_Utils_Date { /** * Print out a date object in specified format in local timezone * - * @param DateTimeObject $dateObject + * @param DateTimeInterface $dateObject * @param string $format * @return string */ diff --git a/CRM/Utils/String.php b/CRM/Utils/String.php index c167374625..e654e862a7 100644 --- a/CRM/Utils/String.php +++ b/CRM/Utils/String.php @@ -670,8 +670,8 @@ class CRM_Utils_String { /** * Generate a random string. * - * @param $len - * @param $alphabet + * @param int $len + * @param string $alphabet * @return string */ public static function createRandom($len, $alphabet) { diff --git a/Civi/Api4/Query/SqlEquation.php b/Civi/Api4/Query/SqlEquation.php index 71e85d7ec4..da5e9d2f1c 100644 --- a/Civi/Api4/Query/SqlEquation.php +++ b/Civi/Api4/Query/SqlEquation.php @@ -76,7 +76,7 @@ class SqlEquation extends SqlExpression { /** * Render the expression for insertion into the sql query * - * @param Civi\Api4\Query\Api4SelectQuery $query + * @param \Civi\Api4\Query\Api4SelectQuery $query * @return string */ public function render(Api4SelectQuery $query): string { diff --git a/Civi/Api4/Query/SqlExpression.php b/Civi/Api4/Query/SqlExpression.php index 4e4b4cf4bd..6f3e9ee10f 100644 --- a/Civi/Api4/Query/SqlExpression.php +++ b/Civi/Api4/Query/SqlExpression.php @@ -140,7 +140,7 @@ abstract class SqlExpression { /** * Renders expression to a sql string, replacing field names with column names. * - * @param Civi\Api4\Query\Api4SelectQuery $query + * @param \Civi\Api4\Query\Api4SelectQuery $query * @return string */ abstract public function render(Api4SelectQuery $query): string; diff --git a/Civi/Api4/Query/SqlFunction.php b/Civi/Api4/Query/SqlFunction.php index 9f25b7a238..6b094eff3d 100644 --- a/Civi/Api4/Query/SqlFunction.php +++ b/Civi/Api4/Query/SqlFunction.php @@ -106,7 +106,7 @@ abstract class SqlFunction extends SqlExpression { /** * Render the expression for insertion into the sql query * - * @param Civi\Api4\Query\Api4SelectQuery $query + * @param \Civi\Api4\Query\Api4SelectQuery $query * @return string */ public function render(Api4SelectQuery $query): string { @@ -122,7 +122,7 @@ abstract class SqlFunction extends SqlExpression { /** * @param array $arg - * @param Civi\Api4\Query\Api4SelectQuery $query + * @param \Civi\Api4\Query\Api4SelectQuery $query * @return string */ private function renderArg($arg, Api4SelectQuery $query): string { diff --git a/Civi/Core/CiviEventDispatcher.php b/Civi/Core/CiviEventDispatcher.php index 054bd76675..704fcd7ce8 100644 --- a/Civi/Core/CiviEventDispatcher.php +++ b/Civi/Core/CiviEventDispatcher.php @@ -21,7 +21,7 @@ class CiviEventDispatcher implements CiviEventDispatcherInterface { const DEFAULT_HOOK_PRIORITY = -100; /** - * @var Symfony\Component\EventDispatcher\EventDispatcher + * @var \Symfony\Component\EventDispatcher\EventDispatcher */ private $dispatcher; diff --git a/ext/search_kit/Civi/Api4/Service/Spec/Provider/SearchSegmentExtraFieldProvider.php b/ext/search_kit/Civi/Api4/Service/Spec/Provider/SearchSegmentExtraFieldProvider.php index 37df93f86d..5662d023cd 100644 --- a/ext/search_kit/Civi/Api4/Service/Spec/Provider/SearchSegmentExtraFieldProvider.php +++ b/ext/search_kit/Civi/Api4/Service/Spec/Provider/SearchSegmentExtraFieldProvider.php @@ -71,7 +71,7 @@ class SearchSegmentExtraFieldProvider implements Generic\SpecProviderInterface { * Generates the sql case statement with a clause for each item. * * @param array $field - * @param Civi\Api4\Query\Api4SelectQuery $query + * @param \Civi\Api4\Query\Api4SelectQuery $query * @return string */ public static function renderSql(array $field, Api4SelectQuery $query): string { -- 2.25.1