| Conditions | 2 | 
| Paths | 2 | 
| Total Lines | 14 | 
| Code Lines | 8 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 8 | 
| CRAP Score | 2 | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php  | 
            ||
| 77 | 3 | protected function getLatestCommitSha($branch)  | 
            |
| 78 |     { | 
            ||
| 79 | 3 | $curl = new Curl();  | 
            |
| 80 | 3 | $curl->get($this->projectUrl . '/projects/' . $this->projectId . '/' .  | 
            |
| 81 | 3 | 'repository/commits?private_token='. $this->privateKey . '&ref_name=' . $branch);  | 
            |
| 82 | |||
| 83 | 3 |         if ($curl->error) { | 
            |
| 84 | 1 |             throw new \Exception('Error: ' . $curl->errorCode . ': ' . $curl->errorMessage); | 
            |
| 85 | }  | 
            ||
| 86 | |||
| 87 | 2 | $response = $curl->response;  | 
            |
| 88 | |||
| 89 | 2 | return $response[0]->id;  | 
            |
| 90 | }  | 
            ||
| 91 | |||
| 92 | }  |