Skip to content

Latest commit

 

History

History
50 lines (38 loc) · 1.18 KB

UPGRADE-2.4.md

File metadata and controls

50 lines (38 loc) · 1.18 KB

UPGRADE FROM 2.3 to 2.4

Form

  • The constructor parameter $precision in IntegerToLocalizedStringTransformer is now ignored completely, because a precision does not make sense for integers.

EventDispatcher

  • The getDispatcher() and getName() methods from Symfony\Component\EventDispatcher\Event are deprecated, the event dispatcher instance and event name can be received in the listener call instead.

    Before:

    use Symfony\Component\EventDispatcher\Event;
    
    class Foo
    {
        public function myFooListener(Event $event)
        {
            $dispatcher = $event->getDispatcher();
            $eventName = $event->getName();
            $dispatcher->dispatch('log', $event);
    
            // ... more code
       }
    }

    After:

    use Symfony\Component\EventDispatcher\Event;
    use Symfony\Component\EventDispatcher\EventDispatcherInterface;
    
    class Foo
    {
        public function myFooListener(Event $event, $eventName, EventDispatcherInterface $dispatcher)
        {
            $dispatcher->dispatch('log', $event);
    
            // ... more code
        }
    }