| Current Path : /srv/web/sites/trentinoplant.it/httpdocs/vendor1/laminas/laminas-di/templates/ |
| Current File : /srv/web/sites/trentinoplant.it/httpdocs/vendor1/laminas/laminas-di/templates/factory.template |
<?php
/**
* Generated factory for %class%
*/
declare(strict_types=1);
%namespace%
use Laminas\Di\CodeGenerator\FactoryInterface;
use Psr\Container\ContainerInterface;
%use_array_key_exists%
use function is_array;
/**
* @template-implements FactoryInterface<%class%>
*/
final class %factory_class% implements FactoryInterface
{
public function create(ContainerInterface $container, array $options = []): %class%
{%options_to_args_code%%psalm_suppress%
return new %class%(%args%);
}
/**
* @param array<mixed>|string|null $name
* @param array<mixed>|null $options
*/
public function __invoke(ContainerInterface $container, $name = null, array $options = null): %class%
{
if (is_array($name) && $options === null) {
$options = $name;
}
return $this->create($container, $options ?? []);
}
}