10000 [Routing] Convert backed enums to their value when generating default routes by florentdestremau · Pull Request #49206 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Routing] Convert backed enums to their value when generating default routes #49206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Convert backed enums to their value when generating default routes
  • Loading branch information
florentdestremau committed Feb 2, 2023
commit 62c60f374a4722a8fbd0bbe1378d0186f1fb3271
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,9 @@ public static function export(mixed $value): string
}
if (!\is_array($value)) {
if (\is_object($value)) {
if ($value instanceof \BackedEnum) {
return "'$value->value'";
}
throw new \InvalidArgumentException('Symfony\Component\Routing\Route cannot contain objects.');
}

Expand Down
0