diff --git a/src/Transformers/EnumTransformer.php b/src/Transformers/EnumTransformer.php index abd6598..1872ad5 100644 --- a/src/Transformers/EnumTransformer.php +++ b/src/Transformers/EnumTransformer.php @@ -31,6 +31,10 @@ public function transform(ReflectionClass $class, string $name): ?TransformedTyp return null; } + if (empty($enum->getCases())) { + return null; + } + return $this->config->shouldTransformToNativeEnums() ? $this->toEnum($enum, $name) : $this->toType($enum, $name);