PHP Класс Elgg\CommitMessage

С версии: 1.9
Показать файл Открыть проект

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

Метод Описание
__construct ( string | null $msg = null ) Checks if a commit message is in the correct format
__toString ( )
findLengthyLines ( string $msg, integer $max_len ) : array Returns an array of line numbers > $max_len
getLengthyLines ( ) : array Get the line number of lines that are too long
getMaxLineLength ( ) : integer Return the max line length
getMsg ( ) : string Return the processed message.
getOriginalMsg ( ) : string Return the original message
getPart ( string $part ) : string Get part of the message
getValidTypes ( ) : array Return all valid types
isValid ( ) : boolean Are all parts of the message valid
isValidFormat ( ) : boolean Whether the message format conforms to our standards.
isValidLineLength ( ) : boolean Are any of the lines too long?
isValidType ( ) : boolean Is the type valid
removeComments ( string $msg ) : string Removes all lines that start with #
setMaxLineLength ( integer $len ) : void Sets the max line length allowed.
setMsg ( string $msg ) : void Sets the active message
shouldIgnore ( ) : boolean Should this msg be ignored for formatting?

Приватные методы

Метод Описание
processMsg ( ) : array Process the msg into its parts

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

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

Checks if a commit message is in the correct format
public __construct ( string | null $msg = null )
$msg string | null The commit message

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

public __toString ( )

findLengthyLines() публичный статический Метод

Returns an array of line numbers > $max_len
public static findLengthyLines ( string $msg, integer $max_len ) : array
$msg string The content to parse
$max_len integer Maximum length between \n in the $msg
Результат array

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

Get the line number of lines that are too long
public getLengthyLines ( ) : array
Результат array

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

Return the max line length
public getMaxLineLength ( ) : integer
Результат integer

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

Return the processed message.
public getMsg ( ) : string
Результат string

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

Return the original message
public getOriginalMsg ( ) : string
Результат string

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

Get part of the message
public getPart ( string $part ) : string
$part string One section of the message.
Результат string

getValidTypes() публичный статический Метод

Return all valid types
public static getValidTypes ( ) : array
Результат array

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

Are all parts of the message valid
public isValid ( ) : boolean
Результат boolean

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

Whether the message format conforms to our standards.
public isValidFormat ( ) : boolean
Результат boolean

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

Are any of the lines too long?
См. также: getLengthyLines() to get line numbers
public isValidLineLength ( ) : boolean
Результат boolean

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

Is the type valid
public isValidType ( ) : boolean
Результат boolean

removeComments() публичный статический Метод

Removes all lines that start with #
public static removeComments ( string $msg ) : string
$msg string The msg body of the commit
Результат string

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

Defaults to 160.
public setMaxLineLength ( integer $len ) : void
$len integer The maximum length.
Результат void

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

Sets the active message
public setMsg ( string $msg ) : void
$msg string The message content
Результат void

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

Should this msg be ignored for formatting?
public shouldIgnore ( ) : boolean
Результат boolean