Closed
Description
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