From 28a98d7edc47366395b3df5c668ca18bc1cae063 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 18 Jan 2022 13:32:13 +1300 Subject: [PATCH] More phpcbs code cleanups --- install/langs.php | 2 +- .../phpunit/CRM/Campaign/BAO/CampaignTest.php | 3 +- .../CRM/Case/XMLProcessor/ProcessTest.php | 8 ++-- .../CRM/Case/XMLProcessor/ReportTest.php | 2 +- tests/phpunit/CRM/Mailing/BAO/MailingTest.php | 2 +- .../Incremental/php/FiveTwentyTest.php | 4 +- .../CiviTest/ReleaseTestSettings.php.txt | 42 +++++++++---------- tools/bin/scripts/set-version.php | 15 ++++--- 8 files changed, 39 insertions(+), 39 deletions(-) diff --git a/install/langs.php b/install/langs.php index 46a387fbab6d..0b98de24519f 100644 --- a/install/langs.php +++ b/install/langs.php @@ -48,4 +48,4 @@ 'tr_TR' => 'Turkish', 'uk_UA' => 'Ukrainian', 'vi_VN' => 'Vietnamese', -); \ No newline at end of file +); diff --git a/tests/phpunit/CRM/Campaign/BAO/CampaignTest.php b/tests/phpunit/CRM/Campaign/BAO/CampaignTest.php index 6166309a56c7..b5627adff186 100644 --- a/tests/phpunit/CRM/Campaign/BAO/CampaignTest.php +++ b/tests/phpunit/CRM/Campaign/BAO/CampaignTest.php @@ -15,7 +15,6 @@ * @package CRM * @copyright CiviCRM LLC https://civicrm.org/licensing */ - class CRM_Campaign_BAO_CampaignTest extends CiviUnitTestCase { public function testCampaignSummary() { @@ -39,4 +38,4 @@ public function testCampaignSummary() { $this->assertEquals(1, CRM_Campaign_BAO_Campaign::getCampaignSummary(['status_id' => [2, 3]], TRUE)); } -} +} diff --git a/tests/phpunit/CRM/Case/XMLProcessor/ProcessTest.php b/tests/phpunit/CRM/Case/XMLProcessor/ProcessTest.php index f16b697e439e..c83fcfa9769e 100644 --- a/tests/phpunit/CRM/Case/XMLProcessor/ProcessTest.php +++ b/tests/phpunit/CRM/Case/XMLProcessor/ProcessTest.php @@ -407,8 +407,8 @@ protected function assertActivityAssignedToContactExists($assigneeContactId) { * unique for each entry in the dataprovider since want to test a given * relationship type against multiple xml strings. It's not a test * identifier, it's an array key to use to look up something. - * @param $xmlString string - * @param $expected array + * @param string $xmlString + * @param array $expected * @param $dontcare array We're re-using the data provider for two tests and * we don't care about those expected values. * @@ -431,10 +431,10 @@ public function testCaseRoles($key, $xmlString, $expected, $dontcare) { * unique for each entry in the dataprovider since want to test a given * relationship type against multiple xml strings. It's not a test * identifier, it's an array key to use to look up something. - * @param $xmlString string + * @param string $xmlString * @param $dontcare array We're re-using the data provider for two tests and * we don't care about those expected values. - * @param $expected array + * @param array $expected * * @dataProvider xmlCaseRoleDataProvider */ diff --git a/tests/phpunit/CRM/Case/XMLProcessor/ReportTest.php b/tests/phpunit/CRM/Case/XMLProcessor/ReportTest.php index 987f0bd6a0df..19437dcec36d 100644 --- a/tests/phpunit/CRM/Case/XMLProcessor/ReportTest.php +++ b/tests/phpunit/CRM/Case/XMLProcessor/ReportTest.php @@ -23,7 +23,7 @@ public function tearDown(): void { * Test that getCaseReport has the right output. * * @param $activitySetName string Also acts as data provider test identifier. - * @param $expected array + * @param array $expected * * @dataProvider caseReportDataProvider */ diff --git a/tests/phpunit/CRM/Mailing/BAO/MailingTest.php b/tests/phpunit/CRM/Mailing/BAO/MailingTest.php index fbfab8db9cca..f1327ee35c99 100644 --- a/tests/phpunit/CRM/Mailing/BAO/MailingTest.php +++ b/tests/phpunit/CRM/Mailing/BAO/MailingTest.php @@ -29,7 +29,7 @@ public function tearDown(): void { * match the expected list * * @param $mailingID - * @param $expectedRecipients array + * @param array $expectedRecipients * Array of contact ID that should be in the recipient list. */ private function assertRecipientsCorrect($mailingID, $expectedRecipients) { diff --git a/tests/phpunit/CRM/Upgrade/Incremental/php/FiveTwentyTest.php b/tests/phpunit/CRM/Upgrade/Incremental/php/FiveTwentyTest.php index 79ead6323dc9..c0f9e7a69b17 100644 --- a/tests/phpunit/CRM/Upgrade/Incremental/php/FiveTwentyTest.php +++ b/tests/phpunit/CRM/Upgrade/Incremental/php/FiveTwentyTest.php @@ -919,8 +919,8 @@ private function getExpectedUpgradeMessages() { /** * Helper to add a case type to the database. * - * @param $name string - * @param $xml string + * @param string $name + * @param string $xml * * @return int */ diff --git a/tests/phpunit/CiviTest/ReleaseTestSettings.php.txt b/tests/phpunit/CiviTest/ReleaseTestSettings.php.txt index a977b49eb2d7..78fde75653f4 100644 --- a/tests/phpunit/CiviTest/ReleaseTestSettings.php.txt +++ b/tests/phpunit/CiviTest/ReleaseTestSettings.php.txt @@ -2,34 +2,32 @@ class ReleaseTestSettings { - var $publicSandbox = false; - var $browser = '*firefox'; - var $sandboxURL = 'http://url.url'; - var $sandboxPATH = ''; - var $installPATH = '/sites/trunk.drupal/modules/civicrm/install/'; - var $upgradePATH = '/civicrm/upgrade?reset=1'; - var $username = ''; - var $password = ''; - var $adminUsername = ''; - var $adminPassword = ''; - var $UFemail = 'noreply@civicrm.org'; + public $publicSandbox = FALSE; + public $browser = '*firefox'; + public $sandboxURL = 'http://url.url'; + public $sandboxPATH = ''; + public $installPATH = '/sites/trunk.drupal/modules/civicrm/install/'; + public $upgradePATH = '/civicrm/upgrade?reset=1'; + public $username = ''; + public $password = ''; + public $adminUsername = ''; + public $adminPassword = ''; + public $UFemail = 'noreply@civicrm.org'; - var $civiDBServer = 'localhost'; - var $civiDBUser = ''; - var $civiDBPass = ''; - var $civiDBName = ''; + public $civiDBServer = 'localhost'; + public $civiDBUser = ''; + public $civiDBPass = ''; + public $civiDBName = ''; - var $drupalDBServer = 'localhost'; - var $drupalDBUser = ''; - var $drupalDBPass = ''; - var $drupalDBName = ''; + public $drupalDBServer = 'localhost'; + public $drupalDBUser = ''; + public $drupalDBPass = ''; + public $drupalDBName = ''; - - function __construct() { + public function __construct() { $this->fullSandboxPath = $this->sandboxURL . $this->sandboxPATH; $this->installURL = $this->fullSandboxPath . $this->installPATH; $this->upgradeURL = $this->fullSandboxPath . $this->upgradePATH; } } -?> diff --git a/tools/bin/scripts/set-version.php b/tools/bin/scripts/set-version.php index 153e2af57617..ceec68eaa53c 100755 --- a/tools/bin/scripts/set-version.php +++ b/tools/bin/scripts/set-version.php @@ -25,9 +25,12 @@ fatal("failed to read old version from \"xml/version.xml\"\n"); } -/** @var string $newVersion */ -/** @var bool $doCommit */ -/** @var bool $doSql */ +/** + * @var string $newVersion */ +/** + * @var bool $doCommit */ +/** + * @var bool $doSql */ extract(parseArgs($argv)); if (!isVersionValid($newVersion)) { @@ -80,7 +83,7 @@ foreach ($infoXmls as $infoXml) { updateXmlFile($infoXml, function (DOMDocument $dom) use ($newVersion) { foreach ($dom->getElementsByTagName('version') as $tag) { - /** @var \DOMNode $tag */ + /* @var \DOMNode $tag */ $tag->textContent = $newVersion; } }); @@ -188,10 +191,10 @@ function fatal($error) { } /** -* @param array $argv + * @param array $argv * Ex: ['myscript.php', '--no-commit', '5.6.7'] * @return array - * Ex: ['scriptFile' => 'myscript.php', 'doCommit' => FALSE, 'newVersion' => '5.6.7'] + * Ex: ['scriptFile' => 'myscript.php', 'doCommit' => FALSE, 'newVersion' => '5.6.7'] */ function parseArgs($argv) { $parsed = [];