src/PlatformClient.php
protected function locateProject($id)
    {
        $url = $this->accountsEndpoint . 'projects/' . rawurlencode($id);
        try {
            $result = $this->simpleGet($url);
        }
        catch (BadResponseException $e) {
            $response = $e->getResponse();
            // @todo Remove 400 from this array when the API is more liberal in validating project IDs.
            $ignoredErrorCodes = [400, 403, 404];
            if ($response && in_array($response->getStatusCode(), $ignoredErrorCodes)) {
                return false;
            }
            throw ApiResponseException::create($e->getRequest(), $e->getResponse(), $e->getPrevious());
        }

        return isset($result['endpoint']) ? $result['endpoint'] : false;
    }
protected function locateProject($id)
    {
        $url = $this->accountsEndpoint . 'projects/' . rawurlencode($id);
        try {
            $result = $this->simpleGet($url);
        }
        catch (BadResponseException $e) {
            $response = $e->getResponse();
            // @todo Remove 400 from this array when the API is more liberal in validating project IDs.
            $ignoredErrorCodes = [400, 403, 404];
            if ($response && in_array($response->getStatusCode(), $ignoredErrorCodes)) {
                return false;
            }
            throw ApiResponseException::create($e->getRequest(), $e->getResponse(), $e->getPrevious());
        }

        return isset($result['endpoint']) ? $result['endpoint'] : false;
    }
protected function locateProject ( $ id ) { $ url = $ this -> accountsEndpoint . 'projects/' . rawurlencode ( $ id ) ; try { $ result = $ this -> simpleGet ( $ url ) ; } catch ( BadResponseException $ e ) { $ response = $ e -> getResponse ( ) ; // @todo Remove 400 from this array when the API is more liberal in validating project IDs. $ ignoredErrorCodes = [ 400 , 403 , 404 ] ; if ( $ response && in_array ( $ response -> getStatusCode ( ) , $ ignoredErrorCodes ) ) { return false ; } throw ApiResponseException :: create ( $ e -> getRequest ( ) , $ e -> getResponse ( ) , $ e -> getPrevious ( ) ) ; } return isset ( $ result [ 'endpoint' ] ) ? $ result [ 'endpoint' ] : false ; }
Locate a project by ID.

@param string $id
The project ID.

@return string
The project's API endpoint.
Locate a project by ID .