PHP Class Instantiator\Instantiator

Author: Marco Pivetta ([email protected])
Inheritance: implements instantiator\InstantiatorInterface
Show file Open project: ocramius/instantiator Class Usage Examples

Public Methods

Method Description
__construct ( ) Constructor.
buildFactory ( string $className ) : Closure
instantiate ( $className ) {@inheritDoc}
isSafeToClone ( ReflectionClass $class ) : boolean Checks if a class is cloneable

Private Methods

Method Description
attemptInstantiationViaUnSerialization ( ReflectionClass $reflectionClass, string $serializedString ) : void
getCloneablesMap ( ) : LazyMap\CallbackLazyMap Builds or fetches the cloneables map
getInstantiatorsMap ( ) : LazyMap\CallbackLazyMap Builds or fetches the instantiators map
getReflectionClass ( string $className ) : ReflectionClass
getSerializationFormat ( ReflectionClass $reflectionClass ) : string Verifies if the given PHP version implements the Serializable interface serialization with an incompatible serialization format. If that's the case, use serialization marker "C" instead of "O".
hasInternalAncestors ( ReflectionClass $reflectionClass ) : boolean Verifies whether the given class is to be considered internal
isInstantiableViaReflection ( ReflectionClass $reflectionClass ) : boolean
isPhpVersionWithBrokenSerializationFormat ( ) : boolean Checks whether the current PHP runtime uses an incompatible serialization format

Method Details

__construct() public method

Constructor.
public __construct ( )

buildFactory() public method

public buildFactory ( string $className ) : Closure
$className string
return Closure

instantiate() public method

{@inheritDoc}
public instantiate ( $className )

isSafeToClone() public method

Checks if a class is cloneable
public isSafeToClone ( ReflectionClass $class ) : boolean
$class ReflectionClass
return boolean