Skip to content

Commit

Permalink
Avoid unguarded use of enum_exists (zircote#1486)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerManoMann authored Oct 12, 2023
1 parent ab49d25 commit df8de8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Processors/ExpandEnums.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected function expandSchemaEnum(Analysis $analysis): void

// transform each Enum cases into UnitEnum
foreach ($schema->enum as $enum) {
if (is_string($enum) && enum_exists($enum)) {
if (is_string($enum) && function_exists('enum_exists') && enum_exists($enum)) {
foreach ($enum::cases() as $case) {
$cases[] = $case;
}
Expand Down

0 comments on commit df8de8e

Please sign in to comment.