public function search(string $projectKey, array $params = [])
    {
        $q = '';

        if (isset($params['tags'])) {
            $q .= 'tags:'.$params['tags'].' ';
        }

        if (isset($params['name'])) {
            $q .= 'name:'.$params['name'].' ';
        }

        if (isset($params['ids'])) {
            $q .= 'ids:'.$params['ids'].' ';
        }

        if (!empty($q)) {
            $params['q'] = $q;
        }

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

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

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

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

        if (isset($params['tags'])) {
            $q .= 'tags:'.$params['tags'].' ';
        }

        if (isset($params['name'])) {
            $q .= 'name:'.$params['name'].' ';
        }

        if (isset($params['ids'])) {
            $q .= 'ids:'.$params['ids'].' ';
        }

        if (!empty($q)) {
            $params['q'] = $q;
        }

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

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

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

        return $this->hydrator->hydrate($response, KeySearchResults::class);
    }
public function search ( string $ projectKey , array $ params = [ ] ) { $ q = '' ; if ( isset ( $ params [ 'tags' ] ) ) { $ q .= 'tags:' . $ params [ 'tags' ] . ' ' ; } if ( isset ( $ params [ 'name' ] ) ) { $ q .= 'name:' . $ params [ 'name' ] . ' ' ; } if ( isset ( $ params [ 'ids' ] ) ) { $ q .= 'ids:' . $ params [ 'ids' ] . ' ' ; } if ( ! empty ( $ q ) ) { $ params [ 'q' ] = $ q ; } $ response = $ this -> httpPost ( sprintf ( '/api/v2/projects/%s/keys/search' , $ projectKey ) , $ params ) ; if ( ! $ this -> hydrator ) { return $ response ; } if ( $ response -> getStatusCode ( ) !== 200 && $ response -> getStatusCode ( ) !== 201 ) { $ this -> handleErrors ( $ response ) ; } return $ this -> hydrator -> hydrate ( $ response , KeySearchResults :: class ) ; }
Search keys.

@param string $projectKey
@param array  $params

@return KeySearchResults|ResponseInterface
Search keys .