Swift_Mime_Headers_AbstractHeader::toTokens PHP Method

toTokens() protected method

Generate a list of all tokens in the final header.
protected toTokens ( string $string = null ) : array
$string string The string to tokenize
return array An array of tokens as strings
    protected function toTokens($string = null)
    {
        if (is_null($string)) {
            $string = $this->getFieldBody();
        }
        $tokens = array();
        // Generate atoms; split at all invisible boundaries followed by WSP
        foreach (preg_split('~(?=[ \\t])~', $string) as $token) {
            $newTokens = $this->generateTokenLines($token);
            foreach ($newTokens as $newToken) {
                $tokens[] = $newToken;
            }
        }
        return $tokens;
    }