Closed taka-oyama closed 5 months ago
This update addresses a PHPStan error in Laravel's Blueprint
class when using the Spanner SQL's STRING(MAX)
definition in migrations. An error was generated due to the method expecting an int|null
for the $length
parameter but receiving int|string|null
. The method signature of string()
was updated to accept int|string|null
, reconciling the discrepancy and preventing PHPStan errors. Additionally, the changelog reflects the update in version 8.1.2, including the signature change of updateOrInsert
.
Files | Change Summary |
---|---|
phpstan.neon | Added a new error message related to a parameter type mismatch in method string() . |
src/Schema/Blueprint.php | Updated method signature for string() to accept int|string|null for the $length parameter. |
CHANGELOG.md | Added entries that fix a PHPStan error and update the signature of updateOrInsert in v8.1.2. |
Objective | Addressed | Explanation |
---|---|---|
Fix PHPStan error when string('column', 'MAX') is used (#218) |
✅ | |
Ensure compatibility with Spanner's nonstandard STRING(MAX) column |
✅ |
Through lines of code and logic fine, We fixed the bugs that did malign, Error’s gone, the code now flows, In migrations, bliss bestows.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Instead of using stub, it may be better to use ignore. However, since this is a trivial matter, I will submit a separate PR for this later.
Fix: #218
Checklist
Reference
Summary by CodeRabbit
string()
method of theBlueprint
class.updateOrInsert
in version 8.1.2 for enhanced compatibility.