Skip to content

Commit 03fa1f7

Browse files
authored
Merge pull request #1251 from PHPCSStandards/feature/assorted-minor-fixes
Assorted minor fixes
2 parents ef429fb + 69eab3f commit 03fa1f7

File tree

7 files changed

+5
-14
lines changed

7 files changed

+5
-14
lines changed

src/Reports/Junit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function generate(
115115
$tests = 0;
116116
$matches = [];
117117
preg_match_all('/tests="([0-9]+)"/', $cachedData, $matches);
118-
if (isset($matches[1]) === true) {
118+
if (empty($matches[1]) === false) {
119119
foreach ($matches[1] as $match) {
120120
$tests += $match;
121121
}

src/Standards/Generic/Sniffs/ControlStructures/DisallowYodaConditionsSniff.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,7 @@ public function process(File $phpcsFile, $stackPtr)
110110
if ($prev === false) {
111111
return;
112112
}
113-
} else if ($tokens[$beforeOpeningParenthesisIndex]['code'] === T_ARRAY
114-
&& $this->isArrayStatic($phpcsFile, $beforeOpeningParenthesisIndex) === false
115-
) {
113+
} else if ($this->isArrayStatic($phpcsFile, $beforeOpeningParenthesisIndex) === false) {
116114
return;
117115
}//end if
118116
}//end if

src/Standards/PEAR/Sniffs/Formatting/MultiLineAssignmentSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function process(File $phpcsFile, $stackPtr)
6262
}
6363

6464
// Make sure it is the first thing on the line, otherwise we ignore it.
65-
$prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), false, true);
65+
$prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true);
6666
if ($prev === false) {
6767
// Bad assignment.
6868
return;

src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ public function process(File $phpcsFile, $stackPtr)
6666

6767
if (isset($tokens[$stackPtr]['parenthesis_opener']) === false
6868
|| isset($tokens[$stackPtr]['parenthesis_closer']) === false
69-
|| $tokens[$stackPtr]['parenthesis_opener'] === null
70-
|| $tokens[$stackPtr]['parenthesis_closer'] === null
7169
) {
7270
return;
7371
}

src/Standards/PSR12/Sniffs/Functions/ReturnTypeDeclarationSniff.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ public function process(File $phpcsFile, $stackPtr)
4747

4848
if (isset($tokens[$stackPtr]['parenthesis_opener']) === false
4949
|| isset($tokens[$stackPtr]['parenthesis_closer']) === false
50-
|| $tokens[$stackPtr]['parenthesis_opener'] === null
51-
|| $tokens[$stackPtr]['parenthesis_closer'] === null
5250
) {
5351
return;
5452
}

src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,8 @@ public function processMemberVar(File $phpcsFile, $stackPtr)
6868
break;
6969
}
7070

71-
if ($commentEnd === false
72-
|| ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG
73-
&& $tokens[$commentEnd]['code'] !== T_COMMENT)
71+
if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG
72+
&& $tokens[$commentEnd]['code'] !== T_COMMENT
7473
) {
7574
$phpcsFile->addError('Missing member variable doc comment', $stackPtr, 'Missing');
7675
return;

src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ public function process(File $phpcsFile, $stackPtr)
7070

7171
if (isset($tokens[$stackPtr]['parenthesis_opener']) === false
7272
|| isset($tokens[$stackPtr]['parenthesis_closer']) === false
73-
|| $tokens[$stackPtr]['parenthesis_opener'] === null
74-
|| $tokens[$stackPtr]['parenthesis_closer'] === null
7573
) {
7674
return;
7775
}

0 commit comments

Comments
 (0)