Conversation
There was a problem hiding this comment.
Pull request overview
This PR wires PHPStan into the project’s tooling/CI, raises the minimum supported PHP version to 7.4, and updates dev tooling dependencies to align with the new baseline.
Changes:
- Add PHPStan configuration and run it as part of
make test. - Bump minimum PHP requirement from 7.1 to 7.4 across docs/Composer/CI.
- Adjust PHPUnit dev dependency constraints to versions compatible with the new minimum PHP.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/DotNotationParser.php |
Adds type hints for iterator keys and adjusts ParseException indexing logic. |
README.md |
Updates documented PHP minimum version to 7.4. |
phpstan.neon |
Introduces PHPStan config (max level, analyze src). |
Makefile |
Adds a phpstan target and runs it during make test. |
composer.json |
Raises PHP constraint to >=7.4, updates PHPUnit constraint, adds PHPStan dev dependency. |
.github/workflows/ci.yml |
Removes PHP 7.1–7.3 from the CI test matrix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -107,7 +110,7 @@ private function scanQuotedString( \Iterator $chars ) : string { | |||
|
|
|||
| throw new ParseException( | |||
| sprintf('failed to parse path, expected . or EOF, got "%s" at %d', $next, $key), | |||
There was a problem hiding this comment.
The ParseException message reports the unexpected character as occurring at $key (the closing quote position), but the exception index being passed is $nextKey (the position of the unexpected character after the quote). This mismatch makes debugging harder; use the same position (preferably $nextKey) consistently in both the message and the $charIndex argument.
| sprintf('failed to parse path, expected . or EOF, got "%s" at %d', $next, $key), | |
| sprintf('failed to parse path, expected . or EOF, got "%s" at %d', $next, $nextKey ?? $key ?? ($lastKey + 1)), |
Uh oh!
There was an error while loading. Please reload this page.