Skip to content

Commit

Permalink
Switched to new labelledEnum from juniwalk/utils
Browse files Browse the repository at this point in the history
  • Loading branch information
juniwalk committed Sep 15, 2022
1 parent 89f9d0a commit 5bbefd4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"require": {
"php": ">=8.1",
"doctrine/orm": "^2.0|^3.0",
"juniwalk/utils": ">=1.0.5"
"juniwalk/utils": ">=1.1.0"
},

"suggest": {
Expand Down
22 changes: 5 additions & 17 deletions src/Enums/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,17 @@
namespace JuniWalk\Nestor\Enums;

use JuniWalk\Utils\Enums\Color;
use JuniWalk\Utils\Enums\LabelledEnum;
use JuniWalk\Utils\Enums\LabeledEnum;
use JuniWalk\Utils\Enums\LabeledTrait;

enum Type: string implements LabelledEnum
enum Type: string implements LabeledEnum
{
use LabeledTrait;

case Log = 'log';
case Todo = 'todo';


/**
* @return string[]
*/
public static function getItems(): iterable
{
$items = [];

foreach (self::cases() as $case) {
$items[$case->value] = $case->label();
}

return $items;
}


public function label(): string
{
return match($this) {
Expand Down

0 comments on commit 5bbefd4

Please sign in to comment.