merlindiavova/fix-wordpress-stubs

Fix WordPress stubs for PHP Stubs

dev-master 2020-02-02 19:49 UTC

This package is not auto-updated.

Last update: 2024-04-23 14:28:29 UTC


README

When using static analysis tools to analyse your wordpress app or site, you generally need WordPress function stubs. These can be provided by php-stubs/wordpress-stubs or szepeviktor/phpstan-wordpress. Although these do a great job in providing the function stubs you may still run into some issues with duplicated function stubs. This simple package will automatically remove and fix other issues so your analysis toosl can just run.

Usage

First install this package via compsoer

 $ composer require --dev merlidiavova/fix-wordpress-stubs

Next we need to composer to run a the FixStubs.php script on update

{
    "scripts": {
        "post-update-cmd": [
          "MerlinDiavova\\WordPress\\FixStubs::run"
        ]
    }
}

Thats it, now when you run composer update or composer install the script will automatically run and fix the wordpress stubs provided by php-stubs/wordpress-stubs and szepeviktor/phpstan-wordpress