| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 2 | public function getFileContent( string $repoName, string $branchName, string $fileName ): string { |
|
| 30 | 2 | if ( !$this->repoIsAllowed( $repoName ) ) { |
|
| 31 | 1 | return ''; |
|
| 32 | } |
||
| 33 | |||
| 34 | 1 | $url = $this->getFileUrl( $repoName, $branchName, $fileName ); |
|
| 35 | |||
| 36 | try { |
||
| 37 | 1 | return $this->fileFetcher->fetchFile( $url ); |
|
| 38 | } |
||
| 39 | 1 | catch ( FileFetchingException $ex ) { |
|
| 40 | 1 | return ''; |
|
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 60 |