PHP Class Elgg\CommitMessage

Since: 1.9
Afficher le fichier Open project: elgg/elgg

Méthodes publiques

Méthode Description
__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?

Private Methods

Méthode Description
processMsg ( ) : array Process the msg into its parts

Method Details

__construct() public méthode

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

__toString() public méthode

public __toString ( )

findLengthyLines() public static méthode

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
Résultat array

getLengthyLines() public méthode

Get the line number of lines that are too long
public getLengthyLines ( ) : array
Résultat array

getMaxLineLength() public méthode

Return the max line length
public getMaxLineLength ( ) : integer
Résultat integer

getMsg() public méthode

Return the processed message.
public getMsg ( ) : string
Résultat string

getOriginalMsg() public méthode

Return the original message
public getOriginalMsg ( ) : string
Résultat string

getPart() public méthode

Get part of the message
public getPart ( string $part ) : string
$part string One section of the message.
Résultat string

getValidTypes() public static méthode

Return all valid types
public static getValidTypes ( ) : array
Résultat array

isValid() public méthode

Are all parts of the message valid
public isValid ( ) : boolean
Résultat boolean

isValidFormat() public méthode

Whether the message format conforms to our standards.
public isValidFormat ( ) : boolean
Résultat boolean

isValidLineLength() public méthode

Are any of the lines too long?
See also: getLengthyLines() to get line numbers
public isValidLineLength ( ) : boolean
Résultat boolean

isValidType() public méthode

Is the type valid
public isValidType ( ) : boolean
Résultat boolean

removeComments() public static méthode

Removes all lines that start with #
public static removeComments ( string $msg ) : string
$msg string The msg body of the commit
Résultat string

setMaxLineLength() public méthode

Defaults to 160.
public setMaxLineLength ( integer $len ) : void
$len integer The maximum length.
Résultat void

setMsg() public méthode

Sets the active message
public setMsg ( string $msg ) : void
$msg string The message content
Résultat void

shouldIgnore() public méthode

Should this msg be ignored for formatting?
public shouldIgnore ( ) : boolean
Résultat boolean