Zend\Expressive\Container\WhoopsPageHandlerFactory::injectEditor PHP Method

injectEditor() private method

Inject an editor into the whoops configuration.
See also: https://github.com/filp/whoops/blob/master/docs/Open%20Files%20In%20An%20Editor.md
private injectEditor ( PrettyPageHandler $handler, array | ArrayAccess $config, Interop\Container\ContainerInterface $container )
$handler Whoops\Handler\PrettyPageHandler
$config array | ArrayAccess
$container Interop\Container\ContainerInterface
    private function injectEditor(PrettyPageHandler $handler, $config, ContainerInterface $container)
    {
        if (!isset($config['editor'])) {
            return;
        }
        $editor = $config['editor'];
        if (is_callable($editor)) {
            $handler->setEditor($editor);
            return;
        }
        if (!is_string($editor)) {
            throw new Exception\InvalidServiceException(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 ($container->has($editor)) {
            $editor = $container->get($editor);
        }
        $handler->setEditor($editor);
    }
WhoopsPageHandlerFactory