PHP Class BetterReflection\Reflection\ReflectionObject

Inheritance: extends ReflectionClass
Show file Open project: roave/better-reflection Class Usage Examples

Public Methods

Method Description
__clone ( )
addMethod ( $methodName )
addProperty ( $methodName, $visibility = 'public', $static = false )
createFromInstance ( object $object ) : ReflectionClass Pass an instance of an object to this method to reflect it
createFromName ( $className ) Cannot instantiate this way, use ReflectionObject::createFromInstance
createFromNode ( BetterReflection\Reflector\Reflector $reflector, ClassLike $node, BetterReflection\SourceLocator\Located\LocatedSource $locatedSource, Namespace_ $namespace = null ) Cannot instantiate this way, use ReflectionObject::createFromInstance
export ( object $instance = null ) : string Create a reflection and return the string representation of a class instance
getAst ( )
getConstant ( $name )
getConstants ( )
getConstructor ( )
getDefaultProperties ( )
getDocComment ( )
getEndLine ( )
getFileName ( )
getImmediateInterfaces ( )
getImmediateMethods ( )
getInterfaceNames ( )
getInterfaces ( )
getLocatedSource ( )
getMethod ( $methodName )
getMethods ( )
getModifiers ( )
getName ( )
getNamespaceName ( )
getParentClass ( )
getProperties ( )
getProperty ( $name )
getShortName ( )
getStartLine ( )
getStaticPropertyValue ( $propertyName )
getTraitAliases ( )
getTraitNames ( )
getTraits ( )
hasConstant ( $name )
hasMethod ( $methodName )
hasProperty ( $name )
implementsInterface ( $interfaceName )
inNamespace ( )
isAbstract ( )
isCloneable ( )
isFinal ( )
isInstance ( $object )
isInstantiable ( )
isInterface ( )
isInternal ( )
isIterateable ( )
isSubclassOf ( $className )
isTrait ( )
isUserDefined ( )
removeMethod ( $methodName )
removeProperty ( $methodName )
setFinal ( $isFinal )
setStaticPropertyValue ( $propertyName, $value )

Private Methods

Method Description
__construct ( BetterReflection\Reflector\Reflector $reflector, ReflectionClass $reflectionClass, $object )
createPropertyNodeFromReflection ( ReflectionProperty $property, object $instance ) : Property Create an AST PropertyNode given a reflection
getRuntimeProperties ( ) : ReflectionProperty[] Reflect on runtime properties for the current instance

Method Details

__clone() public method

public __clone ( )

addMethod() public method

public addMethod ( $methodName )

addProperty() public method

public addProperty ( $methodName, $visibility = 'public', $static = false )

createFromInstance() public static method

Pass an instance of an object to this method to reflect it
public static createFromInstance ( object $object ) : ReflectionClass
$object object
return ReflectionClass

createFromName() public static method

Cannot instantiate this way, use ReflectionObject::createFromInstance
public static createFromName ( $className )

createFromNode() public static method

Cannot instantiate this way, use ReflectionObject::createFromInstance
public static createFromNode ( BetterReflection\Reflector\Reflector $reflector, ClassLike $node, BetterReflection\SourceLocator\Located\LocatedSource $locatedSource, Namespace_ $namespace = null )
$reflector BetterReflection\Reflector\Reflector
$node PhpParser\Node\Stmt\ClassLike
$locatedSource BetterReflection\SourceLocator\Located\LocatedSource
$namespace PhpParser\Node\Stmt\Namespace_

export() public static method

Create a reflection and return the string representation of a class instance
public static export ( object $instance = null ) : string
$instance object
return string

getAst() public method

public getAst ( )

getConstant() public method

public getConstant ( $name )

getConstants() public method

public getConstants ( )

getConstructor() public method

public getConstructor ( )

getDefaultProperties() public method

getDocComment() public method

public getDocComment ( )

getEndLine() public method

public getEndLine ( )

getFileName() public method

public getFileName ( )

getImmediateInterfaces() public method

getImmediateMethods() public method

public getImmediateMethods ( )

getInterfaceNames() public method

public getInterfaceNames ( )

getInterfaces() public method

public getInterfaces ( )

getLocatedSource() public method

public getLocatedSource ( )

getMethod() public method

public getMethod ( $methodName )

getMethods() public method

public getMethods ( )

getModifiers() public method

public getModifiers ( )

getName() public method

public getName ( )

getNamespaceName() public method

public getNamespaceName ( )

getParentClass() public method

public getParentClass ( )

getProperties() public method

public getProperties ( )

getProperty() public method

public getProperty ( $name )

getShortName() public method

public getShortName ( )

getStartLine() public method

public getStartLine ( )

getStaticPropertyValue() public method

public getStaticPropertyValue ( $propertyName )

getTraitAliases() public method

public getTraitAliases ( )

getTraitNames() public method

public getTraitNames ( )

getTraits() public method

public getTraits ( )

hasConstant() public method

public hasConstant ( $name )

hasMethod() public method

public hasMethod ( $methodName )

hasProperty() public method

public hasProperty ( $name )

implementsInterface() public method

public implementsInterface ( $interfaceName )

inNamespace() public method

public inNamespace ( )

isAbstract() public method

public isAbstract ( )

isCloneable() public method

public isCloneable ( )

isFinal() public method

public isFinal ( )

isInstance() public method

public isInstance ( $object )

isInstantiable() public method

public isInstantiable ( )

isInterface() public method

public isInterface ( )

isInternal() public method

public isInternal ( )

isIterateable() public method

public isIterateable ( )

isSubclassOf() public method

public isSubclassOf ( $className )

isTrait() public method

public isTrait ( )

isUserDefined() public method

public isUserDefined ( )

removeMethod() public method

public removeMethod ( $methodName )

removeProperty() public method

public removeProperty ( $methodName )

setFinal() public method

public setFinal ( $isFinal )

setStaticPropertyValue() public method

public setStaticPropertyValue ( $propertyName, $value )