芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/tixpeual2124.gob.mx/libraries/vendor/joomla/event/src/LazyServiceEventListener.php
container = $container; $this->serviceId = $serviceId; $this->method = $method; } /** * Load a service from the container to listen to an event. * * @param EventInterface $event The event to process * * @return void * * @since 2.0.0 * @throws \InvalidArgumentException if the constructor's $method parameter is empty when not executing a callable service * @throws \RuntimeException if the service cannot be executed */ public function __invoke(EventInterface $event): void { if (!$this->container->has($this->serviceId)) { throw new \RuntimeException( sprintf( 'The "%s" service has not been registered to the service container', $this->serviceId ) ); } $service = $this->container->get($this->serviceId); // If the service is callable on its own, just execute it if (\is_callable($service)) { \call_user_func($service, $event); return; } if (empty($this->method)) { throw new \InvalidArgumentException( sprintf( 'The $method argument is required when creating a "%s" to call a method from the "%s" service.', self::class, $this->serviceId ) ); } if (!method_exists($service, $this->method)) { throw new \RuntimeException( sprintf( 'The "%s" method does not exist on "%s" (from service "%s")', $this->method, \get_class($service), $this->serviceId ) ); } \call_user_func([$service, $this->method], $event); } }