Skip to content

Commit

Permalink
Fix crash on invalid token
Browse files Browse the repository at this point in the history
  • Loading branch information
theseer committed Apr 29, 2024
1 parent dd14846 commit abb83aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

# Release 1.29.1
* Fix crash on generating error message for invalid token

## Release 1.29.0
* Merge PR [#105](https://github.com/theseer/Autoload/pull/105): Return exit code from CLI::run(), rather than exiting [martin-rueegg]

Expand Down
2 changes: 1 addition & 1 deletion src/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ private function processClass($pos) {
default: {
throw new ParserException(sprintf(
'Parse error while trying to process class definition (unexpected token "%s" in name).',
\token_name($tok[0])
is_int($tok[0]) ? \token_name($tok[0]) : $tok[0]
), ParserException::ParseError
);
}
Expand Down

0 comments on commit abb83aa

Please sign in to comment.