Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b631a56

Browse filesBrowse files
mickaelandrieufabpot
authored andcommitted
Updated UPGRADE-2.4.md
1 parent 97050dc commit b631a56
Copy full SHA for b631a56

File tree

Expand file treeCollapse file tree

1 file changed

+41
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+41
-0
lines changed

‎UPGRADE-2.4.md

Copy file name to clipboardExpand all lines: UPGRADE-2.4.md
+41Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,44 @@ Form
77
* The constructor parameter `$precision` in `IntegerToLocalizedStringTransformer`
88
is now ignored completely, because a precision does not make sense for
99
integers.
10+
11+
EventDispatcher
12+
----------------
13+
14+
* The `getDispatcher()` and `getName()` methods from `Symfony\Component\EventDispatcher\Event`
15+
are deprecated, the event dispatcher instance and event name can be received in the listener call instead.
16+
17+
Before:
18+
19+
```php
20+
use Symfony\Component\EventDispatcher\Event;
21+
22+
class Foo
23+
{
24+
public function myFooListener(Event $event)
25+
{
26+
$dispatcher = $event->getDispatcher();
27+
$eventName = $event->getName();
28+
$dispatcher->dispatch('log', $event);
29+
30+
// ... more code
31+
}
32+
}
33+
```
34+
35+
After:
36+
37+
```php
38+
use Symfony\Component\EventDispatcher\Event;
39+
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
40+
41+
class Foo
42+
{
43+
public function myFooListener(Event $event, $eventName, EventDispatcherInterface $dispatcher)
44+
{
45+
$dispatcher->dispatch('log', $event);
46+
47+
// ... more code
48+
}
49+
}
50+
```

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.