marc-mabe / php-enum

Simple and fast implementation of enumerations with native PHP
BSD 3-Clause "New" or "Revised" License
464 stars 36 forks source link

Consistent Naming #120

Closed marc-mabe closed 5 years ago

marc-mabe commented 5 years ago

I would like to change the naming in 4.x to be more consistent and also better integrate with the new immutable methods added in 4.x

Current (3.x + 4.x):

Method Enum EnumSet EnumMap Description
has() X(S) - - Does enumerator exist
contains() - X X Does enumerator exist
get() X(S) - - Get enumerator object
attach/detach(Enumerator) - X - Attach/Detach an enumerator
attach/detachEnumerators - X - Attach/Detach iterable enumerators at once
with/withoutEnumerator - X - Attach/Detach an enumerator (immutable)
with/withoutEnumerators - X - Attach/Detach iterable enumerators at once (immutable)

New:

Method Enum EnumSet EnumMap Description
has() X(S) X X Does enumerator exist
get() X(S) - X Get enumerator object Enum / Get mapped data value EnumMap
add/remove - X X Add/Remove an enumerator
add/removeIterable - X X Add/Remove iterable enumerators at once
with/without - X X Add/Remove an enumerator (immutable)
with/withoutIterable - X X Add/Remove iterable enumerators at once (immutable)

Differences from master (3.x):

Notes:

thoughts @prolic ?

prolic commented 5 years ago

Sure, go ahead.

marc-mabe commented 5 years ago

merged by #121