fix: resolve PHP 8.4 compatibility issues and validation errors#9
Merged
CAFernandes merged 1 commit intomainfrom Jul 6, 2025
Merged
fix: resolve PHP 8.4 compatibility issues and validation errors#9CAFernandes merged 1 commit intomainfrom
CAFernandes merged 1 commit intomainfrom
Conversation
- Fix PHP 8.4 deprecation warnings in tests (ReflectionProperty::setValue) - Fix PHPStan type error for exception handler in Application.php - Fix PSR-12 code style violations across multiple files - Add null parameter to setValue() calls for static properties - Wrap set_exception_handler callback to match expected signature All validation tests now passing: PHPUnit (237 tests), PHPStan (level 9), PSR-12 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR resolves PHP 8.4 compatibility issues (adding required null parameters, updating error handler signatures), fixes PHPStan errors, enforces PSR-12 style, and enhances request/response handling.
- Added
nullargument to allReflectionProperty::setValue()calls in tests - Introduced dynamic request attributes via
AttributeInterfaceand new magic methods - Enhanced
Responseemission control (disableAutoEmit,emit(),isSent(),resetSentState()) - Configured early error handling in
Applicationand wrapped exception handlers
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Services/OpenApiExporterTest.php | Added null for static setValue calls |
| tests/Http/RequestAttributesTest.php | New tests for dynamic request attributes |
| tests/Controller/RouterTest.php | Updated reflection setValue(null, ...) usage |
| src/Providers/LoggingServiceProvider.php | Qualified Logger instantiation with full namespace |
| src/Http/Response.php | Added auto-emit control, new emit(), disableAutoEmit(), etc. |
| src/Http/Request.php | Implements AttributeInterface, new magic attribute methods |
| src/Http/Contracts/AttributeInterface.php | New interface for dynamic attributes |
| src/Core/Application.php | Setup basic error handling early, wrapped exception handler |
| scripts/validate_all.sh | Bumped version strings to v2.1.3 |
| examples/app/index.php | Added minimal example application |
| config/app.php | Refined default debug setting logic |
| benchmarks/reports/*.md | Updated benchmark timestamps and results |
Comments suppressed due to low confidence (2)
src/Http/Response.php:624
- There are no unit tests covering the new
disableAutoEmit,emit(),isSent(), andresetSentState()methods. Please add tests to verify emission behavior under both enabled and disabled auto-emit modes, and ensureisSent()andresetSentState()work as expected.
public function disableAutoEmit(bool $disable = true): self
src/Http/Response.php:648
- The property
isStreamingis referenced but not defined inResponse, which will trigger an undefined property error. Consider declaring a privatebool $isStreamingor adjusting the condition to avoid accessing an undeclared variable.
if ($this->sent && !$this->isStreaming) {
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.
All validation tests now passing: PHPUnit (237 tests), PHPStan (level 9), PSR-12
🤖 Generated with Claude Code
Pull Request Template
📋 Descrição
Descreva resumidamente as mudanças feitas neste PR.
🎯 Tipo de Mudança
🧪 Como foi testado?
Descreva os testes que você executou para verificar suas mudanças.
📝 Checklist