phpDocumentor

AssemblerFactory
in package

Attempts to retrieve an Assembler for the provided criteria.

Table of Contents

Properties

$assemblers  : array<string|int, AssemblerMatcher>
$fallbackAssemblers  : array<string|int, AssemblerMatcher>

Methods

createDefault()  : self
get()  : AssemblerInterface<TParamDescriptor, TParamInput>|null
Retrieves a matching Assembler based on the provided criteria or null if none was found.
register()  : void
Registers an assembler instance to this factory.
registerFallback()  : void
Registers an assembler instance to this factory that is to be executed after all other assemblers have been checked.

Properties

Methods

createDefault()

public static createDefault(ExampleFinder $exampleFinder) : self
Parameters
$exampleFinder : ExampleFinder
Return values
self

get()

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

public get(TParamInput $criteria, TParamDescriptor> $type) : AssemblerInterface<TParamDescriptor, TParamInput>|null
Parameters
$criteria : TParamInput
$type : TParamDescriptor>
Tags
psalm-template

TParamInput of object

psalm-template

TParamDescriptor of Descriptor

Return values
AssemblerInterface<TParamDescriptor, TParamInput>|null

register()

Registers an assembler instance to this factory.

public register(Matcher<string|int, object> $matcher, AssemblerInterface<Descriptor, object> $assembler) : void
Parameters
$matcher : Matcher<string|int, object>

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

$assembler : AssemblerInterface<Descriptor, object>

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

registerFallback()

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

public registerFallback(Matcher<string|int, object> $matcher, AssemblerInterface<Descriptor, object> $assembler) : void
Parameters
$matcher : Matcher<string|int, object>

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

$assembler : AssemblerInterface<Descriptor, object>

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


        
On this page

Search results