-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
PHPORM-150 Run CI on Laravel 11 #2735
Conversation
Static analysis found a breaking change in
|
…method signature in Laravel 11 laravel/framework@8647dcf
@@ -704,7 +708,7 @@ protected function addCastAttributesToArray(array $attributes, array $mutatedAtt | |||
} | |||
|
|||
if ($this->isEnumCastable($key) && (! $castValue instanceof Arrayable)) { | |||
$castValue = $castValue !== null ? $this->getStorableEnumValue($castValue) : null; |
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 signature of this method have changed in a non-backward compatible way. So I duplicated this simple method to keep compatibility with both Laravel 10 and 11.
laravel/framework@8647dcf#diff-59d24f1a8f0dd1e51ee7dffc8778133711634e928ecef4a91b63fc3851cb1579R1188
We must keep the function addCastAttributesToArray
introduced for Laravel 10 compatibility, as it provides casting of nested fields. 2ea1a7c#diff-284e164f76aeb13f424d154f9208d91fdbb0112b0a50ad8b1dfa237176f03cf2R525-R530
@@ -614,11 +614,7 @@ public function orderBy($column, $direction = 'asc') | |||
return $this; | |||
} | |||
|
|||
/** | |||
* @param list{mixed, mixed}|CarbonPeriod $values |
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.
This signature was causing psalm error. Param type incompatible with the parent method.
# Laravel 11 | ||
- php: "8.3" | ||
mongodb: "7.0" | ||
mode: "dev" |
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.
Once Laravel 11 will be released, this will no longer be necessary. But only low-deps
job will run Laravel 10.
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.
Looks good, I have a minor nit but considering the build passes it's not too relevant.
* 4.2: PHPORM-139 Implement `Model::createOrFirst()` using `findOneAndUpdate` operation (#2742) Test Laravel 10 and 11 (#2746) PHPORM-150 Run CI on Laravel 11 (#2735) PHPORM-152 Fix tests for Carbon 3 (#2733)
Fix PHPORM-150
Checklist