Ejemplo n.º 1
0
 /**
  * @param string $branch
  *
  * @return string
  */
 protected function getFeatureSubject($branch)
 {
     $subject = "";
     $branch = str_replace(sprintf('%s/', $this->origin), '', $branch);
     $issue = $this->cleanPrefix($branch, self::FEATURE);
     if (file_exists($this->getFeaturesSubjectPath())) {
         $content = explode("\n", file_get_contents($this->getFeaturesSubjectPath()));
         foreach ($content as $info) {
             $logIssue = substr($info, 0, strpos($info, ';'));
             $logTitle = TextUtil::sanitize(substr($info, strpos($info, ';') + 1));
             if ($logIssue === $issue) {
                 return $logTitle;
             }
         }
     }
     if (empty($subject) && $this->getConnector()) {
         $subject = TextUtil::sanitize($this->getConnector()->getIssueTitle($issue));
         file_put_contents($this->getFeaturesSubjectPath(), sprintf('%s;%s', $issue, $subject) . "\n", FILE_APPEND);
     }
     return $subject;
 }