Server : Apache System : Linux profile 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64 User : apache ( 48) PHP Version : 8.0.28 Disable Function : NONE Directory : /usr/share/doc/php-symfony-common-2.8.52/ |
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:
```php
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:
```php
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
}
}
```