Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Commit

Permalink
fix stan
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Jun 8, 2024
1 parent a5e8287 commit b0dfd1a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Tokenizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,10 @@ private function makeRegexFromList(array $values, bool $sorted = false): string

$regex .= preg_quote($prefix, '/');

if (count($items) === 1) {
assert(reset($items) !== false);

Check failure on line 840 in src/Tokenizer.php

View workflow job for this annotation

GitHub Actions / Coding Standards (7.4)

Function assert() should not be referenced via a fallback global name, but via a use statement.
}

$regex .= count($items) === 1
? preg_quote(substr(reset($items), strlen($prefix)), '/')
: $this->makeRegexFromList(array_map(static fn ($v) => substr($v, strlen($prefix)), $items), true);
Expand Down

0 comments on commit b0dfd1a

Please sign in to comment.