Documentation

Mirror
in package

A utility class for getting Reflectors.

Table of Contents

CONSTANT  = 1
METHOD  = 2
PROPERTY  = 8
STATIC_PROPERTY  = 4
get()  : Reflector
Get a Reflector for a function, class or instance, constant, method or property.
getClass()  : ReflectionClass
Get a ReflectionClass (or ReflectionObject) if possible.

Constants

CONSTANT

public mixed CONSTANT = 1

PROPERTY

public mixed PROPERTY = 8

STATIC_PROPERTY

public mixed STATIC_PROPERTY = 4

Methods

get()

Get a Reflector for a function, class or instance, constant, method or property.

public static get(mixed $value[, string $member = null ][, int $filter = 15 ]) : Reflector

Optionally, pass a $filter param to restrict the types of members checked. For example, to only Reflectors for static properties and constants, pass:

$filter = Mirror::CONSTANT | Mirror::STATIC_PROPERTY

Parameters
$value : mixed

Class or function name, or variable instance

$member : string = null

Optional: property, constant or method name (default: null)

$filter : int = 15

(default: CONSTANT | METHOD | PROPERTY | STATIC_PROPERTY)

Tags
throws
RuntimeException

when a $member specified but not present on $value

throws
InvalidArgumentException

if $value is something other than an object or class/function name

Return values
Reflector

getClass()

Get a ReflectionClass (or ReflectionObject) if possible.

private static getClass(mixed $value) : ReflectionClass
Parameters
$value : mixed
Tags
throws
InvalidArgumentException

if $value is not a class name or instance

Return values
ReflectionClass

Search results