Skip to content

🎨 phpstan level 8 - #82

Merged
garak merged 1 commit into
p-chess:masterfrom
garak:phpstan8
May 11, 2026
Merged

🎨 phpstan level 8#82
garak merged 1 commit into
p-chess:masterfrom
garak:phpstan8

Conversation

@garak

@garak garak commented May 8, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings May 8, 2026 07:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.php to 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.

Comment thread src/Chess.php Outdated
Comment thread src/Chess.php Outdated
Comment thread src/Chess.php
Comment thread src/Chess.php
Comment thread src/Chess.php Outdated
Comment thread src/Chess.php
Comment thread src/Chess.php Outdated
Comment thread src/Output/ImagineOutput.php Outdated
@garak
garak merged commit afd8f5f into p-chess:master May 11, 2026
5 checks passed
@garak
garak deleted the phpstan8 branch May 11, 2026 16:48
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