Example #1
0
 /**
  * Get an array of repositories from Github's API.
  */
 protected function githubRepositories()
 {
     $github = new Github();
     $response = new b8\Http\Response\JsonResponse();
     $response->setContent($github->getRepositories());
     return $response;
 }
Example #2
0
 /**
  * Get an array of repositories from Github's API.
  */
 protected function githubRepositories()
 {
     $github = new Github();
     die(json_encode($github->getRepositories()));
 }
Example #3
0
 /**
  * @inheritDoc
  */
 public function reportError(Builder $builder, $file, $line, $message)
 {
     $diffLineNumber = $this->getDiffLineNumber($builder, $file, $line);
     if (!is_null($diffLineNumber)) {
         $helper = new Github();
         $repo = $this->getProject()->getReference();
         $prNumber = $this->getExtra('pull_request_number');
         $commit = $this->getCommitId();
         if (!empty($prNumber)) {
             $helper->createPullRequestComment($repo, $prNumber, $commit, $file, $diffLineNumber, $message);
         } else {
             $helper->createCommitComment($repo, $commit, $file, $diffLineNumber, $message);
         }
     }
 }
Example #4
0
 /**
  * @inheritDoc
  */
 public function reportError(Builder $builder, $plugin, $message, $severity = BuildError::SEVERITY_NORMAL, $file = null, $lineStart = null, $lineEnd = null)
 {
     $diffLineNumber = $this->getDiffLineNumber($builder, $file, $lineStart);
     if (!is_null($diffLineNumber)) {
         $helper = new Github();
         $repo = $this->getProject()->getReference();
         $prNumber = $this->getExtra('pull_request_number');
         $commit = $this->getCommitId();
         if (!empty($prNumber)) {
             $helper->createPullRequestComment($repo, $prNumber, $commit, $file, $diffLineNumber, $message);
         } else {
             $helper->createCommitComment($repo, $commit, $file, $diffLineNumber, $message);
         }
     }
     return parent::reportError($builder, $plugin, $message, $severity, $file, $lineStart, $lineEnd);
 }