protected function createParameters(Operation $operation, $queryParamDocumentation, Context $context)
    {
        $documentationParams = [];
        $methodParameters = [];

        if ($operation->getOperation()->getParameters()) {
            foreach ($operation->getOperation()->getParameters() as $key => $parameter) {
                if ($parameter instanceof Reference) {
                    $parameter = $this->resolveParameter($parameter);
                }

                if ($parameter instanceof PathParameterSubSchema) {
                    $methodParameters[] = $this->pathParameterGenerator->generateMethodParameter($parameter, $context, $operation->getReference() . '/parameters/' . $key);
                    $documentationParams[] = sprintf(' * @param %s', $this->pathParameterGenerator->generateDocParameter($parameter, $context, $operation->getReference() . '/parameters/' . $key));
                }
            }

            foreach ($operation->getOperation()->getParameters() as $key => $parameter) {
                if ($parameter instanceof Reference) {
                    $parameter = $this->resolveParameter($parameter);
                }

                if ($parameter instanceof BodyParameter) {
                    $methodParameters[] = $this->bodyParameterGenerator->generateMethodParameter($parameter, $context, $operation->getReference() . '/parameters/' . $key);
                    $documentationParams[] = sprintf(' * @param %s', $this->bodyParameterGenerator->generateDocParameter($parameter, $context, $operation->getReference() . '/parameters/' . $key));
                }
            }
        }

        if (!empty($queryParamDocumentation)) {
            $documentationParams[] = " * @param array  \$parameters {";
            $documentationParams   = array_merge($documentationParams, array_map(function ($doc) {
                return " *     " . $doc;
            }, $queryParamDocumentation));
            $documentationParams[] = " * }";
        } else {
            $documentationParams[] = " * @param array  \$parameters List of parameters";
        }

        $documentationParams[] = " * @param string \$fetch      Fetch mode (object or response)";

        $methodParameters[] = new Param('parameters', new Expr\Array_());
        $methodParameters[] = new Param('fetch', new Expr\ConstFetch(new Name('self::FETCH_OBJECT')));

        return [$documentationParams, $methodParameters];
    }