Beispiel #1
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);
         }
     }
 }
Beispiel #2
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);
 }