Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
esler authored Dec 2, 2019
1 parent b7861c5 commit a42c6c7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ You can user method `search()` for obtaining instance of enum by a value.
$contentType = ContentTypeEnum::search(apache_request_headers()['Content-Type']);
```

## PHPStan integration
This library is distributed with PHPStan extension which's providing magic methods reflection. Just add following configuration to your `phpstan.neon`
```yaml
services:
-
class: IW\PHPStan\Reflection\EnumMethodsReflectionExtension
tags:
- phpstan.broker.methodsClassReflectionExtension
```
## Alternatives
- we took most of the inspiration from library [myclabs/php-enum]. It's nice implementation but it's missing singletons and it's not optimized for PHP7.
- PHP's [SplEnum] needs an extension and also does not support singletons.
Expand Down

0 comments on commit a42c6c7

Please sign in to comment.