Skip to content

Commit 2a1bf60

Browse files
jrfnlsirbrillig
authored andcommitted
Helper::areAnyConditionsAClosure(): remove unused method (#142)
Can't find any use of this method anywhere in the code base anymore, so it may as well be removed.
1 parent f62b88e commit 2a1bf60

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

VariableAnalysis/Lib/Helpers.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -76,25 +76,6 @@ public static function findParenthesisOwner(File $phpcsFile, $stackPtr) {
7676
return self::getIntOrNull($phpcsFile->findPrevious(Tokens::$emptyTokens, $stackPtr - 1, null, true));
7777
}
7878

79-
/**
80-
* @param File $phpcsFile
81-
* @param (int|string)[] $conditions
82-
*
83-
* @return bool
84-
*/
85-
public static function areAnyConditionsAClosure(File $phpcsFile, array $conditions) {
86-
// self within a closure is invalid
87-
$tokens = $phpcsFile->getTokens();
88-
foreach (array_reverse($conditions, true) as $scopePtr => $scopeCode) {
89-
// Note: have to fetch code from $tokens, T_CLOSURE isn't set for conditions codes.
90-
if ($tokens[$scopePtr]['code'] === T_CLOSURE) {
91-
return true;
92-
}
93-
}
94-
return false;
95-
}
96-
97-
9879
/**
9980
* @param (int|string)[] $conditions
10081
*

0 commit comments

Comments
 (0)