Skip to content

Commit

Permalink
Updating readme
Browse files Browse the repository at this point in the history
Signed-off-by: Nate Brunette <n@tebru.net>
  • Loading branch information
natebrunette committed Sep 14, 2016
1 parent 9edc9e8 commit 97252ce
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ Now you can create a new instance normally or using the static method.

new DirectionEnum('north');
DirectionEnum::create('north');

You can also create an instance using the __callStatic magic method.

DirectionEnum::NORTH();

Add a hint to the enum doc block

/**
* @method static $this NORTH()
*/

You can also iterate over the enum

Expand All @@ -59,6 +69,6 @@ There are multiple methods available on each enum
* `values()` [static] A 0-indexed array of all of the enum values
* `exists($value)` [static] Returns true if the value exists
* `toArray()` [static] Returns a hash with keys and values as the enum values
* `equals(AbstractEnum $enum)` Performs a non-strict comparison of two enums
* `equals($enum)` Performs a non-strict comparison of two enums or value comparison of a string
* `getValue()` Returns the current value of the enum
* `__toString()` Same as `getValue()`

0 comments on commit 97252ce

Please sign in to comment.