Skip to content

[HttpKernel] Document #[ValueResolver] and #[AsTargetedValueResolver] #17763

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

Merged

Conversation

MatTheCat
Copy link
Contributor

@MatTheCat MatTheCat commented Jan 17, 2023

@MatTheCat MatTheCat force-pushed the specified-resolver-value-resolver branch from 3fdf670 to 111234e Compare January 17, 2023 16:37
@xabbuh xabbuh added the Waiting Code Merge Docs for features pending to be merged label Jan 20, 2023
@carsonbot carsonbot changed the title [HttpKernel] Add #[ValueResolver] for specifying a controller argument resolver Add #[ValueResolver] for specifying a controller argument resolver Jan 20, 2023
@carsonbot carsonbot added this to the next milestone Jan 20, 2023
@MatTheCat MatTheCat force-pushed the specified-resolver-value-resolver branch from 111234e to e99a654 Compare January 27, 2023 09:15
@MatTheCat MatTheCat marked this pull request as ready for review January 27, 2023 09:16
@carsonbot carsonbot modified the milestones: next, 6.3 Jan 27, 2023
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add some doc about AsPinnedResolver now :)

@MatTheCat MatTheCat force-pushed the specified-resolver-value-resolver branch from e99a654 to f06d106 Compare February 27, 2023 09:29
@MatTheCat
Copy link
Contributor Author

Working on it. I think I’ll start over because the landscape changed quite a bit..!

@MatTheCat MatTheCat force-pushed the specified-resolver-value-resolver branch from f06d106 to 0127836 Compare February 28, 2023 10:18
@MatTheCat MatTheCat marked this pull request as draft February 28, 2023 10:18
@MatTheCat MatTheCat force-pushed the specified-resolver-value-resolver branch from 0127836 to 9884404 Compare March 3, 2023 11:36
@carsonbot carsonbot changed the title Add #[ValueResolver] for specifying a controller argument resolver [HttpKernel] Add #[ValueResolver] for specifying a controller argument resolver Mar 3, 2023
nicolas-grekas added a commit to symfony/symfony that referenced this pull request Mar 6, 2023
…#[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
-------

245485c [HttpKernel] Introduce pinnable value resolvers with `#[ValueResolver]` and `#[AsPinnedValueResolver]`
symfony-splitter pushed a commit to symfony/doctrine-bridge that referenced this pull request Mar 6, 2023
…#[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]`
symfony-splitter pushed a commit to symfony/security-bundle that referenced this pull request Mar 6, 2023
…#[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]`
symfony-splitter pushed a commit to symfony/framework-bundle that referenced this pull request Mar 6, 2023
…#[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]`
symfony-splitter pushed a commit to symfony/http-kernel that referenced this pull request Mar 6, 2023
…#[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]`
@OskarStark OskarStark removed the Waiting Code Merge Docs for features pending to be merged label Mar 8, 2023
@OskarStark
Copy link
Contributor

Code PR is merged, can you please remove the draft status and double check if it's fine? Thanks

@MatTheCat MatTheCat force-pushed the specified-resolver-value-resolver branch 2 times, most recently from d77cddf to 73f48d6 Compare March 13, 2023 13:43
@MatTheCat MatTheCat force-pushed the specified-resolver-value-resolver branch from 73f48d6 to 7ef71b3 Compare March 22, 2023 17:37
@MatTheCat MatTheCat force-pushed the specified-resolver-value-resolver branch from 7ef71b3 to b721ee4 Compare April 21, 2023 08:22
MatTheCat added a commit to MatTheCat/symfony-docs that referenced this pull request Apr 21, 2023
MatTheCat added a commit to MatTheCat/symfony-docs that referenced this pull request May 24, 2023
@MatTheCat MatTheCat force-pushed the specified-resolver-value-resolver branch from fa8e76b to 0e7c950 Compare May 24, 2023 16:09
@MatTheCat
Copy link
Contributor Author

symfony/symfony#50458 changed some things.

@MatTheCat MatTheCat marked this pull request as draft May 30, 2023 20:15
@MatTheCat MatTheCat force-pushed the specified-resolver-value-resolver branch from 0e7c950 to 9849ba2 Compare June 4, 2023 09:12
@MatTheCat MatTheCat marked this pull request as ready for review June 4, 2023 09:12
@MatTheCat MatTheCat force-pushed the specified-resolver-value-resolver branch from 9849ba2 to 6da43f6 Compare June 4, 2023 09:13
@MatTheCat
Copy link
Contributor Author

Thanks for the reviews everyone 🙏 I updated and tried to simplify the documentation.

@MatTheCat MatTheCat force-pushed the specified-resolver-value-resolver branch from 6da43f6 to ac13dfc Compare June 4, 2023 09:17
@javiereguiluz javiereguiluz merged commit 05f7d41 into symfony:6.3 Jun 15, 2023
@MatTheCat MatTheCat deleted the specified-resolver-value-resolver branch June 15, 2023 15:37
@javiereguiluz
Copy link
Member

This was finally merged! Thanks a lot Mathieu and thanks to reviewers too!

symfony-splitter pushed a commit to symfony/framework-bundle that referenced this pull request Jul 28, 2023
…#[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]`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants