8000 fix: Handle enum as values · symfony/maker-bundle@5b28174 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5b28174

Browse files
Geekimojrushlow
authored andcommitted
fix: Handle enum as values
1 parent 090f40b commit 5b28174

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Util/ClassSourceManipulator.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,13 @@ private function quoteAnnotationValue($value)
512512
throw new \Exception('Invalid value: loop before quoting.');
513513
}
514514

515+
if (\PHP_VERSION_ID >= 80000) {
516+
// do we have an enum ?
517+
if (is_object($value) && enum_exists(get_class($value))) {
518+
$value = $value->value;
519+
}
520+
}
521+
515522
return sprintf('"%s"', $value);
516523
}
517524

0 commit comments

Comments
 (0)
0