getVersionPressTags() public method

Returns all VP tags in an associative array. VP tags are identified as separate lines in the commit body that start with the "VP-" prefix.
public getVersionPressTags ( ) : array
return array Array of tagName => value (trimmed)
 /**
  * @param CommitMessage $commitMessage
  * @return ChangeInfoEnvelope
  */
 public function parse(CommitMessage $commitMessage)
 {
     $fullBody = $commitMessage->getBody();
     $splittedBodies = explode("\n\n", $fullBody);
     $lastBody = $splittedBodies[count($splittedBodies) - 1];
     $changeInfoList = [];
     $version = null;
     $environment = null;
     if (self::containsVersion($lastBody)) {
         $version = self::extractTag(ChangeInfoEnvelope::VP_VERSION_TAG, $lastBody);
         $environment = self::extractTag(ChangeInfoEnvelope::VP_ENVIRONMENT_TAG, $lastBody);
         array_pop($splittedBodies);
     }
     if (!self::isTrackedChangeInfo($fullBody)) {
         return new ChangeInfoEnvelope([new UntrackedChangeInfo($commitMessage)], $version, $environment);
     }
     foreach ($splittedBodies as $body) {
         $partialCommitMessage = new CommitMessage("", $body);
         $actionTag = $partialCommitMessage->getVersionPressTag(TrackedChangeInfo::ACTION_TAG);
         list($scope, $action, $id) = array_pad(explode('/', $actionTag, 3), 3, null);
         $tags = $partialCommitMessage->getVersionPressTags();
         unset($tags[TrackedChangeInfo::ACTION_TAG]);
         $actionsInfo = $this->actionsInfoProvider->getActionsInfo($scope);
         if ($this->dbSchema->isEntity($scope)) {
             $entityInfo = $this->dbSchema->getEntityInfo($scope);
             $changeInfoList[] = new EntityChangeInfo($entityInfo, $actionsInfo, $action, $id, $tags, []);
         } else {
             $changeInfoList[] = new TrackedChangeInfo($scope, $actionsInfo, $action, $id, $tags, []);
         }
     }
     return new ChangeInfoEnvelope($changeInfoList, $version, $environment);
 }
 public static function buildFromCommitMessage(CommitMessage $commitMessage)
 {
     $tags = $commitMessage->getVersionPressTags();
     $actionTag = $tags[TrackedChangeInfo::ACTION_TAG];
     list(, , $version) = explode("/", $actionTag, 3);
     return new self($version);
 }
Esempio n. 3
0
 public static function buildFromCommitMessage(CommitMessage $commitMessage)
 {
     $tags = $commitMessage->getVersionPressTags();
     $actionTag = $tags[TrackedChangeInfo::ACTION_TAG];
     $userLogin = $tags[self::USER_LOGIN];
     list(, $action, $entityId) = explode("/", $actionTag);
     return new self($action, $entityId, $userLogin);
 }
Esempio n. 4
0
 public static function buildFromCommitMessage(CommitMessage $commitMessage)
 {
     $tags = $commitMessage->getVersionPressTags();
     $actionTag = $tags[TrackedChangeInfo::ACTION_TAG];
     $commentAuthor = $tags[self::AUTHOR_TAG];
     $commentedPost = $tags[self::POST_TITLE_TAG];
     list(, $action, $entityId) = explode("/", $actionTag, 3);
     return new self($action, $entityId, $commentAuthor, $commentedPost);
 }
 public static function buildFromCommitMessage(CommitMessage $commitMessage)
 {
     $tags = $commitMessage->getVersionPressTags();
     $actionTag = $tags[TrackedChangeInfo::ACTION_TAG];
     list(, $action, $entityId) = explode("/", $actionTag, 3);
     $termName = $tags[self::TERM_NAME_TAG];
     $taxonomy = $tags[self::TAXONOMY_TAG];
     return new self($action, $entityId, $taxonomy, $termName);
 }
Esempio n. 6
0
 public static function buildFromCommitMessage(CommitMessage $commitMessage)
 {
     $tags = $commitMessage->getVersionPressTags();
     $actionTag = $tags[TrackedChangeInfo::ACTION_TAG];
     list(, $action, $entityId) = explode("/", $actionTag, 3);
     $termName = isset($tags[self::TERM_NAME_TAG]) ? $tags[self::TERM_NAME_TAG] : $entityId;
     $metaKey = $tags[self::TERM_META_KEY];
     $termVpid = $tags[self::TERM_VPID_TAG];
     return new self($action, $entityId, $termName, $termVpid, $metaKey);
 }
Esempio n. 7
0
 public static function buildFromCommitMessage(CommitMessage $commitMessage)
 {
     $tags = $commitMessage->getVersionPressTags();
     $actionTag = $tags[TrackedChangeInfo::ACTION_TAG];
     list(, $action, $entityId) = explode("/", $actionTag, 3);
     $titleTag = isset($tags[self::POST_TITLE_TAG]) ? $tags[self::POST_TITLE_TAG] : $entityId;
     $type = isset($tags[self::POST_TYPE_TAG]) ? $tags[self::POST_TYPE_TAG] : "post";
     $updatedProperties = isset($tags[self::POST_UPDATED_PROPERTIES_TAG]) ? explode(",", $tags[self::POST_UPDATED_PROPERTIES_TAG]) : array();
     return new self($action, $entityId, $type, $titleTag, $updatedProperties);
 }
Esempio n. 8
0
 public static function buildFromCommitMessage(CommitMessage $commitMessage)
 {
     $tags = $commitMessage->getVersionPressTags();
     $actionTag = $tags[TrackedChangeInfo::ACTION_TAG];
     list(, $action, $entityId) = explode("/", $actionTag, 3);
     $titleTag = isset($tags[self::POST_TITLE_TAG]) ? $tags[self::POST_TITLE_TAG] : $entityId;
     $type = $tags[self::POST_TYPE_TAG];
     $metaKey = $tags[self::POST_META_KEY];
     $postVpId = $tags[self::POST_VPID_TAG];
     return new self($action, $entityId, $type, $titleTag, $postVpId, $metaKey);
 }