Skip to content

Commit

Permalink
play defensive
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus authored and Wirone committed Jan 9, 2024
1 parent 695eace commit 70483fb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Tokenizer/Tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,12 @@ public function clearEmptyTokens(): void
}
}

// should already be true
if (!$this->changed) {
// must never happen
throw new \LogicException('Unexpected non-changed collection with _EMPTY_ Tokens. Fix the code!');
}

// we are moving the tokens, we need to clear the index-based Cache
$this->namespaceDeclarations = null;
$this->blockStartCache = [];
Expand Down

0 comments on commit 70483fb

Please sign in to comment.