CompositeWaiterFactory
in package
implements
WaiterFactoryInterface
Factory that utilizes multiple factories for creating waiters
Table of Contents
Interfaces
- WaiterFactoryInterface
- Waiter factory used to create waiter objects by short names
Properties
- $factories : array<string|int, mixed>
Methods
- __construct() : mixed
- addFactory() : self
- Add a factory to the composite factory
- build() : WaiterInterface
- Create a waiter by name
- canBuild() : bool
- Check if the factory can create a waiter by a specific name
- getFactory() : WaiterFactoryInterface|bool
- Get the factory that matches the waiter name
Properties
$factories
protected
array<string|int, mixed>
$factories
Array of factories
Methods
__construct()
public
__construct(array<string|int, mixed> $factories) : mixed
Parameters
- $factories : array<string|int, mixed>
-
Array of factories used to instantiate waiters
addFactory()
Add a factory to the composite factory
public
addFactory(WaiterFactoryInterface $factory) : self
Parameters
- $factory : WaiterFactoryInterface
-
Factory to add
Return values
selfbuild()
Create a waiter by name
public
build(mixed $waiter) : WaiterInterface
Parameters
- $waiter : mixed
-
Name of the waiter to create
Return values
WaiterInterfacecanBuild()
Check if the factory can create a waiter by a specific name
public
canBuild(mixed $waiter) : bool
Parameters
- $waiter : mixed
-
Name of the waiter to check
Return values
boolgetFactory()
Get the factory that matches the waiter name
protected
getFactory(string $waiter) : WaiterFactoryInterface|bool
Parameters
- $waiter : string
-
Name of the waiter