Skip to content

Commit

Permalink
More phpcbs code cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Jan 18, 2022
1 parent 023c0e1 commit 28a98d7
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion install/langs.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@
'tr_TR' => 'Turkish',
'uk_UA' => 'Ukrainian',
'vi_VN' => 'Vietnamese',
);
);
3 changes: 1 addition & 2 deletions tests/phpunit/CRM/Campaign/BAO/CampaignTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* @package CRM
* @copyright CiviCRM LLC https://civicrm.org/licensing
*/

class CRM_Campaign_BAO_CampaignTest extends CiviUnitTestCase {

public function testCampaignSummary() {
Expand All @@ -39,4 +38,4 @@ public function testCampaignSummary() {
$this->assertEquals(1, CRM_Campaign_BAO_Campaign::getCampaignSummary(['status_id' => [2, 3]], TRUE));
}

}
}
8 changes: 4 additions & 4 deletions tests/phpunit/CRM/Case/XMLProcessor/ProcessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Case/XMLProcessor/ReportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Mailing/BAO/MailingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/CRM/Upgrade/Incremental/php/FiveTwentyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
42 changes: 20 additions & 22 deletions tests/phpunit/CiviTest/ReleaseTestSettings.php.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
?>
15 changes: 9 additions & 6 deletions tools/bin/scripts/set-version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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;
}
});
Expand Down Expand Up @@ -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 = [];
Expand Down

0 comments on commit 28a98d7

Please sign in to comment.