Since: 8.0

class ReflectionAttribute implements Reflector (View source)

Constants

IS_INSTANCEOF Since: 8.0

Indicates that the search for a suitable attribute should not be by strict comparison, but by the inheritance chain.

Used for the argument of flags of the "getAttribute" method.

Properties

string $name

Methods

string
getName()

Gets attribute name

int
getTarget()

Returns the target of the attribute as a bit mask format.

bool
isRepeated()

Returns {true} if the attribute is repeated.

array
getArguments()

Gets list of passed attribute's arguments.

object
newInstance()

Creates a new instance of the attribute with passed arguments

string
__toString()

Returns the string representation of any Reflection object.

static string|null
export()

Exports a class.

Details

string getName()

Since: 8.0

Gets attribute name

Return Value

string

The name of the attribute parameter.

int getTarget()

Since: 8.0

Returns the target of the attribute as a bit mask format.

Return Value

int

bool isRepeated()

Since: 8.0

Returns {true} if the attribute is repeated.

Return Value

bool

array getArguments()

Since: 8.0

Gets list of passed attribute's arguments.

Return Value

array

object newInstance()

Since: 8.0

Creates a new instance of the attribute with passed arguments

Return Value

object

string __toString()

Returns the string representation of any Reflection object.

Please note that since PHP 8.0 this method is absent in this interface and inherits from the {\Stringable} parent.

Return Value

string

Returns string representation of the object that implements this interface (and/or "__toString" magic method).

static string|null export()

Exports a class.

Return Value

string|null