-
-
Notifications
You must be signed in to change notification settings - Fork 11
feat: correct eloquent types #191
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
base: main
Are you sure you want to change the base?
Conversation
4abc5b4
to
adc21fb
Compare
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 pull request corrects and improves Eloquent types throughout the codebase by adding comprehensive type annotations for the database layer, collection classes, and relationship definitions. The primary goal is to enhance type safety and improve IDE support for Eloquent models and their relationships.
- Adds generic type annotations for Eloquent models, builders, collections, and relationships
- Implements proper type safety for query operations and relationship methods
- Updates PHPStan configuration to support new type checking requirements
Reviewed Changes
Copilot reviewed 42 out of 42 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
types/* | New type test files verifying Eloquent model, builder, and relationship type annotations |
src/core/src/Database/Eloquent/* | Enhanced Eloquent classes with comprehensive generic type annotations |
src/support/src/* | Updated support classes with proper generic type templates |
phpstan.neon.dist | Updated PHPStan configuration and version requirement |
composer.json | Upgraded PHPStan dependency to version 2.0 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
@@ -19,7 +19,7 @@ abstract class DataObject implements ArrayAccess, JsonSerializable | |||
/** | |||
* Property map cache (class name => [snake_case key => camelCase property]). | |||
* | |||
* @var array<string,string>> | |||
* @var array<string,string> |
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.
[nitpick] The type annotation is missing a space after the comma for consistency. It should be @var array<string, string>
to follow standard PHPDoc formatting conventions.
* @var array<string,string> | |
* @var array<string, string> |
Copilot uses AI. Check for mistakes.
@@ -9,8 +9,7 @@ | |||
class ListenerData extends BaseListenerData | |||
{ | |||
/** | |||
* @phpstan-ignore-next-line | |||
* @var array|callable|string | |||
* @var callable(): mixed |
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.
The type annotation callable(): mixed
is overly restrictive. Based on the comment that was removed, this property can accept array|callable|string
, so the type should be @var array|callable|string
to accurately reflect the possible values.
* @var callable(): mixed | |
* @var array|callable|string |
Copilot uses AI. Check for mistakes.
No description provided.