src/Connector/Languages.php
public function updateLanguage(
        string $slug,
        string $langCode,
        array $coordinators,
        array $options = []
    ): ResponseInterface {
        // Make sure the $coordinators array is not empty
        if (!\count($coordinators)) {
            throw new \InvalidArgumentException('The coordinators array must contain at least one username.');
        }

        // Build the required request data.
        $data = ['coordinators' => $coordinators];

        // Set the translators if present
        if (isset($options['translators'])) {
            $data['translators'] = $options['translators'];
        }

        // Set the reviewers if present
        if (isset($options['reviewers'])) {
            $data['reviewers'] = $options['reviewers'];
        }

        $request = $this->createRequest('PUT', $this->createUri("/api/2/project/$slug/language/$langCode/"));
        $request = $request->withBody($this->streamFactory->createStream(\json_encode($data)));
        $request = $request->withHeader('Content-Type', 'application/json');

        return $this->client->sendRequest($request);
    }
public function updateLanguage(
        string $slug,
        string $langCode,
        array $coordinators,
        array $options = []
    ): ResponseInterface {
        // Make sure the $coordinators array is not empty
        if (!\count($coordinators)) {
            throw new \InvalidArgumentException('The coordinators array must contain at least one username.');
        }

        // Build the required request data.
        $data = ['coordinators' => $coordinators];

        // Set the translators if present
        if (isset($options['translators'])) {
            $data['translators'] = $options['translators'];
        }

        // Set the reviewers if present
        if (isset($options['reviewers'])) {
            $data['reviewers'] = $options['reviewers'];
        }

        $request = $this->createRequest('PUT', $this->createUri("/api/2/project/$slug/language/$langCode/"));
        $request = $request->withBody($this->streamFactory->createStream(\json_encode($data)));
        $request = $request->withHeader('Content-Type', 'application/json');

        return $this->client->sendRequest($request);
    }
public function updateLanguage ( string $ slug , string $ langCode , array $ coordinators , array $ options = [ ] ) : ResponseInterface { // Make sure the $coordinators array is not empty if ( ! \ count ( $ coordinators ) ) { throw new \ InvalidArgumentException ( 'The coordinators array must contain at least one username.' ) ; } // Build the required request data. $ data = [ 'coordinators' => $ coordinators ] ; // Set the translators if present if ( isset ( $ options [ 'translators' ] ) ) { $ data [ 'translators' ] = $ options [ 'translators' ] ; } // Set the reviewers if present if ( isset ( $ options [ 'reviewers' ] ) ) { $ data [ 'reviewers' ] = $ options [ 'reviewers' ] ; } $ request = $ this -> createRequest ( 'PUT' , $ this -> createUri ( "/api/2/project/$slug/language/$langCode/" ) ) ; $ request = $ request -> withBody ( $ this -> streamFactory -> createStream ( \ json_encode ( $ data ) ) ) ; $ request = $ request -> withHeader ( 'Content-Type' , 'application/json' ) ; return $ this -> client -> sendRequest ( $ request ) ; }
Update a language within a project.

@param string   $slug         The slug for the project
@param string   $langCode     The language code for the new language
@param string[] $coordinators An array of coordinators for the language
@param array    $options      Optional additional params to send with the request

@return ResponseInterface

@throws \InvalidArgumentException
Update a language within a project .