{"repo":"inpsyde/wp-stubs","free":true,"listed":false,"github":"https://github.com/inpsyde/wp-stubs","clone":"git clone https://github.com/inpsyde/wp-stubs.git","description":"WordPress stubs","language":"PHP","stars":23,"topics":["static-analysis","stubs","wordpress","php-stubs","hacktoberfest"],"license":"MIT","category":"dev-tools","readme_excerpt":"WordPress stubs This repo contains auto-generated WordPress stubs to be used with static analysis tools. FAQ - Why this instead of \" \"? This project's purpose is: - having multiple versions of WP in the same branch/version - not having stubs for globals, but having stubs for constants - having a super-simple \"override\" method. By declaring stubs in the fixtures.php file, it is possible to override the WordPress declaration for functions, classes, and interfaces. That way, it is easy to fix incorrect DocBlocks in WordPress and use \"advanced\" doc block supported by static analyzers (think of array shape, type aliases, conditional return types …) How this works Every day, a GitHub Actions workflow calls the wp.org API to find new WordPress versions. If it finds new versions, it generates and saves stubs for them (using https://github.com/php-stubs/generator) while also updating the \"latest\" stub. How to use The primary usage is for static analysis tools, for example, Psalm: Method 1: Get all WordPress versions Steps: 1. Require this project ( inpsyde/wp-stubs ) in your Composer's \"require-dev\" property 2. Create a psalm.xml config file (see docs) 3. In the Psalm configuration, add these lines: You can replace latest.php with a specific WP version. See the available versions in the /stubs directory. Note : In that folder, a two-digit version number like 5.9 does not necessarily mean WordPress version 5.9 , but the latest in the 5.9. series. So if you use Composer to require WordP","default_branch":null,"files":null,"tree":[],"storefront":"/r/inpsyde","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/inpsyde/wp-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."}