AssemblerFactory

in package

Attempts to retrieve an Assembler for the provided criteria.

Properties

protected$assemblers  : \phpDocumentor\Descriptor\Builder\AssemblerMatcher[]                

protected$fallbackAssemblers  : \phpDocumentor\Descriptor\Builder\AssemblerMatcher[]                

Methods

Registers an assembler instance to this factory.

publicregister(callable $matcher, AssemblerInterface $assembler) : void

Parameters

$matcher : callable

A callback function accepting the criteria as only parameter and which must return a boolean.

$assembler : AssemblerInterface

An instance of the Assembler that will be returned if the callback returns true with the provided criteria.

Registers an assembler instance to this factory that is to be executed after all other assemblers have been checked.

publicregisterFallback(callable $matcher, AssemblerInterface $assembler) : void

Parameters

$matcher : callable

A callback function accepting the criteria as only parameter and which must return a boolean.

$assembler : AssemblerInterface

An instance of the Assembler that will be returned if the callback returns true with the provided criteria.

Retrieves a matching Assembler based on the provided criteria or null if none was found.

publicget(mixed $criteria) : AssemblerInterface|null

Parameters

$criteria : mixed

Returns

AssemblerInterface|null

publicstaticcreateDefault(ExampleFinder $exampleFinder) : self

Parameters

$exampleFinder : ExampleFinder

Returns

self