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

Lint:container fails on prod with event name from parameter #37166

Copy link
Copy link
Closed
@alexander-schranz

Description

@alexander-schranz
Issue body actions

Symfony version(s) affected: 5.1.0 (not sure if also appear on 5.0)

Description

Lint:container fails on prod with event name from parameter.

How to reproduce

# config/services.yaml
parameters:
    test_event: 'test_event'

services:
    App\EventListener\MyListener:
        tags:
            - { name: kernel.event_listener, event: '%test_event%' }
<?php

namespace App\EventListener;

use Symfony\Contracts\EventDispatcher\Event;

class MyListener
{
    public function onEvent(Event $test)
    {
        return $test;
    }
}

bin/console lint:container --env prod
[ERROR] Invalid definition for service "event_dispatcher": argument 1 of
"Symfony\Component\EventDispatcher\EventDispatcher::addListener" accepts "string", "array" passed.

Possible Solution

Not sure why it fails with this and why it only fails on prod and not on dev

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.