Skip to content

Support @> as a shorthand for !service_closure in YamlFileLoader #59255

Closed
@chx

Description

@chx

Description

!service_closure '@foo' is quite long winded.

@?foo is already supported so why not @> as well? It resembles fn () => so it's easy to remember.

Example

Implementing this as simple as

            if ('service_closure' === $value->getTag() || (\is_string($argument) && str_starts_with($argument, '@>'))) {
                if (is_string($argument)) {
                    $argument = str_replace('@>', '@', $argument);
                }
                $argument = $this->resolveServices($argument, $file, $isParameter);

                return new ServiceClosureArgument($argument);
            }

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