FactoryCreator
Table of Contents
-
FACTORY_TEMPLATE
= <<<'EOT'
<?php
namespace %s;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\Factory\FactoryInterface;
use %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
-
createFactory()
: string
-
createArgumentString()
: string
-
getClassName()
: string
-
getConstructorParameters()
: array<string|int, mixed>
FACTORY_TEMPLATE
public
mixed
FACTORY_TEMPLATE
= <<<'EOT'
<?php
namespace %s;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\Factory\FactoryInterface;
use %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
createFactory()
public
createFactory(string $className) : string
Parameters
-
$className
: string
-
Return values
string
—
createArgumentString()
private
createArgumentString(string $className) : string
Parameters
-
$className
: string
-
Return values
string
—
getClassName()
private
getClassName( $className) : string
Parameters
-
$className
:
-
Return values
string
—
getConstructorParameters()
private
getConstructorParameters(string $className) : array<string|int, mixed>
Parameters
-
$className
: string
-
Return values
array<string|int, mixed>
—