Skip to content

lint:container doesn't handle definitions containing Symfony\Component\ExpressionLanguage\Expression correctly #34752

@pfazzi

Description

@pfazzi

Symfony version(s) affected: 4.4.1

Description
In Sylius there is this service definition:

<service id="sylius.controller.payum" class="Sylius\Bundle\PayumBundle\Controller\PayumController" public="true">
	<argument type="service" id="payum" />
	<argument type="service" id="sylius.repository.order" />
	<argument type="expression">service('sylius.resource_registry').get('sylius.order')</argument>
	<argument type="service" id="sylius.resource_controller.request_configuration_factory" />
	<argument type="service" id="sylius.resource_controller.view_handler" />
	<argument type="service" id="router" />
	<argument type="service" id="sylius.factory.payum_get_status_action" />
	<argument type="service" id="sylius.factory.payum_resolve_next_route" />
</service>

The 3rd argument is the result of an expression that returns a service. Anyway the linter consider it an invalid definition for service. I get the folowing error:

Invalid definition for service "sylius.controller.payum": argument 3 of "Sylius\Bundle\PayumBundle\Controller\PayumController::__construct" accepts "Sylius\Component\Resource\Metadata\MetadataInterface", "Symfony\Component\ExpressionLanguage\Expression" passed.     

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