Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Allow to define a specific controller value resolver #48927

Copy link
Copy link
Closed
@marforon

Description

@marforon
Issue body actions

Description

As part of the recent bug, I would like to propose a new feature to specify a specific controller value resolver which should be forced instead of iterating the whole stack of value resolvers.

I have multiple reasons for this:

  1. bad performance architecture - each value resolver might be iterated until the first is used. I understand it's simple to use, but we don't have to break the current system, we can just add a possibility to skip the iteration
  2. we shouldn't embrace a priority system for third-party bundles - a bundle "A" might setup its value resolver to some priority, but a bundle "B" might setup the same priority, there is no way to predict all cases to not create some type of collision, each bundle should be able to define a specific value resolver and be sure it will be always used
  3. Sensio Extra Bundle had this ability to specify a converter which was always used instead of priority

Example

public function __invoke(Request $request, #[ValueResolver(EntityValueResolver::class)] Entity $entity): Response
{
...
}

or for a different resolver:

public function __invoke(Request $request, #[ValueResolver(SerializerValueResolver::class)] Entity $entity): Response
{
...
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.