src/API/Implementation/SpellCheck/Yandex/YandexSpellCheckApi.php
protected function createCheckTextsContext(
        array $texts,
        Language $languageFrom
    ): RequestContext {
        $requestContext = (new RequestContext(sprintf("%s/%s", $this->apiEndpoint, self::CHECK_TEXTS_API_PATH)))
            ->setRequestParameters(
                [
                    'lang' => $languageFrom->getCode()
                ]
            )
            ->setData(['text' => $texts])
            ->setMethod(RequestContext::METHOD_POST)
            ->setEncodeArraysUsingDuplication(true)
            ->setContentType(RequestContext::CONTENT_TYPE_FORM_URLENCODED)
            ->setResponseContextClass(JsonResponseContext::class);

        return $requestContext;
    }
protected function createCheckTextsContext(
        array $texts,
        Language $languageFrom
    ): RequestContext {
        $requestContext = (new RequestContext(sprintf("%s/%s", $this->apiEndpoint, self::CHECK_TEXTS_API_PATH)))
            ->setRequestParameters(
                [
                    'lang' => $languageFrom->getCode()
                ]
            )
            ->setData(['text' => $texts])
            ->setMethod(RequestContext::METHOD_POST)
            ->setEncodeArraysUsingDuplication(true)
            ->setContentType(RequestContext::CONTENT_TYPE_FORM_URLENCODED)
            ->setResponseContextClass(JsonResponseContext::class);

        return $requestContext;
    }
protected function createCheckTextsContext ( array $ texts , Language $ languageFrom ) : RequestContext { $ requestContext = ( new RequestContext ( sprintf ( "%s/%s" , $ this -> apiEndpoint , self :: CHECK_TEXTS_API_PATH ) ) ) -> setRequestParameters ( [ 'lang' => $ languageFrom -> getCode ( ) ] ) -> setData ( [ 'text' => $ texts ] ) -> setMethod ( RequestContext :: METHOD_POST ) -> setEncodeArraysUsingDuplication ( true ) -> setContentType ( RequestContext :: CONTENT_TYPE_FORM_URLENCODED ) -> setResponseContextClass ( JsonResponseContext :: class ) ; return $ requestContext ; }
Create request context for spell-check request

@param array    $texts
@param Language $languageFrom

@throws RequestContextException

@return RequestContext
Create request context for spell - check request