From b84fe775269b066fcec0b7460d15aa50c7e22296 Mon Sep 17 00:00:00 2001 From: Bradley Taylor Date: Mon, 10 Apr 2023 10:00:24 +0100 Subject: [PATCH] (NFC) PHPdoc fixes and improvements --- CRM/Price/BAO/LineItem.php | 2 +- tests/phpunit/CRM/Contact/Form/Task/AddToGroupTest.php | 4 ++++ tests/phpunit/CRM/Contact/Form/Task/PrintMailingLabelTest.php | 2 +- tests/phpunit/CiviTest/CiviUnitTestCase.php | 4 ++-- tests/phpunit/api/v4/Mock/Api4/MockArrayEntity.php | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CRM/Price/BAO/LineItem.php b/CRM/Price/BAO/LineItem.php index 1c2a7d0f0c..64823e5599 100644 --- a/CRM/Price/BAO/LineItem.php +++ b/CRM/Price/BAO/LineItem.php @@ -812,7 +812,7 @@ WHERE li.contribution_id = %1"; /** * Helper function to return sum of financial item's amount related to a line-item - * @param array $lineItemID + * @param int $lineItemID * * @return float $financialItem */ diff --git a/tests/phpunit/CRM/Contact/Form/Task/AddToGroupTest.php b/tests/phpunit/CRM/Contact/Form/Task/AddToGroupTest.php index 704643b95c..9d1a8edcad 100644 --- a/tests/phpunit/CRM/Contact/Form/Task/AddToGroupTest.php +++ b/tests/phpunit/CRM/Contact/Form/Task/AddToGroupTest.php @@ -18,6 +18,10 @@ class CRM_Contact_Form_Task_AddToGroupTest extends CiviUnitTestCase { parent::setUp(); } + /** + * @param array $formValues + * @return CRM_Contact_Form_Task_AddToGroup + */ protected function getSearchTaskFormObject(array $formValues) { $_POST = $formValues; $_SERVER['REQUEST_METHOD'] = 'GET'; diff --git a/tests/phpunit/CRM/Contact/Form/Task/PrintMailingLabelTest.php b/tests/phpunit/CRM/Contact/Form/Task/PrintMailingLabelTest.php index 4c310d1136..191406ff61 100644 --- a/tests/phpunit/CRM/Contact/Form/Task/PrintMailingLabelTest.php +++ b/tests/phpunit/CRM/Contact/Form/Task/PrintMailingLabelTest.php @@ -59,7 +59,7 @@ class CRM_Contact_Form_Task_PrintMailingLabelTest extends CiviUnitTestCase { } } - /* @var CRM_Contact_Form_Task_Label $fom */ + /** @var CRM_Contact_Form_Task_Label $form */ $form = $this->getFormObject('CRM_Contact_Form_Task_Label', [ 'label_name' => 3475, 'location_type_id' => NULL, diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 128680d306..134f358080 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -622,9 +622,9 @@ class CiviUnitTestCase extends PHPUnit\Framework\TestCase { /** * @param string $name * - * @return mixed + * @return int */ - public function membershipStatusCreate($name = 'test member status') { + public function membershipStatusCreate($name = 'test member status'): int { $params['name'] = $name; $params['start_event'] = 'start_date'; $params['end_event'] = 'end_date'; diff --git a/tests/phpunit/api/v4/Mock/Api4/MockArrayEntity.php b/tests/phpunit/api/v4/Mock/Api4/MockArrayEntity.php index 430d49bd0e..cc8e4cf636 100644 --- a/tests/phpunit/api/v4/Mock/Api4/MockArrayEntity.php +++ b/tests/phpunit/api/v4/Mock/Api4/MockArrayEntity.php @@ -21,7 +21,7 @@ namespace Civi\Api4; /** * MockArrayEntity entity. * - * @method Generic\BasicGetAction get() + * @method static Generic\BasicGetAction get() * * @package Civi\Api4 */ -- 2.25.1