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.

category

System

package

Loaders

subpackage

CrossCuttingLoader

Methods

__construct

__construct() 
Throws
\BadFunctionCallException

_getCrossCuttingLoader

_getCrossCuttingLoader() : \CrossCuttingLoaderInterface
static

clearRegister

clearRegister() : void
static

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

getObject(string $p_classname) : object
static
Throws
\InvalidArgumentException

Arguments

$p_classname

string

Response

object

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

registerObject(string $p_classname, object $object) 
static
Throws
\InvalidArgumentException

Arguments

$p_classname

string

$object

object

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.

setRegisteredObjectsOnly( $bool_status) 
static

Arguments

$bool_status

useRegisteredObjectsOnly

useRegisteredObjectsOnly() : boolean
static

Response

boolean

Properties

crossCuttingLoader

crossCuttingLoader : \CrossCuttingLoaderInterface
static