{"repo":"php-stubs/wordpress-stubs","free":true,"listed":false,"github":"https://github.com/php-stubs/wordpress-stubs","clone":"git clone https://github.com/php-stubs/wordpress-stubs.git","description":"Up-to-date WordPress function and class declaration stubs for static analysis by PHPStan","language":"PHP","stars":203,"topics":["wordpress","stubs","static-analysis","phpstan","definitions"],"license":"MIT","category":"dev-tools","readme_excerpt":"[!IMPORTANT] Hello everyone! This is Viktor who runs the php-stubs organization. I am planning to stop contributing to the WordPress ecosystem because it is extremely difficult and I do not earn (min) €100/month. Please support my work to avoid abandoning this package. Thank you! WordPress Stubs It provides stub declarations for WordPress core functions, classes and interfaces, globals are not included . These stubs can help plugin and theme developers leverage static analysis tools like PHPStan. The stubs are generated from @johnpbloch's package using php-stubs/generator. Requirements - PHP 7.4 or 8.0 Installation Require this package as a development dependency with Composer. Alternatively you may download wordpress-stubs.php directly. Usage with PHPStan The package szepeviktor/phpstan-wordpress depends on phpstan/phpstan and this one. Please do read that package's README and see the example directory over there. Usage with Psalm Update your Psalm config to include this section. Furthermore ensure WordPress core is not included in . Usage in Intellisense If your IDE has trouble parsing all of WordPress you may find the stubs useful for enabling code completion and related features. For example there are instructions for usage with VSCode's Intelephense extension. Versioning This package is versioned to match the WordPress version from which the stubs are generated. Generating stubs for a different WordPress version 1. Run modern PHP version 1. Clone this repository and cd i","default_branch":null,"files":null,"tree":[],"storefront":"/r/php-stubs","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/php-stubs/wordpress-stubs/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}