phpro / grumphp

A PHP code-quality tool
MIT License
4.14k stars 430 forks source link

Custom Task Examples #235

Closed mattgaviota closed 7 years ago

mattgaviota commented 7 years ago
Q A
Branch master for features and deprecations
Bug? no
New feature? no
Question? no
Documentation? yes

Hi, I would like to ask for a more exhaustive example for custom tasks. I was trying to make one without too much success. I tried to replicate the phpunit task to use paratest instead. But when trying to register it in the service manager it fails with an Uncaught ReflectionException and I do not know where to continue.

Thanks in advance.

veewee commented 7 years ago

Hi @mattgaviota,

Is it possible that the task class can't be autoloaded? You'll have to add the namespace to the autoload section of your composer.json file so that PHP knows where to find your class.

Normally the configuration from the documentation page should be sufficient to get the task up: https://github.com/phpro/grumphp/blob/master/doc/tasks.md#creating-a-custom-task

mattgaviota commented 7 years ago

Thanks for your fast answer. I already made it work.

veewee commented 7 years ago

No problem! :)