handler = new WhoopsPageHandler(); $this->configure(); return $this; } /** * Inject an editor into the whoops configuration. * * @return void * @throws \InvalidArgumentException for an invalid editor definition. */ public function configure(): void { /** @var WhoopsPageHandler $handler */ $handler = $this->getHandler(); $handler->setApplicationPaths([__FILE__]); $handler->addResourcePath(__DIR__ . '/../../assets/'); $handler->addCustomCss('css/laminas-whoops.css'); if (!isset($this->options['editor'])) { return; } $editor = $this->options['editor']; if (!is_callable($editor) && !is_string($editor)) { throw new \InvalidArgumentException(sprintf( 'Whoops editor must be a string editor name, string service name, or callable; received "%s"', (is_object($editor) ? get_class($editor) : gettype($editor)) )); } if (is_string($editor) && $this->container->has($editor)) { $editor = $this->container->get($editor); } $handler->setEditor($editor); } }