mirror of
https://github.com/archtechx/enums.git
synced 2025-12-12 19:24:04 +00:00
Added "Invokable Cases" PHPStan extension
This includes a PHPStan extension to add support for `InvokableCases` so that static analysis tools can understand the callable methods and their return types. The extension has been added in a way that will allow multiple extensions in the future if required, with a single include file that will import all extensions, or the option to include only specific extensions.
This commit is contained in:
parent
7e17b84451
commit
7e6914a52f
5 changed files with 156 additions and 0 deletions
|
|
@ -366,6 +366,15 @@ enum TaskStatus: int
|
|||
|
||||
And if you're using the same meta property in multiple enums, you can create a dedicated trait that includes this `@method` annotation.
|
||||
|
||||
## PHPStan
|
||||
|
||||
To assist PHPStan when using invokable cases, you can include the PHPStan extensions into your own `phpstan.neon` file:
|
||||
|
||||
```yaml
|
||||
includes:
|
||||
- ./vendor/archtechx/enums/extension.neon
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
Run all checks locally:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue