Skip to content

Commit 05c68eb

Browse files
committed
Minor tweaks
1 parent 1f02f93 commit 05c68eb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

controller/argument_value_resolver.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ Symfony ships with the following value resolvers in the
6161

6262
class CardController
6363
{
64-
#[Route(
65-
'/cards/{suit}',
66-
requirements: [
67-
'suit' => new EnumRequirement(Suit::class, Suit::Diamonds, Suit::Spades),
68-
],
69-
)]
64+
#[Route('/cards/{suit}', requirements: [
65+
// this allows all values defined in the Enum
66+
'suit' => new EnumRequirement(Suit::class),
67+
// this restricts the possible values to the Enum values listed here
68+
'suit' => new EnumRequirement([Suit::class, Suit::Diamonds, Suit::Spades]),
69+
])]
7070
public function list(Suit $suit): Response
7171
{
7272
// ...

0 commit comments

Comments
 (0)