-
Notifications
You must be signed in to change notification settings - Fork 4
Upgrade the Enum class #2
base: master
Are you sure you want to change the base?
Conversation
src/ValuedEnum.php
Outdated
} | ||
|
||
/** | ||
* Returns the name that associated with the current enum value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sholdn't it be 'Returns the value ...'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's typo
src/ValuedEnum.php
Outdated
namespace Saritasa; | ||
|
||
/** | ||
* The base class for enums that associated with one string value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be '... with one numeric value'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's typo
README.md
Outdated
} | ||
} | ||
... | ||
$xor = LogicOperations::XOR(); // will throw InvalidEnumValueException on unknown value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this throws an exception if XOR constant defined in LogicOperations enum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is old comment. I'll add new code line with non-existing constant.
This new version of Enum is more powerful than the previous one and more appropriate for OOP. The changes are incompatible with the previous code, so the version is 2.0.0