1 | <?php |
||
10 | class LazyEventSubscriberServiceProvider implements ServiceProviderInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var LazyServiceFactory |
||
14 | */ |
||
15 | protected $lazyServiceFactory; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $eventDispatcherServiceName; |
||
21 | |||
22 | /** |
||
23 | * @var string[] |
||
24 | */ |
||
25 | protected $eventSubscriberServiceNames; |
||
26 | |||
27 | /** |
||
28 | * @param LazyServiceFactory $lazyServiceFactory |
||
29 | * @param string $eventDispatcherServiceName |
||
30 | * @param string[] $eventSubscriberServiceNames |
||
31 | */ |
||
32 | 3 | public function __construct( |
|
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | 3 | public function register(Container $container) |
|
63 | |||
64 | /** |
||
65 | * @param Container $container |
||
66 | * |
||
67 | * @throws \InvalidArgumentException When container cannot instantiate EventDispatcher object |
||
68 | * |
||
69 | * @return EventDispatcherInterface |
||
70 | */ |
||
71 | 3 | protected function getEventDispatcher(Container $container): EventDispatcherInterface |
|
84 | } |
||
85 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: