Skip to content

Wire up phpstan#15

Open
donatj wants to merge 3 commits intomasterfrom
phpstan
Open

Wire up phpstan#15
donatj wants to merge 3 commits intomasterfrom
phpstan

Conversation

@donatj
Copy link
Copy Markdown
Member

@donatj donatj commented Apr 3, 2026

  • Wires up PHPStan.
  • Sets the minimum version of PHP to 7.4
  • Update phpunit to a safe version

@donatj donatj marked this pull request as ready for review April 3, 2026 09:52
Copilot AI review requested due to automatic review settings April 3, 2026 09:52
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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),
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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)),

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants