Skip to content

PHPStan level max#17

Merged
spaze merged 3 commits intomainfrom
spaze/phpstan
Aug 22, 2025
Merged

PHPStan level max#17
spaze merged 3 commits intomainfrom
spaze/phpstan

Conversation

@spaze
Copy link
Owner

@spaze spaze commented Aug 22, 2025

Also more precise array types and require nette/database 3.2.4

spaze added 3 commits August 22, 2025 19:15
Older nette/database (pre 3.2.4) used never return type for __get and in that case PHPStan returns "Call to function is_int() with never will always evaluate to true."
@spaze spaze requested a review from Copilot August 22, 2025 17:59
@spaze spaze self-assigned this Aug 22, 2025
@spaze spaze merged commit 95f7c46 into main Aug 22, 2025
12 checks passed
@spaze spaze deleted the spaze/phpstan branch August 22, 2025 17:59
Copy link

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 pull request upgrades PHPStan analysis to the maximum level and adds type safety improvements. The changes focus on adding runtime type checking for database column values and improving array type annotations for better static analysis.

  • Upgraded PHPStan from level 8 to level max for stricter static analysis
  • Added runtime type validation for database columns with custom exception handling
  • Improved array type annotations to be more precise about key-value relationships

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/MysqlSessionHandler.php Enhanced type safety with runtime checks and improved array type annotations
src/Exceptions/SessionColumnUnexpectedTypeException.php New exception class for handling unexpected database column types
phpstan.neon Upgraded PHPStan analysis level from 8 to max
composer.json Updated nette/database minimum version requirement to 3.2.4

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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.

1 participant