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
This PR was merged into the 3.3-dev branch.
Discussion
----------
[EventDispatcher] Deprecate ContainerAwareEventDispatcher
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | no
| Fixed tickets | -
| License | MIT
| Doc PR | -
These methods shouldn't be available to end users.
Commits
-------
c4a6a8a [EventDispatcher] Deprecate ContainerAwareEventDispatcher
if ($thisinstanceof \PHPUnit_Framework_MockObject_MockObject || $thisinstanceof \Prophecy\Doubler\DoubleInterface) {
60
+
$class = get_parent_class($class);
61
+
}
62
+
if (__CLASS__ !== $class) {
63
+
@trigger_error(sprintf('The %s class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure-proxy injection instead.', __CLASS__), E_USER_DEPRECATED);
64
+
}
55
65
}
56
66
57
67
/**
@@ -68,6 +78,8 @@ public function __construct(ContainerInterface $container)
@trigger_error(sprintf('The %s class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure-proxy injection instead.', __CLASS__), E_USER_DEPRECATED);
82
+
71
83
if (!is_array($callback) || 2 !== count($callback)) {
72
84
thrownew \InvalidArgumentException('Expected an array("service", "method") argument');
73
85
}
@@ -148,6 +160,8 @@ public function getListenerPriority($eventName, $listener)
@trigger_error(sprintf('The %s class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure-proxy injection instead.', __CLASS__), E_USER_DEPRECATED);
@@ -163,6 +177,8 @@ public function addSubscriberService($serviceId, $class)
163
177
164
178
publicfunctiongetContainer()
165
179
{
180
+
@trigger_error('The '.__METHOD__.'() method is deprecated since version 3.3 as its class will be removed in 4.0. Inject the container or the services you need in your listeners/subscribers instead.', E_USER_DEPRECATED);
0 commit comments