minor #14866 Updated UPGRADE-2.4.md (mickaelandrieu)
This PR was submitted for the 2.8 branch but it was merged into the 2.6 branch instead (closes #14866).
Discussion
----------
Updated UPGRADE-2.4.md
| Q | A
| ------------- | ---
| Bug fix? | [no]
| New feature? | [no]
| BC breaks? | [no]
| Deprecations? | [yes ?]
| Tests pass? | [yes]
| Fixed tickets |
| License | MIT
| Doc PR |
A missing deprecation in the upgrade guide.
Commits
-------
b631a56
Updated UPGRADE-2.4.md
This commit is contained in:
commit
6fcdcb509a
@ -7,3 +7,44 @@ Form
|
|||||||
* The constructor parameter `$precision` in `IntegerToLocalizedStringTransformer`
|
* The constructor parameter `$precision` in `IntegerToLocalizedStringTransformer`
|
||||||
is now ignored completely, because a precision does not make sense for
|
is now ignored completely, because a precision does not make sense for
|
||||||
integers.
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
Reference in New Issue
Block a user