Copied!

Header container representing the start line of a uu-encoded part.

The line may contain a unix file mode and a filename.

CloneableInstantiableIterable
Methods
public ZBateson\MailMimeParser\Message\PartHeaderContainer::__construct(Psr\Log\LoggerInterface $logger, ZBateson\MailMimeParser\Header\HeaderFactory $headerFactory, ?ZBateson\MailMimeParser\Message\PartHeaderContainer $cloneSource = NULL)
 

Pass a PartHeaderContainer as the second parameter. This is useful when creating a new MimePart with this PartHeaderContainer and the original container is needed for parsing and changes to the header in the part should not affect parsing.

  • param \PartHeaderContainer $cloneSource the original container to clone from
public ZBateson\MailMimeParser\Message\PartHeaderContainer::add(string $name, string $value) : static
 

Adds the header to the collection.

public ZBateson\MailMimeParser\ErrorBag::addError(string $message, string $psrLogLevel, ?Throwable $exception = NULL) : static
public ZBateson\MailMimeParser\Message\PartHeaderContainer::exists(string $name, int $offset = 0) : bool
 

Returns true if the passed header exists in this collection.

public ZBateson\MailMimeParser\Message\PartHeaderContainer::get(string $name, int $offset = 0) : ?ZBateson\MailMimeParser\Header\IHeader
 

Returns the IHeader object for the header with the given $name, or null if none exist.

An optional offset can be provided, which defaults to the first header in the collection when more than one header with the same name exists.

Note that mime headers aren't case sensitive.

public ZBateson\MailMimeParser\Message\PartHeaderContainer::getAll(string $name) : array
 

Returns all headers with the passed name.

  • return \IHeader[]
public ZBateson\MailMimeParser\ErrorBag::getAllErrors(bool $validate = false, string $minPsrLevel = 'error'Psr\Log\LogLevel::ERROR) : array
public ZBateson\MailMimeParser\Message\PartHeaderContainer::getAs(string $name, string $iHeaderClass, int $offset = 0) : ?ZBateson\MailMimeParser\Header\IHeader
 

Returns the IHeader object for the header with the given $name, or null if none exist, using the passed $iHeaderClass to construct it.

An optional offset can be provided, which defaults to the first header in the collection when more than one header with the same name exists.

Note that mime headers aren't case sensitive.

public ZBateson\MailMimeParser\Message\PartHeaderContainer::getErrorBagChildren() : array
public ZBateson\MailMimeParser\ErrorBag::getErrorLoggingContextName() : string
 

Returns the class name. Override to identify objects in logs.

public ZBateson\MailMimeParser\ErrorBag::getErrors(bool $validate = false, string $minPsrLevel = 'error'Psr\Log\LogLevel::ERROR) : array
public getFilename() : ?string
 

Returns the filename included in the uuencoded 'begin' line for this part.

public ZBateson\MailMimeParser\Message\PartHeaderContainer::getHeaderObjects() : array
 

Returns an array of IHeader objects representing all headers in this collection.

  • return \IHeader[]
public ZBateson\MailMimeParser\Message\PartHeaderContainer::getHeaders() : array
 

Returns an array of headers in this collection. Each returned element in the array is an array with the first element set to the name, and the second its value:

[ [ 'Header-Name', 'Header Value' ], [ 'Second-Header-Name', 'Second-Header-Value' ], // etc... ]

  • return string[][]
public ZBateson\MailMimeParser\Message\PartHeaderContainer::getIterator() : Traversable
 

Returns an iterator to the headers in this collection. Each returned element is an array with its first element set to the header's name, and the second to its value:

[ 'Header-Name', 'Header Value' ]

return Traversable<array>

public getUnixFileMode() : ?int
 

Returns the file mode included in the uuencoded 'begin' line for this part.

public ZBateson\MailMimeParser\ErrorBag::hasAnyErrors(bool $validate = false, string $minPsrLevel = 'error'Psr\Log\LogLevel::ERROR) : bool
public ZBateson\MailMimeParser\ErrorBag::hasErrors(bool $validate = false, string $minPsrLevel = 'error'Psr\Log\LogLevel::ERROR) : bool
public ZBateson\MailMimeParser\Message\PartHeaderContainer::remove(string $name, int $offset = 0) : bool
 

Removes the header from the collection with the passed name. Defaults to removing the first instance of the header for a collection that contains more than one with the same passed name.

  • return bool true if a header was found and removed.
public ZBateson\MailMimeParser\Message\PartHeaderContainer::removeAll(string $name) : bool
 

Removes all headers that match the passed name.

  • return bool true if one or more headers were removed.
public ZBateson\MailMimeParser\Message\PartHeaderContainer::set(string $name, string $value, int $offset = 0) : static
 

If a header exists with the passed name, and at the passed offset if more than one exists, its value is updated.

If a header with the passed name doesn't exist at the passed offset, it is created at the next available offset (offset is ignored when adding).

public setFilename(string $filename) : static
 

Sets the filename included in the uuencoded 'begin' line.

public setUnixFileMode(int $mode) : static
 

Sets the unix file mode for the uuencoded 'begin' line.

Properties
protected ?string $filename = NULL
 
  • var ?string the name of the file in the uuencoding 'header'.
protected ZBateson\MailMimeParser\Message\PartHeaderContainer::$headerFactory = NULL
 
  • var \HeaderFactory the HeaderFactory object used for created headers
protected Psr\Log\LoggerInterface ZBateson\MailMimeParser\ErrorBag::$logger
protected ?int $mode = NULL
 
  • var ?int the unix file permission
Methods
protected ZBateson\MailMimeParser\ErrorBag::validate() : void
 

Perform any extra validation and call 'addError'.

getErrors and getAllErrors call validate() if their $validate parameter is true. validate() is only called once on an object with getErrors getAllErrors.

© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration