trait macroable

internal  
 

Trait macroable.

Allows adding methods to a class at runtime.

Properties

static protected array<string,callable> $macros

Methods

__call(string $method, array $parameters)

Invoke registered macro dynamically.

static 
__callStatic(string $method, array $parameters)

Invoke registered static macro.

static void
macro(string $name, callable $macro)

Register a macro.

static bool
has_macro(string $name)

Check if a macro is registered.

Details

at line 38
__call(string $method, array $parameters)

Invoke registered macro dynamically.

Parameters

string $method
array $parameters

at line 60
static __callStatic(string $method, array $parameters)

Invoke registered static macro.

Parameters

string $method
array $parameters

at line 82
static void macro(string $name, callable $macro)

Register a macro.

Parameters

string $name
callable $macro

Return Value

void

at line 90
static bool has_macro(string $name)

Check if a macro is registered.

Parameters

string $name

Return Value

bool