Example #1
0
 /**
  * Get the file contents
  *
  * @param string $file
  * @param string $branch
  *
  * @return string
  */
 public function getFileContents($file, $branch = 'master')
 {
     try {
         $fileContent = $this->client->api('repositories')->getFile($this->project->getVendorName() . "/" . $this->project->getPackageName(), $file, $branch);
         return $this->parseJson($fileContent);
     } catch (\Gitlab\Exception\RuntimeException $e) {
         return "";
     }
 }
Example #2
0
 /**
  * Get the file contents
  *
  * @param string $file
  * @param string $branch
  *
  * @return string
  */
 public function getFileContents($file, $branch = 'master')
 {
     $response = $this->client->raw($this->project->getVendorName(), $this->project->getPackageName(), $branch, $file);
     return $this->parseJson($response->getContent());
 }