PHP Class PhpBench\Registry\Registry

Lazily instantiates tagged services which are associated with a name and stores configurations which are relevant to these services. $reg->getService($config['renderer']); $reg->render($something, $config);
Show file Open project: dantleech/phpbench Class Usage Examples

Protected Properties

Property Type Description
$serviceType

Public Methods

Method Description
__construct ( $serviceType, PhpBench\DependencyInjection\Container $container, $defaultService = null )
getService ( string $name = null ) : object Return the named service, lazily creating it from the container if it has not yet been accessed.
registerService ( string $name, string $serviceId ) Register a service ID with against the given name.
setService ( string $name, object $object ) Directly set a named service.

Private Methods

Method Description
assertServiceExists ( $name )

Method Details

__construct() public method

public __construct ( $serviceType, PhpBench\DependencyInjection\Container $container, $defaultService = null )
$container PhpBench\DependencyInjection\Container

getService() public method

Return the named service, lazily creating it from the container if it has not yet been accessed.
public getService ( string $name = null ) : object
$name string
return object

registerService() public method

Register a service ID with against the given name.
public registerService ( string $name, string $serviceId )
$name string
$serviceId string

setService() public method

Directly set a named service.
public setService ( string $name, object $object )
$name string
$object object

Property Details

$serviceType protected property

protected $serviceType