henzeb/enumhancer

View on GitHub
docs/ide-helper.md

Summary

Maintainability
Test Coverage
# IDE-helper

Enumhancer is using a lot of magic. For the most basic functionality,
enumhancer now comes with an IDE-helper. This is a separate package.

## Installation

First, you need to install the IDE-helper package.

````bash
composer require --dev henzeb/enumhancer-ide-helper
````

### Configure with dump-autoload

The IDE-helper out of the box supports the usage inside composer's
`post-autoload-dump` event.

````json
 "post-autoload-dump": [
"Henzeb\\Enumhancer\\Composer\\IdeHelper::generate"
]
````

Note: You can leave this line in your composer file. The `IdeHelper` class is part
of the main library and executes `enumhancer-ide-helper` only if installed.

### Configure as composer command

If you don't want to call dump-autoload everytime you need to generate the helper,
it's possible to add it as a composer command.

```json
"scripts": {
"enumhancer": "Henzeb\\Enumhancer\\Composer\\IdeHelper::generate"
}
```

## Ignore IDE-helper generated files

The filename that is being generated by default is `_enumhancer.php` and is created
inside the root of your project. Simply add the filename to your `.ignore` file.