🎨 phpstan level 8 - #82
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request raises the PHPStan strictness to level 8 and applies code changes across the chess engine and output renderers to satisfy the tighter static analysis requirements.
Changes:
- Bump PHPStan configuration from level 7 to level 8 and update dev tooling versions in
composer.json. - Add null-guards/assertions to output rendering loops and coordinate rendering helpers.
- Adjust core engine code in
Chess.phpto address nullable types in move handling, attack detection, castling, and repetition logic.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Output/UnicodeOutput.php | Adds a null key guard during board iteration for PHPStan. |
| src/Output/AsciiOutput.php | Adds a null key guard during board iteration for PHPStan. |
| src/Output/SvgOutput.php | Skips iteration when board key is null (and when piece is null). |
| src/Output/ImagineOutput.php | Adds null guards/assertions; changes board drawing and piece placement iteration. |
| src/Entry.php | Tightens phpdoc for castling array type. |
| src/Chess.php | Introduces nullable-handling changes in promotions/captures, history indexing, castling generation, attacked(), repetition detection, and SAN generation. |
| phpstan.neon | Increases PHPStan level to 8. |
| composer.json | Updates dev dependency constraints (phpstan, cs-fixer, phpbench, etc.). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.