Abstract base class representing a single part of a parsed header.

author Zaahid Bateson
package MailMimeParser

 Methods

Sets up dependencies.

__construct(\ZBateson\MbWrapper\MbWrapper $charsetConverter) 

Parameters

$charsetConverter

\ZBateson\MbWrapper\MbWrapper

Returns the value of the part (which is a string).

__toString() : string

Returns

stringthe value

Returns the part's value.

getValue() : string

Returns

stringthe value of the part

Returns true if spaces after this part should be ignored. True is only returned for MimeLiterals if the part ends with a mime-encoded string Tokens if the Token's value is a single space, and for CommentParts.

ignoreSpacesAfter() : boolean

Returns

boolean

Returns true if spaces before this part should be ignored. True is only returned for MimeLiterals if the part begins with a mime-encoded string, Tokens if the Token's value is a single space, and for CommentParts.

ignoreSpacesBefore() : boolean

Returns

boolean

Ensures the encoding of the passed string is set to UTF-8.

convertEncoding(string $str, string $from = 'ISO-8859-1', boolean $force = false) : string

The method does nothing if the passed $from charset is UTF-8 already, or if $force is set to false and mb_check_encoding for $str returns true for 'UTF-8'.

Parameters

$str

string

$from

string

$force

boolean

Returns

stringutf-8 string

 Properties

 

the charset converter used for converting strings in HeaderPart::convertEncoding

$charsetConverter : \ZBateson\MbWrapper\MbWrapper

Default

 

the value of the part

$value : string

Default