src/Api/Key.php
public function create(string $projectKey, string $name, array $params = [])
    {
        $params['name'] = $name;

        $response = $this->httpPost(sprintf('/api/v2/projects/%s/keys', $projectKey), $params);

        if (!$this->hydrator) {
            return $response;
        }

        if ($response->getStatusCode() !== 200 && $response->getStatusCode() !== 201) {
            $this->handleErrors($response);
        }

        return $this->hydrator->hydrate($response, KeyCreated::class);
    }
public function create(string $projectKey, string $name, array $params = [])
    {
        $params['name'] = $name;

        $response = $this->httpPost(sprintf('/api/v2/projects/%s/keys', $projectKey), $params);

        if (!$this->hydrator) {
            return $response;
        }

        if ($response->getStatusCode() !== 200 && $response->getStatusCode() !== 201) {
            $this->handleErrors($response);
        }

        return $this->hydrator->hydrate($response, KeyCreated::class);
    }
public function create ( string $ projectKey , string $ name , array $ params = [ ] ) { $ params [ 'name' ] = $ name ; $ response = $ this -> httpPost ( sprintf ( '/api/v2/projects/%s/keys' , $ projectKey ) , $ params ) ; if ( ! $ this -> hydrator ) { return $ response ; } if ( $ response -> getStatusCode ( ) !== 200 && $ response -> getStatusCode ( ) !== 201 ) { $ this -> handleErrors ( $ response ) ; } return $ this -> hydrator -> hydrate ( $ response , KeyCreated :: class ) ; }
Create a new key.

@param string $projectKey
@param string $localeId
@param array  $params

@return KeyCreated|ResponseInterface
Create a new key .