Skip to content

Commit

Permalink
fix: Expression should go through Grammar::getValue (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
taka-oyama committed Feb 24, 2023
1 parent 78c5caa commit 12ab08f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# v4.6.1 (Not released yet)
# v4.7.0 (Not released yet)

Chore
- Removed `ramsey/uuid` from composer.json since laravel already includes it.

Fixed
- Expressions given as $value in `Schema\Grammar::formatDefaultValue` will now go through `getValue` to match upstream (No behavioral change).

# v4.6.0

Fixed
Expand Down
6 changes: 6 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
parameters:
ignoreErrors:
-
message: "#^Cannot cast mixed to string\\.$#"
count: 1
path: src/Schema/Grammar.php
2 changes: 2 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
includes:
- phpstan-baseline.neon
parameters:
level: max
checkMissingIterableValueType: false
Expand Down
2 changes: 1 addition & 1 deletion src/Schema/Grammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ protected function modifyDefault(Blueprint $blueprint, Fluent $column)
protected function formatDefaultValue(Fluent $column, string $type, mixed $value): string
{
if ($value instanceof Expression) {
return (string)$value;
return (string) $this->getValue($value);
}

// Match type without length or subtype.
Expand Down

0 comments on commit 12ab08f

Please sign in to comment.