Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
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 15 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 153 of file CommitMessage.php.

Member Function Documentation

Elgg\CommitMessage::__toString ( )

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

Elgg\CommitMessage::getLengthyLines ( )

Get the line number of lines that are too long.

Returns
array

Definition at line 253 of file CommitMessage.php.

Elgg\CommitMessage::getMaxLineLength ( )

Return the max line length.

Returns
int

Definition at line 280 of file CommitMessage.php.

Elgg\CommitMessage::getMsg ( )

Return the processed message.

Returns
string

Definition at line 179 of file CommitMessage.php.

Elgg\CommitMessage::getOriginalMsg ( )

Return the original message.

Returns
string

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

static Elgg\CommitMessage::getValidTypes ( )
static

Return all valid types.

Returns
array

Definition at line 271 of file CommitMessage.php.

Elgg\CommitMessage::isValid ( )

Are all parts of the message valid.

Returns
bool

Definition at line 222 of file CommitMessage.php.

Elgg\CommitMessage::isValidFormat ( )

Whether the message format conforms to our standards.

Returns
boolean

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

Elgg\CommitMessage::isValidType ( )

Is the type valid.

Returns
boolean

Definition at line 262 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 319 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 292 of file CommitMessage.php.

Elgg\CommitMessage::setMsg (   $msg)

Sets the active message.

Parameters
string$msgThe message content
Returns
void

Definition at line 166 of file CommitMessage.php.

Elgg\CommitMessage::shouldIgnore ( )

Should this msg be ignored for formatting?

Returns
boolean

Definition at line 197 of file CommitMessage.php.


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