This package provides stub declarations for the WooCommerce plugin functions, classes and interfaces. These stubs can help plugin and theme developers leverage IDE completion and static analysis tools like PHPStan.
The stubs are generated directly from the source using php-stubs/generator.
- PHP >=7.1
Require this package as a development dependency with Composer.
composer require --dev php-stubs/woocommerce-stubs
Alternatively you may download woocommerce-stubs.php
directly.
Include stubs in PHPStan configuration file.
parameters:
bootstrapFiles:
- vendor/php-stubs/woocommerce-stubs/woocommerce-stubs.php
#- vendor/php-stubs/woocommerce-stubs/woocommerce-packages-stubs.php
Please consider supporting this work.
Thank you!