Fully Qualified Name: | Laminas\Log\Writer\Factory\WriterFactory |
Implements: | FactoryInterface |
Factory for instantiating classes with no dependencies or which accept a single array.
The WriterFactory can be used for any class that:
It replaces the "invokables" and "invokable class" functionality of the v2 service manager, and can also be used in v2 code for forwards compatibility with v3.
Name | Description | Defined By |
---|---|---|
__construct() | WriterFactory | |
__invoke() | Create an instance of the requested class name. | WriterFactory |
createService() | Create an instance of the named service. | WriterFactory |
setCreationOptions() | {@inheritdoc} | WriterFactory |
Parameter Name | Type | Description |
---|---|---|
$creationOptions | array |
Returns:
Create an instance of the requested class name.
Parameter Name | Type | Description |
---|---|---|
$container | \ContainerInterface | |
$requestedName | string | |
$options | null|array |
Returns: object
Create an instance of the named service.
First, it checks if $canonicalName
resolves to a class, and, if so, uses
that value to proxy to __invoke()
.
Next, if $requestedName
is non-empty and resolves to a class, this
method uses that value to proxy to __invoke()
.
Finally, if the above each fail, it raises an exception.
The approach above is performed as version 2 has two distinct behaviors under which factories are invoked:
Parameter Name | Type | Description |
---|---|---|
$serviceLocator | \ServiceLocatorInterface | |
$canonicalName | null|string | |
$requestedName | null|string |
Returns: object
{@inheritdoc}
Parameter Name | Type | Description |
---|---|---|
$creationOptions |
Returns: