PHP Класс VersionPress\Git\CommitMessage

Note about the "[VP]" prefix: this class just doesn't care. When the commit is first created, external code will typically put prefix-less subject into this object. Only when {@link VersionPress\Git\GitRepository::commit()} executes the commit itself will get the [VP] prefix. On the other hand, when the commit is read from the repository and parsed back into this object, it will typically have the [VP] prefix. It doesn't matter as VersionPress typically only works with the commit body and its VP tags.
См. также: Commit Represents the whole commit
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( string $subject, string $body = null )
getBody ( ) : string Rest of the commit message (all text except the subject). Usually just the VP tags but body might also contain some other information.
getSubject ( ) : string The first line of the commit message. Short description of the change
getUnprefixedSubject ( ) : string Returns commit message subject without prefix set in constant VERSIONPRESS_COMMIT_MESSAGE_PREFIX
getVersionPressTag ( $tagName ) : string Returns VP tag with given name, or an empty string if no tag of given name is found.
getVersionPressTags ( ) : array 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.

Описание методов

__construct() публичный Метод

public __construct ( string $subject, string $body = null )
$subject string First line of the commit message
$body string Optional, lines 3..n

getBody() публичный Метод

Rest of the commit message (all text except the subject). Usually just the VP tags but body might also contain some other information.
public getBody ( ) : string
Результат string

getSubject() публичный Метод

The first line of the commit message. Short description of the change
public getSubject ( ) : string
Результат string

getUnprefixedSubject() публичный Метод

Returns commit message subject without prefix set in constant VERSIONPRESS_COMMIT_MESSAGE_PREFIX
public getUnprefixedSubject ( ) : string
Результат string

getVersionPressTag() публичный Метод

Returns VP tag with given name, or an empty string if no tag of given name is found.
public getVersionPressTag ( $tagName ) : string
$tagName
Результат string

getVersionPressTags() публичный Метод

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
Результат array Array of tagName => value (trimmed)