API reference / Quittio \ Core \ Support
Macroable
trait in quittio/core
Quittio\Core\Support\Macroable · Source
Lightweight macro support without a dependency on Laravel. Country packs use it to add helpers such as smallAmount() to the invoice builder.
Properties#
| Property | Type | Description |
|---|---|---|
$macros protected static | array<string, callable> |
Methods#
| Method | Description |
|---|---|
->__call() | |
::flushMacros() | |
::hasMacro() | |
::macro() |
__call()#
public function __call(string $method, array<mixed> $parameters): mixed| Parameter | Type | Description |
|---|---|---|
$method | string | |
$parameters | array<mixed> |
- Returns
mixed
flushMacros()#
public static function flushMacros(): voidhasMacro()#
public static function hasMacro(string $name): bool| Parameter | Type | Description |
|---|---|---|
$name | string |
- Returns
bool
macro()#
public static function macro(string $name, callable $macro): void| Parameter | Type | Description |
|---|---|---|
$name | string | |
$macro | callable |