src/Viserio/Component/Exception/Http/Handler.php
protected function getDisplayer(
        ?ServerRequestInterface $request,
        Throwable $original,
        Throwable $transformed,
        int $code
    ): DisplayerContract {
        $sortedDisplayers = [];

        \ksort($this->displayers);

        \array_walk_recursive($this->displayers, static function ($displayers, $key) use (&$sortedDisplayers): void {
            $sortedDisplayers[$key] = $displayers;
        });

        if ($request !== null) {
            $filtered = $this->getFiltered($sortedDisplayers, $request, $original, $transformed, $code);

            if (\count($filtered) !== 0) {
                return $this->sortedFilter($filtered, $request);
            }
        }

        return $sortedDisplayers[$this->resolvedOptions['http']['displayer']['default']];
    }
protected function getDisplayer(
        ?ServerRequestInterface $request,
        Throwable $original,
        Throwable $transformed,
        int $code
    ): DisplayerContract {
        $sortedDisplayers = [];

        \ksort($this->displayers);

        \array_walk_recursive($this->displayers, static function ($displayers, $key) use (&$sortedDisplayers): void {
            $sortedDisplayers[$key] = $displayers;
        });

        if ($request !== null) {
            $filtered = $this->getFiltered($sortedDisplayers, $request, $original, $transformed, $code);

            if (\count($filtered) !== 0) {
                return $this->sortedFilter($filtered, $request);
            }
        }

        return $sortedDisplayers[$this->resolvedOptions['http']['displayer']['default']];
    }
Get the displayer instance.

@param null|\Psr\Http\Message\ServerRequestInterface $request
@param \Throwable                                    $original
@param \Throwable                                    $transformed
@param int                                           $code

@return \Viserio\Component\Contract\Exception\Displayer