Skip to content

Commit 193b5b5

Browse files
authored
Merge pull request #1 from Carnicero90/Carnicero90-patch-1-1
fix: prevent writing docblock on Enums that don't use the LaravelEnum…
2 parents 4a2acb0 + e77f802 commit 193b5b5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Commands/EnumAnnotateCommand.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,12 @@ protected function annotateClass(string $className): int
8484
}
8585

8686
$reflection = new ReflectionEnum($className);
87-
$this->annotate($reflection);
87+
88+
if ($reflection->isSubclassOf(UnitEnum::class)) {
89+
if (class_uses_recursive($class)['Datomatic\LaravelEnumHelper\LaravelEnumHelper'] ?? false) {
90+
$this->annotate($reflection);
91+
}
92+
}
8893

8994
return self::SUCCESS;
9095
}

0 commit comments

Comments
 (0)