|
6 | 6 | [](https://packagist.org/packages/marc-mabe/php-enum)
|
7 | 7 | [](https://www.versioneye.com/php/marc-mabe:php-enum/dev-master)
|
8 | 8 |
|
9 |
| -This is a native PHP implementation to add enumeration support to PHP >= 5.3 |
| 9 | +This is a native PHP implementation to add enumeration support to PHP >= 5.3. |
10 | 10 | It's an abstract class that needs to be extended to use it.
|
11 | 11 |
|
12 | 12 |
|
@@ -49,7 +49,7 @@ It's an abstract class that needs to be extended to use it.
|
49 | 49 | $status->getOrdinal(); // returns the ordinal number of the selected constant
|
50 | 50 | (string) $status; // returns the selected constant name
|
51 | 51 |
|
52 |
| - // The same enumerations of the same class holds the same instance |
| 52 | + // same enumerations of the same class holds the same instance |
53 | 53 | UserStatus::get(UserStatus::ACTIVE) === UserStatus::ACTIVE()
|
54 | 54 | UserStatus::get(UserStatus::DELETED) != UserStatus::INACTIVE()
|
55 | 55 |
|
@@ -101,7 +101,7 @@ Internally the ```EnumMap``` is based of ```SplObjectStorage```.
|
101 | 101 | // iterate
|
102 | 102 | var_dump(iterator_to_array($enumSet)); // array(0 => UserStatus{$value=1});
|
103 | 103 |
|
104 |
| - // it's possible to define the key and the value used for iteration |
| 104 | + // define key and value used for iteration |
105 | 105 | $enumSet->setFlags(EnumSet::KEY_AS_NAME | EnumSet::CURRENT_AS_DATA);
|
106 | 106 | var_dump(iterator_to_array($enumSet)); // array('ACTIVE' => 'aktiv');
|
107 | 107 |
|
@@ -132,8 +132,8 @@ Internally it's based of a list (array) of ordinal values.
|
132 | 132 | # Why not ```SplEnum```
|
133 | 133 |
|
134 | 134 | * ```SplEnum``` is not build-in into PHP and requires pecl extension installed.
|
135 |
| -* Instances of the same value of an ```SplEnum``` are not the same instances. |
136 |
| -* ```SplEnum``` doesn't have an implementaiton for ```EnumMap``` and ```EnumSet```. |
| 135 | +* Instances of the same value of an ```SplEnum``` are not the same instance. |
| 136 | +* ```SplEnum``` doesn't have implemented ```EnumMap``` or ```EnumSet```. |
137 | 137 |
|
138 | 138 |
|
139 | 139 | # Install
|
|
0 commit comments