12 lines
223 B
PHP
12 lines
223 B
PHP
<?php
|
|
|
|
namespace App\Traits\Enum;
|
|
|
|
trait WithComment
|
|
{
|
|
public static function comment(): string
|
|
{
|
|
return implode(', ', array_map(fn ($case) => "{$case->value}: {$case->getLabel()}", self::cases()));
|
|
}
|
|
}
|