private function getCommitByShaHash(Environment $environment, $sha)
    {
        $cacheKey = $environment->project . ':' . $sha;
        $client = $this->api->getHttpClient();
        if ($cached = $this->cache->fetch($cacheKey)) {
            return new Commit($cached['data'], $cached['uri'], $client, true);
        }
        $baseUrl = Project::getProjectBaseFromUrl($environment->getUri()) . '/git/commits';
        $commit = \Platformsh\Client\Model\Git\Commit::get($sha, $baseUrl, $client);
        if ($commit === false) {
            return false;
        }
        $data = $commit->getData();
        // No need to cache API metadata.
        if (isset($data['_links']['self']['meta'])) {
            unset($data['_links']['self']['meta']);
        }
        $this->cache->save($cacheKey, [
            'data' => $data,
            'uri' => $baseUrl,
        ], 0);

        return $commit;
    }
private function getCommitByShaHash(Environment $environment, $sha)
    {
        $cacheKey = $environment->project . ':' . $sha;
        $client = $this->api->getHttpClient();
        if ($cached = $this->cache->fetch($cacheKey)) {
            return new Commit($cached['data'], $cached['uri'], $client, true);
        }
        $baseUrl = Project::getProjectBaseFromUrl($environment->getUri()) . '/git/commits';
        $commit = \Platformsh\Client\Model\Git\Commit::get($sha, $baseUrl, $client);
        if ($commit === false) {
            return false;
        }
        $data = $commit->getData();
        // No need to cache API metadata.
        if (isset($data['_links']['self']['meta'])) {
            unset($data['_links']['self']['meta']);
        }
        $this->cache->save($cacheKey, [
            'data' => $data,
            'uri' => $baseUrl,
        ], 0);

        return $commit;
    }
private function getCommitByShaHash ( Environment $ environment , $ sha ) { $ cacheKey = $ environment -> project . ':' . $ sha ; $ client = $ this -> api -> getHttpClient ( ) ; if ( $ cached = $ this -> cache -> fetch ( $ cacheKey ) ) { return new Commit ( $ cached [ 'data' ] , $ cached [ 'uri' ] , $ client , true ) ; } $ baseUrl = Project :: getProjectBaseFromUrl ( $ environment -> getUri ( ) ) . '/git/commits' ; $ commit = \ Platformsh \ Client \ Model \ Git \ Commit :: get ( $ sha , $ baseUrl , $ client ) ; if ( $ commit === false ) { return false ; } $ data = $ commit -> getData ( ) ; // No need to cache API metadata. if ( isset ( $ data [ '_links' ] [ 'self' ] [ 'meta' ] ) ) { unset ( $ data [ '_links' ] [ 'self' ] [ 'meta' ] ) ; } $ this -> cache -> save ( $ cacheKey , [ 'data' => $ data , 'uri' => $ baseUrl , ] , 0 ) ; return $ commit ; }
Get a specific commit from the API.

@param Environment $environment
@param string $sha The "pure" commit SHA hash.

@return \Platformsh\Client\Model\Git\Commit|false
Get a specific commit from the API .