Skip to content
WooCommerce Subscriptions function and class declaration stubs for PHPStan static analysis — enables type-safe developme...

2025 · Creator & Maintainer

PHPStan WooCommerce Subscriptions Stubs

WooCommerce Subscriptions function and class declaration stubs for PHPStan static analysis — enables type-safe development against the Subscriptions API.

The challenge

WooCommerce Subscriptions has hundreds of public functions and classes but ships no PHPStan stubs, so plugins extending it run static analysis against a sea of \"function not found\" errors.

The result

A maintained stub package covering Subscriptions' public surface — enables type-safe development, IDE autocompletion, and PHPStan level 8 for plugins that build on Subscriptions.

Year
2025
Role
Creator & Maintainer
Stack
4 teches
Status
Published

Overview

WooCommerce Subscriptions is a premium plugin with no public stubs for static analysis. This package provides comprehensive PHPStan-compatible stub declarations for all public classes, methods, and functions in the Subscriptions API.

What's Included

  • All WC_Subscription, WC_Subscriptions_* class stubs
  • Action and filter hook signatures
  • Helper function declarations
  • Enum-equivalent constants

Usage

BASH
composer require --dev mralaminahamed/phpstan-woocommerce-subscriptions-stubs

Add to phpstan.neon:

YAML
parameters:
    stubFiles:
        - vendor/mralaminahamed/phpstan-woocommerce-subscriptions-stubs/stubs

Tech

PHP, PHPStan stubs, WooCommerce Subscriptions API.

Share
𝕏 in

Related work

Building something similar?

Let's talk about your project.

Open to freelance engagements and consulting on Laravel, WordPress, and AI-powered systems.