
Good news: PhpStorm stubs are open source! They are hosted on GitHub, and from there they ultimately find their way into the PhpStorm distribution. Or you’ve created your own stub from scratch. So, you’ve identified an issue with an existing stub, and want to address it. PhpStorm displays a warning message at the top of the editor panel to act as a reminder: While you can open any of these files in the editor to view their contents, modifying them directly is not possible. In the Project view, expand the PHP Runtime node under External Libraries and locate the bundled stubs under PHP Runtime: To get an overview of what stubs are, take a look at the ones bundled with PhpStorm.

In this post, we’ll take a look at the bundled PHP stubs, learn how to get started with your own stubs, and even create a plugin that will attach an arbitrary stubs set to any PhpStorm project. The coding assistance quality relies, apart from anything else, on the quality of these signatures and their PHPDoc provided in the stubs.

Stubs are normal, syntactically correct PHP files that contain annotated function, method, and class signatures, constant definitions, and so on. We call PhpStorm “an IDE that actually ‘gets’ your code,” meaning that it provides completion, type inference, inspection, documentation pop-ups, and a lot more coding assistance.įor all the Standard PHP Library components as well as for common extensions, this functionality is based on PHP stubs.
