henzeb/enumhancer

View on GitHub
src/Concerns/Macros.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php

namespace Henzeb\Enumhancer\Concerns;

use Henzeb\Enumhancer\Helpers\EnumMacros;
use stdClass;

trait Macros
{
    use MagicCalls;

    public static function macro(string $name, callable $callable): void
    {
        EnumMacros::macro(self::class, $name, $callable);
    }

    public static function hasMacro(string $name): bool
    {
        return EnumMacros::hasMacro(self::class, $name);
    }

    public static function mixin(string|object $mixin): void
    {
        EnumMacros::mixin(self::class, $mixin);
    }

    public static function flushMacros(): void
    {
        EnumMacros::flush(self::class);
    }
}