5
5
use PHP_CodeSniffer \Files \File ;
6
6
7
7
class Helpers {
8
- public static function findContainingOpeningBracket (File $ phpcsFile , int $ stackPtr ) {
8
+ public static function findContainingOpeningBracket (File $ phpcsFile , $ stackPtr ) {
9
9
$ tokens = $ phpcsFile ->getTokens ();
10
10
if (isset ($ tokens [$ stackPtr ]['nested_parenthesis ' ])) {
11
11
$ openPtrs = array_keys ($ tokens [$ stackPtr ]['nested_parenthesis ' ]);
@@ -14,7 +14,7 @@ public static function findContainingOpeningBracket(File $phpcsFile, int $stackP
14
14
return false ;
15
15
}
16
16
17
- public static function findParenthesisOwner (File $ phpcsFile , int $ stackPtr ) {
17
+ public static function findParenthesisOwner (File $ phpcsFile , $ stackPtr ) {
18
18
$ tokens = $ phpcsFile ->getTokens ();
19
19
return $ phpcsFile ->findPrevious (T_WHITESPACE , $ stackPtr - 1 , null , true );
20
20
}
@@ -40,7 +40,7 @@ public static function areAnyConditionsAClass(array $conditions) {
40
40
return false ;
41
41
}
42
42
43
- public static function findPreviousFunctionPtr (File $ phpcsFile , int $ openPtr ) {
43
+ public static function findPreviousFunctionPtr (File $ phpcsFile , $ openPtr ) {
44
44
// Function names are T_STRING, and return-by-reference is T_BITWISE_AND,
45
45
// so we look backwards from the opening bracket for the first thing that
46
46
// isn't a function name, reference sigil or whitespace and check if it's a
@@ -49,7 +49,7 @@ public static function findPreviousFunctionPtr(File $phpcsFile, int $openPtr) {
49
49
return $ phpcsFile ->findPrevious ($ functionPtrTypes , $ openPtr - 1 , null , true , null , true );
50
50
}
51
51
52
- public static function findFunctionCall (File $ phpcsFile , int $ stackPtr ) {
52
+ public static function findFunctionCall (File $ phpcsFile , $ stackPtr ) {
53
53
$ tokens = $ phpcsFile ->getTokens ();
54
54
55
55
$ openPtr = Helpers::findContainingOpeningBracket ($ phpcsFile , $ stackPtr );
@@ -103,7 +103,7 @@ public static function findFunctionCallArguments(File $phpcsFile, $stackPtr) {
103
103
return $ argPtrs ;
104
104
}
105
105
106
- public static function findWhereAssignExecuted (File $ phpcsFile , int $ stackPtr ) {
106
+ public static function findWhereAssignExecuted (File $ phpcsFile , $ stackPtr ) {
107
107
$ tokens = $ phpcsFile ->getTokens ();
108
108
109
109
// Write should be recorded at the next statement to ensure we treat the
@@ -132,7 +132,7 @@ public static function findWhereAssignExecuted(File $phpcsFile, int $stackPtr) {
132
132
return $ assignEndTokens [0 ];
133
133
}
134
134
135
- public static function isNextThingAnAssign (File $ phpcsFile , int $ stackPtr ) {
135
+ public static function isNextThingAnAssign (File $ phpcsFile , $ stackPtr ) {
136
136
$ tokens = $ phpcsFile ->getTokens ();
137
137
138
138
// Is the next non-whitespace an assignment?
@@ -149,7 +149,7 @@ public static function normalizeVarName($varName) {
149
149
return preg_replace ('/[{}$]/ ' , '' , $ varName );
150
150
}
151
151
152
- public static function findFunctionPrototype (File $ phpcsFile , int $ stackPtr ) {
152
+ public static function findFunctionPrototype (File $ phpcsFile , $ stackPtr ) {
153
153
$ tokens = $ phpcsFile ->getTokens ();
154
154
$ token = $ tokens [$ stackPtr ];
155
155
@@ -164,7 +164,7 @@ public static function findFunctionPrototype(File $phpcsFile, int $stackPtr) {
164
164
return false ;
165
165
}
166
166
167
- public static function findVariableScope (File $ phpcsFile , int $ stackPtr ) {
167
+ public static function findVariableScope (File $ phpcsFile , $ stackPtr ) {
168
168
$ tokens = $ phpcsFile ->getTokens ();
169
169
$ token = $ tokens [$ stackPtr ];
170
170
0 commit comments