Elgg  Version 2.3
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 17 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 155 of file CommitMessage.php.

Member Function Documentation

Elgg\CommitMessage::__toString ( )

Definition at line 355 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 340 of file CommitMessage.php.

Elgg\CommitMessage::getLengthyLines ( )

Get the line number of lines that are too long.

Returns
array

Definition at line 255 of file CommitMessage.php.

Elgg\CommitMessage::getMaxLineLength ( )

Return the max line length.

Returns
int

Definition at line 282 of file CommitMessage.php.

Elgg\CommitMessage::getMsg ( )

Return the processed message.

Returns
string

Definition at line 181 of file CommitMessage.php.

Elgg\CommitMessage::getOriginalMsg ( )

Return the original message.

Returns
string

Definition at line 190 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 306 of file CommitMessage.php.

static Elgg\CommitMessage::getValidTypes ( )
static

Return all valid types.

Returns
array

Definition at line 273 of file CommitMessage.php.

Elgg\CommitMessage::isValid ( )

Are all parts of the message valid.

Returns
bool

Definition at line 224 of file CommitMessage.php.

Elgg\CommitMessage::isValidFormat ( )

Whether the message format conforms to our standards.

Returns
boolean

Definition at line 235 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 246 of file CommitMessage.php.

Elgg\CommitMessage::isValidType ( )

Is the type valid.

Returns
boolean

Definition at line 264 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 321 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 294 of file CommitMessage.php.

Elgg\CommitMessage::setMsg (   $msg)

Sets the active message.

Parameters
string$msgThe message content
Returns
void

Definition at line 168 of file CommitMessage.php.

Elgg\CommitMessage::shouldIgnore ( )

Should this msg be ignored for formatting?

Returns
boolean

Definition at line 199 of file CommitMessage.php.


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