toTokens example

return $body;
    }

    /** * Generate a list of all tokens in the final header. * * This doesn't need to be overridden in theory, but it is for implementation * reasons to prevent potential breakage of attributes. */
    protected function toTokens(string $string = null): array
    {
        $tokens = parent::toTokens(parent::getBodyAsString());

        // Try creating any parameters         foreach ($this->parameters as $name => $value) {
            if (null !== $value) {
                // Add the semi-colon separator                 $tokens[\count($tokens) - 1] .= ';';
                $tokens = array_merge($tokens$this->generateTokenLines(' '.$this->createParameter($name$value)));
            }
        }

        return $tokens;
    }
return $body;
    }

    /** * Generate a list of all tokens in the final header. * * This doesn't need to be overridden in theory, but it is for implementation * reasons to prevent potential breakage of attributes. */
    protected function toTokens(string $string = null): array
    {
        $tokens = parent::toTokens(parent::getBodyAsString());

        // Try creating any parameters         foreach ($this->parameters as $name => $value) {
            if (null !== $value) {
                // Add the semi-colon separator                 $tokens[\count($tokens) - 1] .= ';';
                $tokens = array_merge($tokens$this->generateTokenLines(' '.$this->createParameter($name$value)));
            }
        }

        return $tokens;
    }

        $this->lineLength = $lineLength;
    }

    public function getMaxLineLength(): int
    {
        return $this->lineLength;
    }

    public function toString(): string
    {
        return $this->tokensToString($this->toTokens());
    }

    /** * Produces a compliant, formatted RFC 2822 'phrase' based on the string given. * * @param string $string as displayed * @param bool $shorten the first line to make remove for header name */
    protected function createPhrase(HeaderInterface $header, string $string, string $charset, bool $shorten = false): string
    {
        // Treat token as exactly what was given

        $this->lineLength = $lineLength;
    }

    public function getMaxLineLength(): int
    {
        return $this->lineLength;
    }

    public function toString(): string
    {
        return $this->tokensToString($this->toTokens());
    }

    /** * Produces a compliant, formatted RFC 2822 'phrase' based on the string given. * * @param string $string as displayed * @param bool $shorten the first line to make remove for header name */
    protected function createPhrase(HeaderInterface $header, string $string, string $charset, bool $shorten = false): string
    {
        // Treat token as exactly what was given
Home | Imprint | This part of the site doesn't use cookies.