Skip to content

Commit 54bd1b8

Browse files
committed
Updated README.md
1 parent bd0ca51 commit 54bd1b8

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ It's an abstract class that needs to be extended to use it.
4545

4646
## The way of class constants
4747

48-
* Requires validation on every use
49-
* Hard to extend the list of possible values
50-
* Hard to get a human readable name of a value
51-
5248
class User
5349
{
5450
const INACTIVE = 0;
@@ -82,11 +78,11 @@ It's an abstract class that needs to be extended to use it.
8278
Default user status: 0
8379
Changed user status: 1
8480

85-
## The way of php-enum:
81+
* Requires validation on every use
82+
* Hard to extend the list of possible values
83+
* Hard to get a human readable name of a value
8684

87-
* Validation will be already done on basic class ```Mabe_Enum```
88-
* Using type-hint makes arguments save
89-
* Human readable name of a value is simple accessable
85+
## The way of php-enum:
9086

9187
class UserStatusEnum extends Mabe_Enum
9288
{
@@ -127,6 +123,10 @@ It's an abstract class that needs to be extended to use it.
127123
Default user status: INACTIVE (0)
128124
Changed user status: ACTIVE (1)
129125

126+
* Validation will be already done on basic class ```Mabe_Enum```
127+
* Using type-hint makes arguments save
128+
* Human readable name of a value is simple accessable
129+
130130

131131
# Install
132132

@@ -138,12 +138,14 @@ Add ```marc-mabe/php-enum``` to the project's composer.json dependencies and run
138138
## GIT
139139

140140
```git clone git://github.com/marc-mabe/php-enum.git```
141+
141142
(The class ```Mabe_Enum``` will be located in ```src/Mabe/Enum.php```)
142143

143144
## ZIP / TAR
144145

145146
Download the last version from [Github](https://github.com/marc-mabe/php-enum/tags)
146147
and extract it.
148+
147149
(The class ```Mabe_Enum``` will be located in ```src/Mabe/Enum.php```)
148150

149151

@@ -169,14 +171,14 @@ constant values has ```NULL``` as value.
169171
That's because ```$value``` was defined as ```NULL``` in the base class and
170172
No constant assignable to the default value.
171173

172-
* No argument on constructor results in an InvalidArgumentException
173-
174174
class MyEnumWithoutDefaultValue extends Mabe_Enum
175175
{
176176
const ONE = 1;
177177
const TWO = 2;
178178
}
179179

180+
* No argument on constructor results in an InvalidArgumentException
181+
180182
## Constant with NULL as value
181183

182184
Because ```$value``` property is defined as ```NULL``` a constant with

0 commit comments

Comments
 (0)