@@ -19,7 +19,7 @@ and [Python Enums](https://docs.python.org/3/library/enum.html).
1919A basic way to declare a named Enumeration class:
2020``` php
2121<?php
22- use Dbalabka\Enumeration;
22+ use Dbalabka\Enumeration\Enumeration ;
2323
2424final class Action extends Enumeration
2525{
@@ -126,14 +126,16 @@ multiple Enumeration classes.
126126 > On the other hand, it makes sense to allow sharing some common behavior between a group of enumerations...
127127 > (from [Python Enum documentation](https://docs.python.org/3/library/enum.html#restricted-enum-subclassing))
1281282. Constructor should always be declared as non-public (`private` or `protected`) to avoid unwanted class instantiation.
129- 3. Implementation is based on assumption that all class static properties are elements of Enum. If there is a need to declare
130- any static property that isn't an Enum element then you should override the `\Dbalabka\Enumeration::getStaticVars() ` method.
131- 4. The method `Dbalabka\Enumeration::initialize()` should be called after each Enumeration class declaration. Please use the
129+ 3. Implementation is based on assumption that all class static properties are elements of Enum. <!-- If there is a need to declare
130+ any static property that isn't an Enum element then you should override the `\Dbalabka\Enumeration\Enumeration::$notEnumVars ` method. -->
131+ 4. The method `Dbalabka\Enumeration\Enumeration ::initialize()` should be called after each Enumeration class declaration. Please use the
132132[vladimmi/construct-static](https://github.com/vladimmi/construct-static) custom loader to avoid boilerplate code.
133133
134134## Usage
135135```php
136136<?php
137+ use Dbalabka\Enumeration\Examples\Enum\Action;
138+
137139$viewAction = Action::$view;
138140
139141// it is possible to compare Enum elements
@@ -147,6 +149,7 @@ assert($editAction === Action::$edit);
147149foreach (Action::values() as $name => $action) {
148150 assert($action instanceof Action);
149151 assert($name === (string) $action);
152+ assert($name === $action->name());
150153}
151154```
152155
0 commit comments