You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature symfony#58717 [HttpKernel] Support Uid in #[MapQueryParameter] (seb-jean)
This PR was squashed before being merged into the 7.3 branch.
Discussion
----------
[HttpKernel] Support `Uid` in `#[MapQueryParameter]`
| Q | A
| ------------- | ---
| Branch? | 7.3
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Issues | Fixsymfony#51618
| License | MIT
I added support `Uid` in `#[MapQueryParameter]`. To use it, you must do this:
```php
#[Route(path: '/', name: 'user_show')]
public function indexAction(
#[MapQueryParameter] ?Ulid $groupId = null,
)
```
Commits
-------
9fd614a [HttpKernel] Support `Uid` in `#[MapQueryParameter]`
default => match ($enumType = is_subclass_of($type, \BackedEnum::class) ? (new \ReflectionEnum($type))->getBackingType()->getName() : null) {
84
92
'int' => \FILTER_VALIDATE_INT,
85
93
'string' => \FILTER_DEFAULT,
86
-
default => thrownew \LogicException(\sprintf('#[MapQueryParameter] cannot be used on controller argument "%s$%s" of type "%s"; one of array, string, int, float, bool or \BackedEnum should be used.', $argument->isVariadic() ? '...' : '', $argument->getName(), $type ?? 'mixed')),
94
+
default => thrownew \LogicException(\sprintf('#[MapQueryParameter] cannot be used on controller argument "%s$%s" of type "%s"; one of array, string, int, float, bool, uid or \BackedEnum should be used.', $argument->isVariadic() ? '...' : '', $argument->getName(), $type ?? 'mixed')),
87
95
},
88
96
};
89
97
@@ -105,6 +113,10 @@ public function resolve(Request $request, ArgumentMetadata $argument): array
'#[MapQueryParameter] cannot be used on controller argument "$standardClass" of type "stdClass"; one of array, string, int, float, bool or \BackedEnum should be used.',
255
+
'#[MapQueryParameter] cannot be used on controller argument "$standardClass" of type "stdClass"; one of array, string, int, float, bool, uid or \BackedEnum should be used.',
'#[MapQueryParameter] cannot be used on controller argument "...$standardClass" of type "stdClass"; one of array, string, int, float, bool or \BackedEnum should be used.',
261
+
'#[MapQueryParameter] cannot be used on controller argument "...$standardClass" of type "stdClass"; one of array, string, int, float, bool, uid or \BackedEnum should be used.',
0 commit comments