diff --git a/src/Support/Arrayable.php b/src/Support/Arrayable.php index e32e05d..da2c6d9 100644 --- a/src/Support/Arrayable.php +++ b/src/Support/Arrayable.php @@ -4,7 +4,6 @@ use ReflectionClass; use ReflectionProperty; -use TgWebValid\Make\Make; abstract class Arrayable { @@ -26,10 +25,9 @@ public function toArray(?object $object = null): array foreach ($properties as $property) { $name = $property->getName(); $value = $object->$name ?? null; - $result[$name] = match(true) { - $value instanceof Make => $this->toArray($value), - default => $value - }; + $result[$name] = $value instanceof self + ? $this->toArray($value) + : $value; } return $result;