public function getCommits()
    {
        if ('' === ini_get('user_agent')) {
            throw new UserAgentNotFoundException();
        }

        if (!ini_get('allow_url_fopen')) {
            throw new AllowUrlFileOpenException();
        }

        $jsonResponse = $this->getFileContent($this->getCommitsUrl(), ini_get('user_agent'));
        $response = json_decode($jsonResponse, true);

        foreach ($response as $commitArray) {
            $commit = Commit::createFromData($commitArray['commit'])
                ->setSha($commitArray['sha'])
            ;

            $commits[] = $commit;
        }

        return $commits;
    }
public function getCommits()
    {
        if ('' === ini_get('user_agent')) {
            throw new UserAgentNotFoundException();
        }

        if (!ini_get('allow_url_fopen')) {
            throw new AllowUrlFileOpenException();
        }

        $jsonResponse = $this->getFileContent($this->getCommitsUrl(), ini_get('user_agent'));
        $response = json_decode($jsonResponse, true);

        foreach ($response as $commitArray) {
            $commit = Commit::createFromData($commitArray['commit'])
                ->setSha($commitArray['sha'])
            ;

            $commits[] = $commit;
        }

        return $commits;
    }
public function getCommits ( ) { if ( '' === ini_get ( 'user_agent' ) ) { throw new UserAgentNotFoundException ( ) ; } if ( ! ini_get ( 'allow_url_fopen' ) ) { throw new AllowUrlFileOpenException ( ) ; } $ jsonResponse = $ this -> getFileContent ( $ this -> getCommitsUrl ( ) , ini_get ( 'user_agent' ) ) ; $ response = json_decode ( $ jsonResponse , true ) ; foreach ( $ response as $ commitArray ) { $ commit = Commit :: createFromData ( $ commitArray [ 'commit' ] ) -> setSha ( $ commitArray [ 'sha' ] ) ; $ commits [ ] = $ commit ; } return $ commits ; }
Get the commits.

@return Commit[]
Get the commits .