Collection

Extends \ArrayObject

A collection of Writer objects.

In this collection we can receive writers, and if they implement the Routable interface assign the router queue that was provided to this class so that those writers can generate urls for various Descriptors.

In addition this class can also verify if all requirements for the various writers in it are met.

package

Default

Methods

Initializes this writer collection with the necessary requirements.

__construct(\phpDocumentor\Transformer\Router\Queue $routers) 

Arguments

$routers

\phpDocumentor\Transformer\Router\Queue

A series of routers, in order of importance, that are used to generate urls with.

Iterates over each writer in this collection and checks its requirements.

checkRequirements() : void
Throws
\phpDocumentor\Transformer\Writer\Exception\RequirementMissing

if a requirement of a writer is missing.

Retrieves a writer from the collection.

offsetGet(string $index) : \phpDocumentor\Transformer\Writer\WriterAbstract
Throws
\InvalidArgumentException

if the writer is not in the collection.

Arguments

$index

string

the name of the writer to retrieve.

Response

\phpDocumentor\Transformer\Writer\WriterAbstract

Registers a writer with a given name.

offsetSet(string $index, \phpDocumentor\Transformer\Writer\WriterAbstract $newval) : void
Throws
\InvalidArgumentException

if either of the above restrictions is not met.

Arguments

$index

string

a Writer's name, must be at least 3 characters, alphanumeric and/or contain one or more hyphens, underscores and forward slashes.

$newval

\phpDocumentor\Transformer\Writer\WriterAbstract

The Writer object to register to this name.

Properties

A series of routers, in order of importance, that are used to generate urls with

routers : \phpDocumentor\Transformer\Router\Queue
var

A series of routers, in order of importance, that are used to generate urls with

Type(s)

\phpDocumentor\Transformer\Router\Queue