Skip to content

fmasson-arkod/woocommerce-stubs

 
 

Repository files navigation

WooCommerce Stubs

Build Status

This package provides stub declarations for WooCommerce functions, classes and interfaces. These stubs can help plugin and theme developers leverage static analysis tools like PHPStan, which is not able to parse WooCommerce as it is not clean OOP code.

Stubs are generated directly from the source using giacocorsiglia/stubs-generator.

Requirements

  • PHP >=7.1

Installation

Require this package as a development dependency with Composer.

composer require --dev php-stubs/woocommerce-stubs

Alternatively you may download woocommerce-stubs.php directly.

Usage in PHPStan

Include all stubs in PHPStan configuration file.

parameters:
    bootstrapFiles:
        - %rootDir%/../../php-stubs/wordpress-stubs/wordpress-stubs.php
        - %rootDir%/../../php-stubs/woocommerce-stubs/woocommerce-stubs.php
        #- %rootDir%/../../php-stubs/woocommerce-stubs/woocommerce-packages-stubs.php

About

WooCommerce function and class declaration stubs for static analysis.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 99.9%
  • Shell 0.1%