From 29689500d689efb3c556c057aaacf45450fe480a Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 14 Feb 2020 01:50:40 +0100 Subject: [PATCH] Helper::areAnyConditionsAClosure(): remove unused method Can't find any use of this method anywhere in the code base anymore, so it may as well be removed. --- VariableAnalysis/Lib/Helpers.php | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/VariableAnalysis/Lib/Helpers.php b/VariableAnalysis/Lib/Helpers.php index 97e05389..47330fc3 100644 --- a/VariableAnalysis/Lib/Helpers.php +++ b/VariableAnalysis/Lib/Helpers.php @@ -76,25 +76,6 @@ public static function findParenthesisOwner(File $phpcsFile, $stackPtr) { return self::getIntOrNull($phpcsFile->findPrevious(Tokens::$emptyTokens, $stackPtr - 1, null, true)); } - /** - * @param File $phpcsFile - * @param (int|string)[] $conditions - * - * @return bool - */ - public static function areAnyConditionsAClosure(File $phpcsFile, array $conditions) { - // self within a closure is invalid - $tokens = $phpcsFile->getTokens(); - foreach (array_reverse($conditions, true) as $scopePtr => $scopeCode) { - // Note: have to fetch code from $tokens, T_CLOSURE isn't set for conditions codes. - if ($tokens[$scopePtr]['code'] === T_CLOSURE) { - return true; - } - } - return false; - } - - /** * @param (int|string)[] $conditions *