Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Oct 3, 2023
1 parent 4eda8ba commit 8325f08
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Schema/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ public static function getCastStrategy(string $type): \Closure
} elseif (method_exists($type, '__construct')) {
return static function ($value) use ($type) {
return is_array($value)
? new ($type)(...$value)
: new ($type)($value);
? (new \ReflectionClass($type))->newInstanceArgs($value)
: new $type($value);
};
} else {
return static function ($value) use ($type) {
Expand Down

0 comments on commit 8325f08

Please sign in to comment.