Skip to content
This repository was archived by the owner on Dec 26, 2023. It is now read-only.

Commit 918eed7

Browse files
committed
Update README.md
1 parent d7e48b1 commit 918eed7

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,31 @@ Enumerated type for PHP by [Petr Knap].
1111
### Usage of php-enum
1212

1313
```php
14-
// TODO make example
14+
/**
15+
* @method static DayOfWeekEnum MONDAY()
16+
* @method static DayOfWeekEnum TUESDAY()
17+
* @method static DayOfWeekEnum WEDNESDAY()
18+
* @method static DayOfWeekEnum THURSDAY()
19+
* @method static DayOfWeekEnum FRIDAY()
20+
* @method static DayOfWeekEnum SATURDAY()
21+
* @method static DayOfWeekEnum SUNDAY()
22+
*/
23+
class DayOfWeekEnum extends \PetrKnap\Php\Enum\AbstractEnum
24+
{
25+
protected function __construct($constantName)
26+
{
27+
self::setConstants([
28+
"MONDAY" => 0,
29+
"TUESDAY" => 1,
30+
"WEDNESDAY" => 2,
31+
"THURSDAY" => 3,
32+
"FRIDAY" => 4,
33+
"SATURDAY" => 5,
34+
"SUNDAY" => 6
35+
]);
36+
parent::__construct($constantName);
37+
}
38+
}
1539
```
1640

1741

0 commit comments

Comments
 (0)