Skip to content

Commit 4a04976

Browse files
committed
Merge branch 'master' into 4.x
2 parents 642ccb2 + 03fa1f7 commit 4a04976

File tree

8 files changed

+7
-16
lines changed

8 files changed

+7
-16
lines changed

src/Files/File.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class File
159159
*
160160
* @var array<string, int>
161161
*/
162-
private $firstRunCounts;
162+
private $firstRunCounts = [];
163163

164164
/**
165165
* The current total number of errors that can be fixed.
@@ -542,7 +542,7 @@ public function process()
542542
StatusWriter::write('*** END SNIFF PROCESSING REPORT ***', 1);
543543
}
544544

545-
if (isset($this->firstRunCounts) === false) {
545+
if (empty($this->firstRunCounts) === true) {
546546
$this->firstRunCounts = [
547547
'error' => $this->errorCount,
548548
'warning' => $this->warningCount,

src/Reports/Junit.php

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

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

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

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

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

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

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

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

5656
if (isset($tokens[$stackPtr]['parenthesis_opener']) === false
5757
|| isset($tokens[$stackPtr]['parenthesis_closer']) === false
58-
|| $tokens[$stackPtr]['parenthesis_opener'] === null
59-
|| $tokens[$stackPtr]['parenthesis_closer'] === null
6058
) {
6159
return;
6260
}

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

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

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

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,8 @@ public function processMemberVar(File $phpcsFile, int $stackPtr)
7777
break;
7878
}
7979

80-
if ($commentEnd === false
81-
|| ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG
82-
&& $tokens[$commentEnd]['code'] !== T_COMMENT)
80+
if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG
81+
&& $tokens[$commentEnd]['code'] !== T_COMMENT
8382
) {
8483
$phpcsFile->addError('Missing member variable doc comment', $stackPtr, 'Missing');
8584
return;

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

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

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

0 commit comments

Comments
 (0)