404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.137.175.166: ~ $
<?php
declare(strict_types=1);

namespace Nelexa;

/**
 * Generates an enum php doc block for describing static methods.
 *
 * @param Enum|string $enumOrEnumClass the enum instance or string enum class name
 * @return string php doc block for enum class
 */
function enum_docblock($enumOrEnumClass): string
{
    if (!is_a($enumOrEnumClass, Enum::class, true)) {
        throw new \InvalidArgumentException(sprintf(
            'Expected object or class name that is a descendant of the %s class.',
            Enum::class
        ));
    }

    $docBlock = '/**' . PHP_EOL;
    /**
     * @var Enum $enum
     */
    foreach (call_user_func([$enumOrEnumClass, 'values']) as $enum) {
        $docBlock .= ' * @method static self ' . $enum->name() . '()' . PHP_EOL;
    }
    $docBlock .= ' */' . PHP_EOL;
    return $docBlock;
}

Filemanager

Name Type Size Permission Actions
Enum.php File 7.37 KB 0644
functions.php File 829 B 0644