Skip to content

Commit

Permalink
Implemented missing getItems method in type enum
Browse files Browse the repository at this point in the history
  • Loading branch information
juniwalk committed Sep 5, 2022
1 parent 47f3c45 commit 89f9d0a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Enums/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@ enum Type: string implements LabelledEnum
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 89f9d0a

Please sign in to comment.