final class PropertyHook

Definition of a property hook.

Methods

setBody(string $code, array|null $args = null, bool $short = false)

Sets the hook body. When $short is true, uses arrow-function style (=> expression).

string
getBody()

No description

bool
isShort()

Returns true if the hook uses the arrow function style (=> expression), not a block body.

setFinal(bool $state = true)

No description

bool
isFinal()

No description

setAbstract(bool $state = true)

No description

bool
isAbstract()

No description

setParameters(array $val)

No description

array
getParameters()

No description

addParameter(string $name)

Adds a parameter. If it already exists, it overwrites it.

setReturnReference(bool $state = true)

No description

bool
getReturnReference()

No description

Details

at line 31
PropertyHook setBody(string $code, array|null $args = null, bool $short = false)

Sets the hook body. When $short is true, uses arrow-function style (=> expression).

Optionally accepts Dumper-style placeholders resolved against $args.

Parameters

string $code
array|null $args
bool $short

Return Value

PropertyHook

at line 46
string getBody()

No description

Return Value

string

at line 55
bool isShort()

Returns true if the hook uses the arrow function style (=> expression), not a block body.

Return Value

bool

at line 61
PropertyHook setFinal(bool $state = true)

No description

Parameters

bool $state

Return Value

PropertyHook

at line 68
bool isFinal()

No description

Return Value

bool

at line 74
PropertyHook setAbstract(bool $state = true)

No description

Parameters

bool $state

Return Value

PropertyHook

at line 81
bool isAbstract()

No description

Return Value

bool

at line 91
PropertyHook setParameters(array $val)

internal  
 

No description

Parameters

array $val

Return Value

PropertyHook

at line 107
array getParameters()

internal  
 

No description

Return Value

array

at line 117
Parameter addParameter(string $name)

Adds a parameter. If it already exists, it overwrites it.

Parameters

string $name

without $

Return Value

Parameter

at line 123
PropertyHook setReturnReference(bool $state = true)

No description

Parameters

bool $state

Return Value

PropertyHook

at line 130
bool getReturnReference()

No description

Return Value

bool

Traits