Search code examples
phpphpstorm

PhpStorm: How to add method stubs from a PECL library that PhpStorm doesn't currently support?


PhpStorm has a list of method stubs from various compile-time libraries here that it will use for autocompletion in development.

I currently have a list of stubs for the PHP AMQP PECL extension here that I would like to add to my PhpStorm build to get autocompletion for that library.

Is there any way to do this?


Solution

  • Just place such stub file(s) anywhere in your project (or reference in any other supported way, e.g. as Settings | Languages & Frameworks | PHP | Include path) -- IDE will use it for code completion (and similar) purposes only (so you can exclude them from uploading/VCS etc).

    In long term -- you may submit the PR to the already mentioned PhpStorm stubs repository and it may become part of the standard PhpStorm distribution on next release.