Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ use MyCLabs\Enum\Enum;
*/
class Action extends Enum
{
const VIEW = 'view';
const EDIT = 'edit';
private const VIEW = 'view';
private const EDIT = 'edit';
}
```

Note the `private` keyword requires PHP > 7.1, you can omit it on PHP 7.0.

## Usage

Expand Down Expand Up @@ -80,8 +81,8 @@ Static methods:
```php
class Action extends Enum
{
const VIEW = 'view';
const EDIT = 'edit';
private const VIEW = 'view';
private const EDIT = 'edit';
}

// Static method:
Expand All @@ -96,7 +97,7 @@ If you care about IDE autocompletion, you can either implement the static method
```php
class Action extends Enum
{
const VIEW = 'view';
private const VIEW = 'view';

/**
* @return Action
Expand All @@ -116,8 +117,8 @@ or you can use phpdoc (this is supported in PhpStorm for example):
*/
class Action extends Enum
{
const VIEW = 'view';
const EDIT = 'edit';
private const VIEW = 'view';
private const EDIT = 'edit';
}
```

Expand Down