PhpStorm: How to add method stubs from the PECL library that PhpStorm does not currently support?

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

I currently have a list of stubs for the PHP AMQP PECL extension that I would like to add to my PhpStorm assembly to get autocomplete for this library.

Is there any way to do this?

+8
php phpstorm
source share
2 answers

Just put these stub files anywhere in your project (or a link in any other supported way, such as Settings | Languages & Frameworks | PHP | Include path ). The IDE will only use it for code completion purposes (and the like) (so you can exclude them from loading / VCS, etc.).

In the long run, you can send PR to the already mentioned PhpStorm stub repository , and it can become part of the standard PhpStorm distribution for the next release.

+12
source share

January 2017 Update: you can git clone (checkout) the PhpStorm stub repository on your local computer and point PhpStorm to this directory. From there, you can add stubs or even modify / delete existing stubs.

  • git clone https://github.com/JetBrains/phpstorm-stubs
  • Open Settings β†’ Languages ​​and Framework β†’ PHP
  • Click "Advanced Settings" below
  • Next to the default path, click ... and go to the root in the phpstorm-stubs folder
+6
source share

All Articles