public
|
#
__construct( string $file )
(PHP 5)
Constructs a ReflectionClass from file
(PHP 5)
Constructs a ReflectionClass from file
Parameters
- $file
Either a string containing the name of the class to
reflect, or an object.
Link
|
public
|
#
__toString( )
Implementation of
Reflector::__toString()
|
public static
string
|
#
export( mixed $argument,…, boolean $return,… )
(PHP 5)
Exports a class
Parameters
- $argument,…
The reflection to export.
- $return,…
[optional]
Setting to TRUE will return the export,
as opposed to emitting it. Setting to FALSE (the default) will do the opposite.
Returns
string If the return parameter
is set to TRUE, then the export is returned as a string,
otherwise NULL is returned.
Link
Implementation of
Reflector::export()
|
public
string
|
#
getName( )
(PHP 5)
Gets class name
Returns
string The class name.
Link
|
public
boolean
|
#
isInternal( )
(PHP 5)
Checks if class is defined internally by an extension, or the core
(PHP 5)
Checks if class is defined internally by an extension, or the core
Returns
boolean TRUE on success or FALSE on failure.
Link
|
public
boolean
|
#
isUserDefined( )
(PHP 5)
Checks if user defined
(PHP 5)
Checks if user defined
Returns
boolean TRUE on success or FALSE on failure.
Link
|
public
boolean
|
#
isInstantiable( )
(PHP 5)
Checks if the class is instantiable
(PHP 5)
Checks if the class is instantiable
Returns
boolean TRUE on success or FALSE on failure.
Link
|
public
boolean
|
#
isCloneable( )
(PHP >= 5.4.0)
Returns whether this class is cloneable
(PHP >= 5.4.0)
Returns whether this class is cloneable
Returns
boolean TRUE if the class is cloneable, FALSE otherwise.
Link
|
public
string
|
#
getFileName( )
(PHP 5)
Gets the filename of the file in which the class has been defined
(PHP 5)
Gets the filename of the file in which the class has been defined
Returns
string the filename of the file in which the class has been defined.
If the class is defined in the PHP core or in a PHP extension, FALSE
is returned.
Link
|
public
integer
|
#
getStartLine( )
(PHP 5)
Gets starting line number
(PHP 5)
Gets starting line number
Returns
integer The starting line number, as an integer.
Link
|
public
integer
|
#
getEndLine( )
(PHP 5)
Gets end line
Returns
integer The ending line number of the user defined class, or FALSE if unknown.
Link
|
public
ReflectionMethod
|
#
getConstructor( )
(PHP 5)
Gets the constructor of the class
(PHP 5)
Gets the constructor of the class
Returns
ReflectionMethod A ReflectionMethod object reflecting the class' constructor, or NULL if the class
has no constructor.
Link
|
public
boolean
|
#
hasMethod( string $name )
(PHP 5 >= 5.1.0)
Checks if method is defined
(PHP 5 >= 5.1.0)
Checks if method is defined
Parameters
- $name
Name of the method being checked for.
Returns
boolean TRUE if it has the method, otherwise FALSE
Link
|
public
ReflectionMethod
|
#
getMethod( string $name )
(PHP 5)
Gets a ReflectionMethod for a class method.
(PHP 5)
Gets a ReflectionMethod for a class method.
Parameters
- $name
The method name to reflect.
Returns
ReflectionMethod A ReflectionMethod.
Link
|
public
array
|
#
getMethods( integer $filter = null )
(PHP 5)
Gets an array of methods
(PHP 5)
Gets an array of methods
Parameters
- $filter
[optional]
Filter the results to include only methods with certain attributes. Defaults
to no filtering.
Any combination of ReflectionMethod::IS_STATIC,
ReflectionMethod::IS_PUBLIC,
ReflectionMethod::IS_PROTECTED,
ReflectionMethod::IS_PRIVATE,
ReflectionMethod::IS_ABSTRACT,
ReflectionMethod::IS_FINAL.
Returns
array An array of ReflectionMethod objects
reflecting each method.
Link
|
public
boolean
|
#
hasProperty( string $name )
(PHP 5 >= 5.1.0)
Checks if property is defined
(PHP 5 >= 5.1.0)
Checks if property is defined
Parameters
- $name
Name of the property being checked for.
Returns
boolean TRUE if it has the property, otherwise FALSE
Link
|
public
ReflectionProperty
|
#
getProperty( string $name )
(PHP 5)
Gets a ReflectionProperty for a class's property
(PHP 5)
Gets a ReflectionProperty for a class's property
Parameters
Returns
ReflectionProperty A ReflectionProperty.
Link
|
public
array
|
#
getProperties( integer $filter = null )
(PHP 5)
Gets properties
Parameters
- $filter
[optional]
The optional filter, for filtering desired property types. It's configured using
the ReflectionProperty constants,
and defaults to all property types.
Returns
array An array of ReflectionProperty objects.
Link
|
public
boolean
|
#
hasConstant( string $name )
(PHP 5 >= 5.1.0)
Checks if constant is defined
(PHP 5 >= 5.1.0)
Checks if constant is defined
Parameters
- $name
The name of the constant being checked for.
Returns
boolean TRUE if the constant is defined, otherwise FALSE.
Link
|
public
array
|
#
getConstants( )
(PHP 5)
Gets constants
Returns
array An array of constants.
Constant name in key, constant value in value.
Link
|
public
mixed
|
#
getConstant( string $name )
(PHP 5)
Gets defined constant
(PHP 5)
Gets defined constant
Parameters
- $name
Name of the constant.
Returns
mixed Value of the constant.
Link
|
public
array
|
#
getInterfaces( )
(PHP 5)
Gets the interfaces
(PHP 5)
Gets the interfaces
Returns
array An associative array of interfaces, with keys as interface
names and the array values as ReflectionClass objects.
Link
|
public
array
|
#
getInterfaceNames( )
(PHP 5 >= 5.2.0)
Gets the interface names
(PHP 5 >= 5.2.0)
Gets the interface names
Returns
array A numerical array with interface names as the values.
Link
|
public
boolean
|
#
isInterface( )
(PHP 5)
Checks if the class is an interface
(PHP 5)
Checks if the class is an interface
Returns
boolean TRUE on success or FALSE on failure.
Link
|
public
array
|
#
getTraits( )
(PHP >= 5.4.0)
Returns an array of traits used by this class
(PHP >= 5.4.0)
Returns an array of traits used by this class
Returns
array an array with trait names in keys and instances of trait's
ReflectionClass in values.
Returns NULL in case of an error.
Link
|
public
array
|
#
getTraitNames( )
(PHP >= 5.4.0)
Returns an array of names of traits used by this class
(PHP >= 5.4.0)
Returns an array of names of traits used by this class
Returns
array an array with trait names in values.
Returns NULL in case of an error.
Link
|
public
array
|
#
getTraitAliases( )
(PHP >= 5.4.0)
Returns an array of trait aliases
(PHP >= 5.4.0)
Returns an array of trait aliases
Returns
array an array with new method names in keys and original names (in the
format "TraitName::original") in values.
Returns NULL in case of an error.
Link
|
public
boolean
|
#
isTrait( )
(PHP >= 5.4.0)
Returns whether this is a trait
(PHP >= 5.4.0)
Returns whether this is a trait
Returns
boolean TRUE if this is a trait, FALSE otherwise.
Returns NULL in case of an error.
Link
|
public
boolean
|
#
isAbstract( )
(PHP 5)
Checks if class is abstract
(PHP 5)
Checks if class is abstract
Returns
boolean TRUE on success or FALSE on failure.
Link
|
public
boolean
|
#
isFinal( )
(PHP 5)
Checks if class is final
(PHP 5)
Checks if class is final
Returns
boolean TRUE on success or FALSE on failure.
Link
|
public
integer
|
#
getModifiers( )
(PHP 5)
Gets modifiers
Returns
integer bitmask of
modifier constants.
Link
|
public
boolean
|
#
isInstance( object $object )
(PHP 5)
Checks class for instance
(PHP 5)
Checks class for instance
Parameters
- $object
The object being compared to.
Returns
boolean TRUE on success or FALSE on failure.
Link
|
public
object
|
#
newInstance( mixed $args, mixed $_ = null )
(PHP 5)
Creates a new class instance from given arguments.
(PHP 5)
Creates a new class instance from given arguments.
Parameters
- $args
Accepts a variable number of arguments which are passed to the class
constructor, much like call_user_func.
- $_
- [optional]
Returns
object
Link
|
public
object
|
#
newInstanceWithoutConstructor( )
(PHP >= 5.4.0)
Creates a new class instance without invoking the constructor.
(PHP >= 5.4.0)
Creates a new class instance without invoking the constructor.
Returns
object
Link
|
public
object
|
#
newInstanceArgs( array $args = null )
(PHP 5 >= 5.1.3)
Creates a new class instance from given arguments.
(PHP 5 >= 5.1.3)
Creates a new class instance from given arguments.
Parameters
- $args
[optional]
The parameters to be passed to the class constructor as an array.
Returns
object a new instance of the class.
Link
|
public
object
|
#
getParentClass( )
(PHP 5)
Gets parent class
(PHP 5)
Gets parent class
Returns
object A ReflectionClass.
Link
|
public
boolean
|
#
isSubclassOf( string $class )
(PHP 5)
Checks if a subclass
(PHP 5)
Checks if a subclass
Parameters
- $class
The class name being checked against.
Returns
boolean TRUE on success or FALSE on failure.
Link
|
public
array
|
#
getStaticProperties( )
(PHP 5)
Gets static properties
(PHP 5)
Gets static properties
Returns
array The static properties, as an array.
Link
|
public
mixed
|
#
getStaticPropertyValue( string $name, mixed & $def_value = null )
(PHP 5 >= 5.1.0)
Gets static property value
(PHP 5 >= 5.1.0)
Gets static property value
Parameters
- $name
The name of the static property for which to return a value.
- $def_value
[optional]
Returns
mixed The value of the static property.
Link
|
public
|
#
setStaticPropertyValue( string $name, string $value )
(PHP 5 >= 5.1.0)
Sets static property value
(PHP 5 >= 5.1.0)
Sets static property value
Parameters
- $name
Property name.
- $value
New property value.
Returns
No value is returned.
Link
|
public
array
|
#
getDefaultProperties( )
(PHP 5)
Gets default properties
(PHP 5)
Gets default properties
Returns
array An array of default properties, with the key being the name of
the property and the value being the default value of the property or NULL
if the property doesn't have a default value. The function does not distinguish
between static and non static properties and does not take visibility modifiers
into account.
Link
|
public
boolean
|
#
isIterateable( )
(PHP 5)
Checks if iterateable
(PHP 5)
Checks if iterateable
Returns
boolean TRUE on success or FALSE on failure.
Link
|
public
boolean
|
#
implementsInterface( string $interface )
(PHP 5)
Implements interface
(PHP 5)
Implements interface
Parameters
- $interface
The interface name.
Returns
boolean TRUE on success or FALSE on failure.
Link
|
public
ReflectionExtension
|
#
getExtension( )
(PHP 5)
Gets a ReflectionExtension object for the extension which defined the class
(PHP 5)
Gets a ReflectionExtension object for the extension which defined the class
Returns
ReflectionExtension A ReflectionExtension object representing the extension which defined the class,
or NULL for user-defined classes.
Link
|
public
string
|
#
getExtensionName( )
(PHP 5)
Gets the name of the extension which defined the class
(PHP 5)
Gets the name of the extension which defined the class
Returns
string The name of the extension which defined the class, or FALSE for user-defined classes.
Link
|
public
boolean
|
#
inNamespace( )
(PHP 5 >= 5.3.0)
Checks if in namespace
(PHP 5 >= 5.3.0)
Checks if in namespace
Returns
boolean TRUE on success or FALSE on failure.
Link
|
public
string
|
#
getNamespaceName( )
(PHP 5 >= 5.3.0)
Gets namespace name
(PHP 5 >= 5.3.0)
Gets namespace name
Returns
string The namespace name.
Link
|
public
string
|
#
getShortName( )
(PHP 5 >= 5.3.0)
Gets short name
(PHP 5 >= 5.3.0)
Gets short name
Returns
string The class short name.
Link
|