You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: UPGRADE-4.3.md
+29Lines changed: 29 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,35 @@ EventDispatcher
55
55
---------------
56
56
57
57
* The signature of the `EventDispatcherInterface::dispatch()` method should be updated to `dispatch($event, string $eventName = null)`, not doing so is deprecated
58
+
59
+
You have to swap arguments when calling `dispatch()`:
If your bundle or package needs to provide compatibility with the previous way of using the dispatcher, you can use `Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy::decorate()` to ease upgrades:
72
+
73
+
Before:
74
+
```php
75
+
public function __construct(EventDispatcherInterface $eventDispatcher) {
76
+
$this->eventDispatcher = $eventDispatcher;
77
+
}
78
+
```
79
+
80
+
After:
81
+
```php
82
+
public function __construct(EventDispatcherInterface $eventDispatcher) {
0 commit comments