Generator that creates the body of a service locator that can emulate the logic of the given Zend\Di\Di instance without class definitions

category Zend
package Zend_Di

 Methods

Constructor

__construct(\Zend\Di\Di $injector) 

Requires a DependencyInjection manager on which to operate.

Parameters

$injector

\Zend\Di\Di

Construct, configure, and return a PHP class file code generation object

getCodeGenerator(null | string $filename) : \Zend\Code\Generator\FileGenerator

Creates a Zend\Code\Generator\FileGenerator object that has created the specified class and service locator methods.

Parameters

$filename

nullstring

Exceptions

\Zend\Di\Exception\RuntimeException

Returns

Set the class name for the generated service locator container

setContainerClass(string $name) : \Zend\Di\ServiceLocator\Generator

Parameters

$name

string

Returns

Set the namespace to use for the generated class file

setNamespace(string $namespace) : \Zend\Di\ServiceLocator\Generator

Parameters

$namespace

string

Returns

Create a PhpMethod code generation object named after a given alias

getCodeGenMethodFromAlias(string $alias, string $class) : \Zend\Code\Generator\MethodGenerator

Parameters

$alias

string

$class

string

Class to which alias refers

Returns

Normalize an alias to a getter method name

normalizeAlias(string $alias) : string

Parameters

$alias

string

Returns

string

Reduces aliases

reduceAliases(array $aliasList) : array

Takes alias list and reduces it to a 2-dimensional array of class names pointing to an array of aliases that resolve to it.

Parameters

$aliasList

array

Returns

array

 Properties

 

$containerClass

$containerClass 

   

$namespace

$namespace : null | string