HumHub Documentation (unofficial)

FactoryCreator
in package

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>

Constants

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]

Methods

createFactory()

public createFactory(string $className) : string
Parameters
$className : string
Return values
string

createArgumentString()

private createArgumentString(string $className) : string
Parameters
$className : string
Return values
string

createImportStatements()

private createImportStatements(string $className) : string
Parameters
$className : string
Return values
string

getClassName()

private getClassName(string $className) : string
Parameters
$className : string
Return values
string

getConstructorParameters()

private getConstructorParameters(string $className) : array<string|int, mixed>
Parameters
$className : string
Return values
array<string|int, mixed>

        
On this page

Search results