-
Notifications
You must be signed in to change notification settings - Fork 6
Issue #415: Increased PHPStan level to 8
#421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: alexmerlin <[email protected]>
Signed-off-by: alexmerlin <[email protected]>
Signed-off-by: alexmerlin <[email protected]>
Signed-off-by: alexmerlin <[email protected]>
There was a problem hiding this 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 increases the PHPStan analysis level to 8 and enhances type annotations and PHPDoc comments across exception classes, config providers, and service interfaces while also adding minor input sanitation improvements.
- Increase PHPStan level in phpstan.neon
- Update PHPDoc types (using non-empty-string, non-empty-array, etc.) in exception classes, service interfaces, and config providers
- Introduce input trimming in AdminCreateCommand for more robust input handling
Reviewed Changes
Copilot reviewed 103 out of 103 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/App/src/Exception/SunsetException.php | Updated to extend Exception and implement ProblemDetailsExceptionInterface, including a new create() method with a status set to STATUS_UNAUTHORIZED |
| src/App/src/Exception/RuntimeException.php | Added PHPDoc documentation for the create() method |
| src/App/src/Exception/*.php | Similar PHPDoc type enhancements applied to various exception classes |
| src/App/src/ConfigProvider.php | Added detailed PHPStan type annotations for collections and dependencies |
| src/App/src/Attribute/BaseDeprecation.php | Updated to use the new factory method for throwing SunsetException |
| src/Admin/src/Service/* | Adjusted PHPDoc types for input arrays on service interfaces and implementations |
| src/Admin/src/Handler/* | Updated input filtering to assign a trimmed data array before passing to service methods |
| src/Admin/src/ConfigProvider.php | Enhanced PHPStan type documentation for Hal metadata and dependencies |
| src/Admin/src/Command/AdminCreateCommand.php | Added the trim() function for input options and improved PHPDoc for expected data structure |
| phpstan.neon | Increased analysis level from 5 to 8 |
Comments suppressed due to low confidence (1)
src/App/src/Exception/SunsetException.php:26
- Consider verifying that using STATUS_UNAUTHORIZED is appropriate for a sunset exception. Typically, sunset or deprecation semantics might be better reflected by a status such as 410 (Gone) to more accurately indicate that the resource is no longer available.
$exception->status = StatusCodeInterface::STATUS_UNAUTHORIZED;
No description provided.