trait Mixin

Trait Mixin.

Allows mixing in entire classes with multiple macros.

Properties

staticprotectedarray $macroContextStack Stack of macro instance contexts.

Methods

static void
mixin(object|string$mixin)

Mix another object into the class.

static mixed
bindMacroContext(Mixin|null$context,callable$callable)

Stack a Carbon context from inside calls of self::this() and execute a given action.

static Mixin|null
context()

Return the current context from inside a macro callee or a null if static.

static Mixin
this()

Return the current context from inside a macro callee or a new one if static.

Details

at line66
staticvoid mixin(object|string$mixin)

Mix another object into the class.

Parameters

object|string $mixin

Return Value

void

Exceptions

ReflectionException

at line151
staticprotectedmixed bindMacroContext(Mixin|null$context,callable$callable)

Stack a Carbon context from inside calls of self::this() and execute a given action.

Parameters

Mixin|null $context
callable $callable

Return Value

mixed

Exceptions

Throwable

at line177
staticprotectedMixin|null context()

Return the current context from inside a macro callee or a null if static.

Return Value

Mixin|null

at line187
staticprotectedMixin this()

Return the current context from inside a macro callee or a new one if static.

Return Value

Mixin