Skip to content

Commit

Permalink
Fix Psalm
Browse files Browse the repository at this point in the history
  • Loading branch information
samdark committed Jan 16, 2023
1 parent 65cd835 commit 18c6c14
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ClosureExporter.php
Expand Up @@ -70,6 +70,7 @@ public function export(Closure $closure, int $level = 0): string
$closureTokens = [];
$pendingParenthesisCount = 0;

/** @var int<1, max> $i */
foreach ($tokens as $i => $token) {
if (in_array($token[0], [T_FUNCTION, T_FN, T_STATIC], true)) {
$closureTokens[] = $token[1];
Expand Down Expand Up @@ -113,7 +114,7 @@ public function export(Closure $closure, int $level = 0): string
if ($pendingParenthesisCount === 0) {
break;
}
$pendingParenthesisCount--;
--$pendingParenthesisCount;
} elseif ($token === ',' || $token === ';') {
if ($pendingParenthesisCount === 0) {
break;
Expand Down

0 comments on commit 18c6c14

Please sign in to comment.