WaiterClassFactory
in package
implements
WaiterFactoryInterface
Factory for creating {@see WaiterInterface} objects using a convention of storing waiter classes in the Waiter folder of a client class namespace using a snake_case to CamelCase conversion (e.g. camel_case => CamelCase).
Table of Contents
Interfaces
- WaiterFactoryInterface
- Waiter factory used to create waiter objects by short names
Properties
- $inflector : InflectorInterface
- $namespaces : array<string|int, mixed>
Methods
- __construct() : mixed
- build() : WaiterInterface
- Create a waiter by name
- canBuild() : bool
- Check if the factory can create a waiter by a specific name
- registerNamespace() : self
- Registers a namespace to check for Waiters
- getClassName() : string|null
- Get the name of a waiter class
Properties
$inflector
protected
InflectorInterface
$inflector
Inflector used to inflect class names
$namespaces
protected
array<string|int, mixed>
$namespaces
List of namespaces used to look for classes
Methods
__construct()
public
__construct([array<string|int, mixed>|string $namespaces = array() ][, InflectorInterface $inflector = null ]) : mixed
Parameters
- $namespaces : array<string|int, mixed>|string = array()
-
Namespaces of waiter objects
- $inflector : InflectorInterface = null
-
Inflector used to resolve class names
build()
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
boolregisterNamespace()
Registers a namespace to check for Waiters
public
registerNamespace(string $namespace) : self
Parameters
- $namespace : string
-
Namespace which contains Waiter classes
Return values
selfgetClassName()
Get the name of a waiter class
protected
getClassName(string $waiter) : string|null
Parameters
- $waiter : string
-
Waiter name