Class 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.

Methods summary

public __construct( void )
public static getObject( string $p_classname ) : object

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

public static useRegisteredObjectsOnly( void ) : boolean
public static setRegisteredObjectsOnly( $bool_status )

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 registerObject( string $p_classname, object $object )

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

public static clearRegister( void ) :

Properties summary