Giter Site home page Giter Site logo

php-stubs / woocommerce-stubs Goto Github PK

View Code? Open in Web Editor NEW
83.0 4.0 9.0 5.72 MB

WooCommerce function and class declaration stubs for static analysis

Home Page: https://packagist.org/packages/php-stubs/woocommerce-stubs

License: MIT License

PHP 99.91% Shell 0.09%
woocommerce wordpress static-analysis stubs phpstan definitions

woocommerce-stubs's People

Contributors

dennisameling avatar szepeviktor avatar the-csaba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

woocommerce-stubs's Issues

CouponsMovedTrait not found

Hi,

we have fatal error:
Fatal error: Trait 'Automattic\WooCommerce\Internal\Admin\CouponsMovedTrait' not found in /abc/vendor/php-stubs/woocommerce-stubs/woocommerce-packages-stubs.php on line 17764

Short functions are missing

Hi, great job!

However, I've found out missing is_account_page(), is_checkout(), wc_logout_url() functions. Any ideas how to get it there?

And one more thing, could you help me how to generate my own stubs for Timber plugin (I haven't found a way to make php-stubs-generator work?

Thanks!
Karolina

Incorrect nulls

All null values have unnecessary backslash
for example 91 line:

protected $meta_data = \null;

Class "WP_Widget" not found

My gitlab runner reports

/home/gitlab-runner/builds/hedonia/hedonia/vendor/php-stubs/woocommerce-stubs/woocommerce-stubs.php on line 5892 while loading bootstrap file /home/gitlab-runner/builds/hedonia/hedonia/vendor/php-stubs/woocommerce-stubs/woocommerce-stubs.php:
 Class "WP_Widget" not found

Composer install contains

  - Installing php-stubs/wordpress-stubs (v6.2.0): Extracting archive
  - Installing php-stubs/woocommerce-stubs (v7.6.0): Extracting archive

Installation fails

I'm trying to add the WooCommerce stubs using composer require --dev php-stubs/woocommerce-stubs but I keep getting an error

Script PHPStan\WordPress\Composer\FixWpStubs::php73Polyfill handling the post-update-cmd event terminated with an exception

Installation failed, reverting ./composer.json to its original content.


  [ErrorException]
  file_get_contents(.../vendor/giacocorsiglia/
  wordpress-stubs/wordpress-stubs.php): failed to open stream: No such file or directory

Any idea why would this happen?

protected abstract method gets removed

WC_Item_Totals protected abstract function get_values_for_total($field);

then

Class WC_Cart_Totals contains 1 abstract method and must therefore be declared abstract
 or implement the remaining methods (WC_Cart_Totals::get_values_for_total)
 in /home/travis/build/php-stubs/woocommerce-stubs/woocommerce-stubs.php on line 15012

@herndlm Please help.

Undefined function woocommerce

Hello good morning, the woocommerce functions are not being recognized despite having configured the stubs, my editor is vscode and I am on an ubuntu linux machine.
Captura desde 2023-08-22 10-54-59
Captura desde 2023-08-22 10-58-12
Captura desde 2023-08-22 10-58-53

PHP 8.1 - Throwing deprecated warnings

I'm seeing these errors when running PHPStan with WooCommerce Stubs:

PHP Deprecated:  Optional parameter $id declared before required parameter $object is implicitly treated as a required parameter in .../vendor/php-stubs/woocommerce-stubs/woocommerce-stubs.php on line 73141

I cannot get it to work with VSCode PHP Intelephense!

Hi,

First of all thank you for making our life easier, the ACF stubs are working perfectly but not the WooCommerce ones the functions are not recognized at every WooCommerce function i get the Undefined function error message!

Can you please help me with this because it's been months that i am trying to fix it but i cannot find any solution for it!

Thanks and Regards!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.