Skip to content

Commit da68437

Browse files
committed
Add PSR2.Methods.FunctionCallSignature
1 parent bf9e48f commit da68437

9 files changed

+53
-358
lines changed

PSR2R/Sniffs/Commenting/DocBlockParamSniff.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,11 @@ private function getMethodSignature(File $phpCsFile, $stackPtr) {
156156
$possibleEqualIndex = $phpCsFile->findNext([T_EQUAL], $nextVariableIndex + 1, $nextVariableIndex + 2);
157157
if ($possibleEqualIndex) {
158158
$possibleDefaultValue =
159-
$phpCsFile->findNext([T_STRING, T_TRUE, T_FALSE, T_NULL, T_ARRAY], $possibleEqualIndex + 1,
160-
$possibleEqualIndex + 2);
159+
$phpCsFile->findNext(
160+
[T_STRING, T_TRUE, T_FALSE, T_NULL, T_ARRAY],
161+
$possibleEqualIndex + 1,
162+
$possibleEqualIndex + 2,
163+
);
161164
if ($possibleDefaultValue) {
162165
$default = $possibleDefaultValue;
163166
}

PSR2R/Sniffs/Commenting/DocBlockVarWithoutNameSniff.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,11 @@ public function process(File $phpcsFile, $stackPtr) {
6565
preg_match_all('/ \$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/', $content, $matches);
6666

6767
if (isset($matches[0][0]) && trim($matches[0][0]) !== '$this') {
68-
$fix = $phpcsFile->addFixableError('@var annotations should not contain the variable name.', $i,
69-
'RemoveVarName');
68+
$fix = $phpcsFile->addFixableError(
69+
'@var annotations should not contain the variable name.',
70+
$i,
71+
'RemoveVarName',
72+
);
7073
if ($fix) {
7174
$phpcsFile->fixer->replaceToken($nextIndex, str_replace($matches[0][0], '', $content));
7275
}

PSR2R/Sniffs/ControlStructures/ConditionalExpressionOrderSniff.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ public function process(File $phpCsFile, $stackPointer): void {
7171
$rightIndexStart = $phpCsFile->findNext(Tokens::$emptyTokens, $stackPointer + 1, null, true);
7272

7373
if ($this->isGivenKind(T_OPEN_PARENTHESIS, $tokens[$prevIndex])) {
74-
$rightIndexEnd =
75-
$phpCsFile->findPrevious(
74+
$rightIndexEnd = $phpCsFile->findPrevious(
7675
Tokens::$emptyTokens,
7776
$tokens[$prevIndex]['parenthesis_closer'] - 1,
7877
null,

PSR2R/Sniffs/ControlStructures/SwitchDeclarationSniff.php

Lines changed: 0 additions & 226 deletions
This file was deleted.

PSR2R/Sniffs/Namespaces/UnusedUseStatementSniff.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,13 @@ public function process(File $phpcsFile, $stackPtr) {
5656
return;
5757
}
5858

59-
$classUsed = $phpcsFile->findNext([T_STRING, T_RETURN_TYPE], $classNameIndex + 1, null, false,
60-
$tokens[$classNameIndex]['content']);
59+
$classUsed = $phpcsFile->findNext(
60+
[T_STRING, T_RETURN_TYPE],
61+
$classNameIndex + 1,
62+
null,
63+
false,
64+
$tokens[$classNameIndex]['content'],
65+
);
6166

6267
while ($classUsed !== false) {
6368
$beforeUsage = $phpcsFile->findPrevious(
@@ -77,8 +82,13 @@ public function process(File $phpcsFile, $stackPtr) {
7782
return;
7883
}
7984

80-
$classUsed = $phpcsFile->findNext([T_STRING, T_RETURN_TYPE], $classUsed + 1, null, false,
81-
$tokens[$classNameIndex]['content']);
85+
$classUsed = $phpcsFile->findNext(
86+
[T_STRING, T_RETURN_TYPE],
87+
$classUsed + 1,
88+
null,
89+
false,
90+
$tokens[$classNameIndex]['content'],
91+
);
8292
}
8393

8494
$warning = 'Unused use statement';

0 commit comments

Comments
 (0)