Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 07edfe6

Browse files
feature #48992 [HttpKernel] Introduce pinnable value resolvers with #[ValueResolver] and #[AsPinnedValueResolver] (MatTheCat)
This PR was merged into the 6.3 branch. Discussion ---------- [HttpKernel] Introduce pinnable value resolvers with `#[ValueResolver]` and `#[AsPinnedValueResolver]` | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #48927 | License | MIT | Doc PR | symfony/symfony-docs#17763 Introducing a new `ValueResolver` attribute, which allows to - “pin” a value resolver to an argument, meaning only said resolver will be called - prevent a resolver to be called for an argument Every existing resolver-related attribute (`MapEntity`, `CurrentUser`…) now extends `ValueResolver`. Each `controller.argument_value_resolver` tag is added a `name` attribute, which is the resolver’s FQCN. This is the first argument `ValueResolver` expects. A new `AsPinnedValueResolver` attribute is added for autoconfiguration, adding the `controller.pinned_value_resolver` tag. Such resolvers can only be “pinned”, meaning they won’t ever be called for an argument missing the `ValueResolver` attribute. Commits ------- 245485c2a7 [HttpKernel] Introduce pinnable value resolvers with `#[ValueResolver]` and `#[AsPinnedValueResolver]`
2 parents 4a05f49 + fe3acdf commit 07edfe6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Resources/config/security.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
->args([
101101
service('security.token_storage'),
102102
])
103-
->tag('controller.argument_value_resolver', ['priority' => 120])
103+
->tag('controller.argument_value_resolver', ['priority' => 120, 'name' => UserValueResolver::class])
104104

105105
// Authentication related services
106106
->set('security.authentication.trust_resolver', AuthenticationTrustResolver::class)

0 commit comments

Comments
 (0)