private function input(ServerRequestInterface $request): array
    {
        if (! is_null($this->parser)) {

            $input = ($this->parser)($request);

            if (is_array($input)) {

                return $input;

            }

            throw new InputTypeException($input);

        }

        return array_merge(
            $request->getAttributes(),
            $request->getQueryParams(),
            $request->getParsedBody(),
            $request->getUploadedFiles()
        );
    }