Skip to content

stephanbouman/enum-collections

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EnumCollection

This package adds a asCollection() method to your enums. Now you don't need to wrap your Enum::cases() in a collection.

How to implement

use Stephanbouman\Enumcollection\HasCollection;

enum TestEnum {
    use HasCollection; // use the HasCollection trait

    case Foo;
    case Bar;
}

How to use

// instead of
collect(Fruits::cases())->filter(...)

// use 
Fruits::asCollection()->filter(...)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages