Skip to content

Commit

Permalink
Cleanup phpdoc/typehints/etc...
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Dec 21, 2014
1 parent 7ac0175 commit 80309ab
Showing 1 changed file with 56 additions and 4 deletions.
60 changes: 56 additions & 4 deletions framework/ActiveSync/lib/Horde/ActiveSync/Imap/MessageBodyData.php
Expand Up @@ -130,6 +130,15 @@ public function __set($property, $value)
}
}

/**
* Return the BODYTYPE to return to the client. Takes BODYPREF and available
* parts into account.
*
* @param boolean $save_bandwith IF true, saves bandwidth usage by
* favoring HTML over MIME BODYTYPE if able.
*
* @return integer A Horde_ActiveSync::BODYPREF_TYPE_* constant.
*/
public function getBodyTypePreference($save_bandwith = false)
{
// Apparently some clients don't send the MIME_SUPPORT field (thus
Expand All @@ -155,9 +164,9 @@ public function getBodyTypePreference($save_bandwith = false)
}

/**
* Determine which parts we need, and fetch them.
*
* @return [type] [description]
* Determine which parts we need, and fetches them from the IMAP client.
* Takes into account the available parts and the BODYPREF/BODYPARTPREF
* options.
*/
protected function _getParts()
{
Expand Down Expand Up @@ -224,6 +233,11 @@ protected function _getParts()

}

/**
* Return if we want HTML data.
*
* @return boolean True if HTML data is needed.
*/
protected function _wantHtml()
{
return $this->_version >= Horde_ActiveSync::VERSION_TWELVE &&
Expand All @@ -232,6 +246,17 @@ protected function _wantHtml()
!empty($this->_options['bodypartprefs']));
}

/**
* Return if we want plain text data.
*
* @param string $html_id The MIME id of any HTML part, if available.
* Used to detect if we need to fetch the plain
* part if we are requesting HTML, but only have
* plain.
* @param boolean $want_html True if the client wants HTML.
*
* @return boolean True if plain data is needed.
*/
protected function _wantPlainText($html_id, $want_html)
{
return $this->_version == Horde_ActiveSync::VERSION_TWOFIVE ||
Expand All @@ -251,7 +276,7 @@ protected function _wantPlainText($html_id, $want_html)
*
* @return Horde_Imap_Client_Fetch_Data The results.
*/
protected function _fetchData($params)
protected function _fetchData(array $params)
{
$query = new Horde_Imap_Client_Fetch_Query();
$query_opts = array(
Expand Down Expand Up @@ -465,6 +490,15 @@ protected function _getBodyPart(
);
}

/**
* Return the validated text/plain body data.
*
* @return array The validated body data array:
* - charset: (string) The charset of the text.
* - body: (Horde_Stream) The body text in a stream.
* - truncated: (boolean) True if text was truncated.
* - size: (integer) The original part size, in bytes.
*/
public function plainBody()
{
if (!empty($this->_plain)) {
Expand All @@ -474,6 +508,15 @@ public function plainBody()
return false;
}

/**
* Return the validated text/html body data.
*
* @return array The validated body data array:
* - charset: (string) The charset of the text.
* - body: (Horde_Stream) The body text in a stream.
* - truncated: (boolean) True if text was truncated.
* - size: (integer) The original part size, in bytes.
*/
public function htmlBody()
{
if (!empty($this->_html)) {
Expand All @@ -483,6 +526,15 @@ public function htmlBody()
return false;
}

/**
* Return the validated BODYPART data.
*
* @return array The validated body data array:
* - charset: (string) The charset of the text.
* - body: (Horde_Stream) The body text in a stream.
* - truncated: (boolean) True if text was truncated.
* - size: (integer) The original part size, in bytes.
*/
public function bodyPartBody()
{
if (!empty($this->_bodyPart)) {
Expand Down

0 comments on commit 80309ab

Please sign in to comment.