Enumhancer is using a lot of magic. For the most basic functionality, enumhancer now comes with an IDE-helper. This is a separate package.
First, you need to install the IDE-helper package.
composer require --dev henzeb/enumhancer-ide-helper
The IDE-helper out of the box supports the usage inside composer's
post-autoload-dump
event.
"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.
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.
"scripts": {
"enumhancer": "Henzeb\\Enumhancer\\Composer\\IdeHelper::generate"
}
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.