Optimized the PHPDoc for `hyperf/database`. by storyn26383 · Pull Request #7511 · hyperf/hyperf
Pull Request Overview
This PR aims to improve the type annotations in the Hyperf database component by adding comprehensive PHPDoc type hints and creating extensive type tests. The changes enhance static analysis capabilities and provide better IDE support for developers working with the database ORM.
- Improved PHPDoc type annotations throughout database component classes for better static analysis
- Added comprehensive type test files to verify type correctness and coverage
- Enhanced generic type support for Model relationships, Collections, and Builders
Reviewed Changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/scout/src/SearchableScope.php | Added PHPStan ignore comment for type issue |
| src/database/tests/types/ | Added comprehensive type test files for Query Builder, Model relations, Collections, and other components |
| src/database/src/ | Updated PHPDoc annotations with generic types and improved return type specifications |
| phpstan.types.neon.dist | Added PHPStan configuration for type testing |
| composer.json | Added new script for running type analysis |
| CHANGELOG-3.1.md | Documented the PHPDoc optimization |
| .travis/run.check.sh | Added type analysis to CI checks |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.