Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fab2s committed Apr 22, 2024
1 parent d005c47 commit ef45b98
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Casts/Dt0Cast.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function __construct(string $enumClass, ...$options)
*/
public function get($model, string $key, $value, array $attributes): ?Dt0
{
return $this->getDt0($model, $key, $value);
return $this->resolve($model, $key, $value);
}

/**
Expand All @@ -60,15 +60,15 @@ public function get($model, string $key, $value, array $attributes): ?Dt0
*/
public function set($model, string $key, $value, array $attributes): ?string
{
return $this->getDt0($model, $key, $value)?->toJson();
return $this->resolve($model, $key, $value)?->toJson();
}

/**
* @throws Dt0Exception
* @throws NotNullableException
* @throws JsonException
*/
protected function getDt0(Model $model, string $key, mixed $value): ?Dt0
protected function resolve(Model $model, string $key, mixed $value): ?Dt0
{
if ($value === null) {
return $this->isNullable ? null : throw NotNullableException::make($key, $model);
Expand Down

0 comments on commit ef45b98

Please sign in to comment.