| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2.0116 |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 33 | 1 | public function commit_hash() { |
|
| 34 | 1 | $escaped_path = escapeshellarg($this->path); |
|
| 35 | 1 | $command = "git -C $escaped_path rev-parse HEAD"; |
|
| 36 | 1 | exec($command, $output, $returned); |
|
| 37 | 1 | if ($returned != 0) { |
|
|
|
|||
| 38 | throw new \RuntimeException(implode("\n", $output)); |
||
| 39 | } |
||
| 40 | 1 | return $output[0]; |
|
| 41 | } |
||
| 42 | } |
||
| 43 |