From a42c6c7bf62013ed17600f9ce275648e79e61e5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20E=C5=A1ler?= Date: Mon, 2 Dec 2019 23:10:13 +0100 Subject: [PATCH] Update README.md --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 47920f9..993ee78 100644 --- a/README.md +++ b/README.md @@ -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.