symfony-cmf / Routing

Routing component building on the Symfony Routing component
Other
289 stars 70 forks source link

User Deprecated: Since symfony/event-dispatcher 5.1: Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy is deprecated, use the event dispatcher without the proxy. #263

Closed Kolbasyatin closed 3 years ago

Kolbasyatin commented 3 years ago

Subject

This commit wraps EventDispatcher in LegacyEventDispatcherProxy against deprecation message in symfony 4.3 version

https://github.com/symfony-cmf/Routing/commit/bb7c30331cac0e2d6259bc96453064e0677c2296

        if (class_exists(LegacyEventDispatcherProxy::class)) {
            $this->eventDispatcher = LegacyEventDispatcherProxy::decorate($eventDispatcher);
        }

But there's another deprecation (see subj) in symfony 5.2 version and that wrapper do nothing except showing new deprecation message

 * @deprecated since Symfony 5.1
 */
final class LegacyEventDispatcherProxy
{
    public static function decorate(?EventDispatcherInterface $dispatcher): ?EventDispatcherInterface
    {
        return $dispatcher;
    }
}

Is there a way to fix this problem for 5.2 symfony version and don't break supressing for 4.3 version ?

dbu commented 3 years ago

hm, do we still need the legacy thing or could we change the code to the new event dispatcher? we only support symfony 4.4 and higher, so that might be an option. do you have time to look into it?

Kolbasyatin commented 3 years ago

@dbu I haven't 4.3 or 4.4 version, but if we choose wich version has a deprecation message, I'd be choose 4 :)) I'm going to create PR :)

dbu commented 3 years ago

fixed in #254