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