Skip to content

Commit

Permalink
make sure formatted value is string
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Dec 29, 2023
1 parent 4bff9cf commit 4162e53
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Fields/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ public function format(?Closure $callback = null): static
/**
* Format the value.
*/
public function resolveFormat(Request $request, Model $model): mixed
public function resolveFormat(Request $request, Model $model): ?string
{
$value = $this->resolveValue($request, $model);

Expand Down
2 changes: 1 addition & 1 deletion src/Fields/Relation.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ public function getValue(Model $model): mixed
/**
* {@inheritdoc}
*/
public function resolveFormat(Request $request, Model $model): mixed
public function resolveFormat(Request $request, Model $model): ?string
{
if (is_null($this->formatResolver)) {
$this->formatResolver = function (Request $request, Model $model): mixed {
Expand Down
2 changes: 1 addition & 1 deletion src/Fields/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function size(int $value): static
/**
* {@inheritdoc}
*/
public function resolveFormat(Request $request, Model $model): mixed
public function resolveFormat(Request $request, Model $model): ?string
{
if (is_null($this->formatResolver)) {
$this->formatResolver = function (Request $request, Model $model, mixed $value): string {
Expand Down
2 changes: 1 addition & 1 deletion src/Fields/URL.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function text(Closure|string $value): static
/**
* {@inheritdoc}
*/
public function resolveFormat(Request $request, Model $model): mixed
public function resolveFormat(Request $request, Model $model): ?string
{
if (is_null($this->formatResolver)) {
$this->formatResolver = function (Request $request, Model $model, mixed $value): ?string {
Expand Down

0 comments on commit 4162e53

Please sign in to comment.