src/DependencyInjection/LazyEventSubscriberServiceProvider.php 1 location
|
@@ 75-81 (lines=7) @@
|
| 72 |
|
{ |
| 73 |
|
$eventDispatcher = $container[$this->eventDispatcherServiceName]; |
| 74 |
|
|
| 75 |
|
if (!$eventDispatcher instanceof EventDispatcherInterface) { |
| 76 |
|
throw new \InvalidArgumentException(sprintf( |
| 77 |
|
'Container service "%s" is "%s" and not exptected instance of "EventDispatcherInterface"', |
| 78 |
|
$this->eventDispatcherServiceName, |
| 79 |
|
\is_object($eventDispatcher) ? \get_class($eventDispatcher) : \gettype($eventDispatcher) |
| 80 |
|
)); |
| 81 |
|
} |
| 82 |
|
|
| 83 |
|
return $eventDispatcher; |
| 84 |
|
} |
src/Factory/LazyServiceFactory.php 1 location
|
@@ 41-47 (lines=7) @@
|
| 38 |
|
$initializer = null; |
| 39 |
|
|
| 40 |
|
// extra defensive programming in action |
| 41 |
|
if (!$wrappedObject instanceof $className) { |
| 42 |
|
throw new \InvalidArgumentException(sprintf( |
| 43 |
|
'Object "%s" is not instance of "%s"', |
| 44 |
|
\is_object($wrappedObject) ? \get_class($wrappedObject) : \gettype($wrappedObject), |
| 45 |
|
$className |
| 46 |
|
)); |
| 47 |
|
} |
| 48 |
|
|
| 49 |
|
return true; |
| 50 |
|
} |