MCMatters/laravel-helpers

View on GitHub
src/functions/class.php

Summary

Maintainability
A
0 mins
Test Coverage
F
50%
<?php

declare(strict_types=1);

use McMatters\Helpers\Helpers\ClassHelper;

if (!function_exists('get_class_constants')) {
    /**
     * @throws \ReflectionException
     */
    function get_class_constants(object|string $class): array
    {
        return ClassHelper::getConstants($class);
    }
}

if (!function_exists('get_class_constants_start_with')) {
    /**
     * @throws \ReflectionException
     */
    function get_class_constants_start_with(
        object|string $class,
        string $keyword,
        bool $substrKeyword = false,
    ): array {
        return ClassHelper::getConstantsStartWith($class, $keyword, $substrKeyword);
    }
}