Skip to content

Commit

Permalink
add early assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Oct 6, 2024
1 parent 13e3271 commit c375d5f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/SqlFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public function format(string $string, string $indentString = ' '): string
};
$decreaseIndentationLevelFx = static function () use (&$return, &$indentTypes, $tab, &$indentLevel): void {
array_pop($indentTypes);
assert($indentLevel > 0);

Check failure on line 81 in src/SqlFormatter.php

View workflow job for this annotation

GitHub Actions / Static Analysis / PHPStan (8.3)

Call to function assert() with false will always evaluate to false.

Check failure on line 81 in src/SqlFormatter.php

View workflow job for this annotation

GitHub Actions / Static Analysis / PHPStan (8.3)

Comparison operation ">" between 0 and 0 is always false.
$indentLevel--;

// Redo the indentation since it may be different now
Expand Down

0 comments on commit c375d5f

Please sign in to comment.