public static function inParams(ParamErrors $errors, ParamErrorMessages $errorMessages): self
    {
        return new self(Sequence::of($errors)->map(
                function(array $errors, $paramName) use ($errorMessages): array
                {
                    $resolved = ['field' => $paramName, 'errors' => []];
                    foreach ($errors as $id => $error) {
                        $resolved['errors'][] = [
                                'id'      => $id,
                                'details' => $error->details(),
                                'message' => $errorMessages->messageFor($error)->message()
                        ];
                    }

                    return $resolved;
                }
        ));
    }