FactoryCreator
Table of Contents
Constants
-
FACTORY_TEMPLATE
= <<<'EOT'
<?php
declare(strict_types=1);
namespace %s;
%s
class %sFactory implements FactoryInterface
{
/**
* @param ContainerInterface $container
* @param string $requestedName
* @param null|array $options
* @return %s
*/
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
return new %s(%s);
}
}
EOT
-
IMPORT_ALWAYS
= [\Laminas\ServiceManager\Factory\FactoryInterface::class, \Psr\Container\ContainerInterface::class]
Methods
-
createFactory()
: string
-
createArgumentString()
: string
-
createImportStatements()
: string
-
getClassName()
: string
-
getConstructorParameters()
: array<string|int, mixed>
FACTORY_TEMPLATE
public
mixed
FACTORY_TEMPLATE
= <<<'EOT'
<?php
declare(strict_types=1);
namespace %s;
%s
class %sFactory implements FactoryInterface
{
/**
* @param ContainerInterface $container
* @param string $requestedName
* @param null|array $options
* @return %s
*/
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
return new %s(%s);
}
}
EOT
IMPORT_ALWAYS
private
mixed
IMPORT_ALWAYS
= [\Laminas\ServiceManager\Factory\FactoryInterface::class, \Psr\Container\ContainerInterface::class]
createFactory()
public
createFactory(string $className) : string
Parameters
-
$className
: string
-
createArgumentString()
private
createArgumentString(string $className) : string
Parameters
-
$className
: string
-
createImportStatements()
private
createImportStatements(string $className) : string
Parameters
-
$className
: string
-
getClassName()
private
getClassName(string $className) : string
Parameters
-
$className
: string
-
getConstructorParameters()
private
getConstructorParameters(string $className) : array<string|int, mixed>
Parameters
-
$className
: string
-
Return values
array<string|int, mixed>