Elgg  Version 3.0
Public Member Functions | Static Public Member Functions | List of all members
Elgg\CommitMessage Class Reference

Public Member Functions

 __construct ($msg=null)
 Checks if a commit message is in the correct format. More...
 
 setMsg ($msg)
 Sets the active message. More...
 
 getMsg ()
 Return the processed message. More...
 
 getOriginalMsg ()
 Return the original message. More...
 
 shouldIgnore ()
 Should this msg be ignored for formatting? More...
 
 isValid ()
 Are all parts of the message valid. More...
 
 isValidFormat ()
 Whether the message format conforms to our standards. More...
 
 isValidLineLength ()
 Are any of the lines too long? More...
 
 getLengthyLines ()
 Get the line number of lines that are too long. More...
 
 isValidType ()
 Is the type valid. More...
 
 getMaxLineLength ()
 Return the max line length. More...
 
 setMaxLineLength ($len)
 Sets the max line length allowed. More...
 
 getPart ($part)
 Get part of the message. More...
 
 __toString ()
 

Static Public Member Functions

static getValidTypes ()
 Return all valid types. More...
 
static removeComments ($msg)
 Removes all lines that start with #. More...
 
static findLengthyLines ($msg, $max_len)
 Returns an array of line numbers > $max_len. More...
 

Detailed Description

Definition at line 14 of file CommitMessage.php.

Constructor & Destructor Documentation

Elgg\CommitMessage::__construct (   $msg = null)

Checks if a commit message is in the correct format.

Parameters
string | null$msgThe commit message

Definition at line 134 of file CommitMessage.php.

Member Function Documentation

Elgg\CommitMessage::__toString ( )

Definition at line 335 of file CommitMessage.php.

static Elgg\CommitMessage::findLengthyLines (   $msg,
  $max_len 
)
static

Returns an array of line numbers > $max_len.

Parameters
string$msgThe content to parse
int$max_lenMaximum length between
in the $msg
Returns
array

Definition at line 319 of file CommitMessage.php.

Elgg\CommitMessage::getLengthyLines ( )

Get the line number of lines that are too long.

Returns
array

Definition at line 234 of file CommitMessage.php.

Elgg\CommitMessage::getMaxLineLength ( )

Return the max line length.

Returns
int

Definition at line 261 of file CommitMessage.php.

Elgg\CommitMessage::getMsg ( )

Return the processed message.

Returns
string

Definition at line 160 of file CommitMessage.php.

Elgg\CommitMessage::getOriginalMsg ( )

Return the original message.

Returns
string

Definition at line 169 of file CommitMessage.php.

Elgg\CommitMessage::getPart (   $part)

Get part of the message.

Parameters
string$partOne section of the message.
Returns
string
Exceptions
UnexpectedValueException

Definition at line 285 of file CommitMessage.php.

static Elgg\CommitMessage::getValidTypes ( )
static

Return all valid types.

Returns
array

Definition at line 252 of file CommitMessage.php.

Elgg\CommitMessage::isValid ( )

Are all parts of the message valid.

Returns
bool

Definition at line 203 of file CommitMessage.php.

Elgg\CommitMessage::isValidFormat ( )

Whether the message format conforms to our standards.

Returns
boolean

Definition at line 214 of file CommitMessage.php.

Elgg\CommitMessage::isValidLineLength ( )

Are any of the lines too long?

See also
getLengthyLines() to get line numbers
Returns
bool

Definition at line 225 of file CommitMessage.php.

Elgg\CommitMessage::isValidType ( )

Is the type valid.

Returns
boolean

Definition at line 243 of file CommitMessage.php.

static Elgg\CommitMessage::removeComments (   $msg)
static

Removes all lines that start with #.

Parameters
string$msgThe msg body of the commit
Returns
string

Definition at line 300 of file CommitMessage.php.

Elgg\CommitMessage::setMaxLineLength (   $len)

Sets the max line length allowed.

Defaults to 160.

Parameters
int$lenThe maximum length.
Returns
void

Definition at line 273 of file CommitMessage.php.

Elgg\CommitMessage::setMsg (   $msg)

Sets the active message.

Parameters
string$msgThe message content
Returns
void

Definition at line 147 of file CommitMessage.php.

Elgg\CommitMessage::shouldIgnore ( )

Should this msg be ignored for formatting?

Returns
boolean

Definition at line 178 of file CommitMessage.php.


The documentation for this class was generated from the following file: