Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
imanghafoori1 committed Dec 16, 2023
2 parents 2692762 + 74b1790 commit 8b60ae8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Iterators/ChecksOnPsr4Classes.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,23 @@ private static function applyChecksInPath($psr4Path, $includeFile, $includeFolde
$filesCount++;
$tokens = token_get_all(file_get_contents($absFilePath));

$params1 = self::getParams($params, $tokens, $absFilePath, $psr4Path, $psr4Namespace);
$processedParams = self::getParams($params, $tokens, $absFilePath, $psr4Path, $psr4Namespace);
foreach ($checks as $check) {
$newTokens = self::applyCheck($check, $tokens, $absFilePath, $params1, $phpFilePath, $psr4Path, $psr4Namespace);
$newTokens = self::applyCheck($check, $tokens, $absFilePath, $processedParams, $phpFilePath, $psr4Path, $psr4Namespace);
if ($newTokens) {
$tokens = $newTokens;
$params1 = self::getParams($params, $tokens, $absFilePath, $psr4Path, $psr4Namespace);
$processedParams = self::getParams($params, $tokens, $absFilePath, $psr4Path, $psr4Namespace);
}
}
}

return $filesCount;
}

private static function applyCheck($check, $tokens, $absFilePath, $params1, $phpFilePath, $psr4Path, $psr4Namespace)
private static function applyCheck($check, $tokens, $absFilePath, $processedParams, $phpFilePath, $psr4Path, $psr4Namespace)
{
try {
return $check::check($tokens, $absFilePath, $params1, $phpFilePath, $psr4Path, $psr4Namespace);
return $check::check($tokens, $absFilePath, $processedParams, $phpFilePath, $psr4Path, $psr4Namespace);
} catch (Throwable $exception) {
self::$exceptions[] = $exception;
}
Expand Down

0 comments on commit 8b60ae8

Please sign in to comment.