phpDocumentor

StaticCrossCuttingLoader

Class StaticCrossCuttingLoader

This class wraps the CrossCuttingLoader for static use.

CrossCuttingLoader enables loading of mockable objects for cross cutting concerns, that were not injected to the current object.

Tags
category

System

subpackage

CrossCuttingLoader

Table of Contents

$crossCuttingLoader  : CrossCuttingLoaderInterface
__construct()  : mixed
clearRegister()  : void
getObject()  : object
In strict mode ($crossCuttingLoader->strictModeEnabled=true) this method accepts classes with implemented CrossCuttingObjectInterface only. Otherwise it throws an InvalidArgumentException.
registerObject()  : mixed
In strict mode ($crossCuttingLoader->strictModeEnabled=true) this method accepts classes with implemented CrossCuttingObjectInterface only. Otherwise it throws an InvalidArgumentException.
setRegisteredObjectsOnly()  : mixed
If RegisteredObjectsOnly is enabled, the loader returns only objects, that were registered by the registerObject method before. RegisteredObjectsOnly should be enabled in all unit tests.
useRegisteredObjectsOnly()  : bool
_getCrossCuttingLoader()  : CrossCuttingLoaderInterface

Properties

Methods

getObject()

In strict mode ($crossCuttingLoader->strictModeEnabled=true) this method accepts classes with implemented CrossCuttingObjectInterface only. Otherwise it throws an InvalidArgumentException.

public static getObject(string $p_classname) : object
Parameters
$p_classname : string
Tags
throws
InvalidArgumentException
Return values
object

registerObject()

In strict mode ($crossCuttingLoader->strictModeEnabled=true) this method accepts classes with implemented CrossCuttingObjectInterface only. Otherwise it throws an InvalidArgumentException.

public static registerObject(string $p_classname, object $object) : mixed
Parameters
$p_classname : string
$object : object
Tags
throws
InvalidArgumentException
Return values
mixed

setRegisteredObjectsOnly()

If RegisteredObjectsOnly is enabled, the loader returns only objects, that were registered by the registerObject method before. RegisteredObjectsOnly should be enabled in all unit tests.

public static setRegisteredObjectsOnly( $bool_status) : mixed
Parameters
$bool_status :
Return values
mixed

Search results