mralaminahamed / easycommerce-stubs
EasyCommerce function and class declaration stubs for static analysis.
Package info
github.com/mralaminahamed/phpstan-easycommerce-stubs
Language:Shell
pkg:composer/mralaminahamed/easycommerce-stubs
Requires
- php: >=7.4
- php-stubs/wordpress-stubs: ^5.3 || ^6.0 || ^7.0
Requires (Dev)
- php-stubs/generator: ^0.9.0
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^9.5 || ^10.5 || ^11.0
- squizlabs/php_codesniffer: ^3.13
Suggests
- symfony/polyfill-php73: Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions
- szepeviktor/phpstan-wordpress: WordPress extensions for PHPStan
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v1.49
- v1.48
- v1.47.1
- v1.47
- v1.46
- v1.45
- v1.44
- v1.43
- v1.42.2
- v1.42.1
- v1.42
- v1.41
- v1.40.2
- v1.40.1
- v1.40
- v1.31
- v1.30
- v1.29
- v1.28
- v1.27
- v1.26
- v1.25
- v1.24
- v1.23
- v1.22
- v1.21
- v1.20.1
- v1.20
- v1.15
- v1.14
- v1.13
- v1.12
- v1.10.1
- v1.10
- v1.9
- v1.8.3
- v1.8.2
- v1.8.1
- v1.8
- v1.7
- v1.6
- v1.5.1
- v1.5.0
- v1.4.1
- v1.4.0
- v1.3.3.1
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0.2
- v1.3.0
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.9.26-beta
- v0.9.25-beta
- v0.9.24-beta
- v0.9.23-beta
- v0.9.22-beta
- v0.9.21.1-beta
- v0.9.21-beta
- v0.9.20-beta
- v0.9.19-beta
- v0.9.18.2-beta
- v0.9.18-beta
- v0.9.17.2-beta
- v0.9.17.1-beta
- v0.9.17-beta
- v0.9.16-beta
- v0.9.15-beta
- v0.9.14.1-beta
- v0.9.14-beta
- v0.9.13-beta
- v0.9.12-beta
- v0.9.11-beta
- v0.9.10-beta
- v0.9.9-beta
- v0.9.8-beta
- v0.9.7-beta
- v0.9.6-beta
- v0.9.5-beta
- v0.9.4-beta1
- v0.9.3-beta5
- v0.9.3-beta4
- v0.9.3-beta3
- v0.9.3-beta2
- v0.9.3-beta1
- v0.9.2-beta2
- v0.9.2-beta1
- v0.9.1-beta1
- v0.9.0-beta7
- v0.9.0-beta6
- v0.9.0-beta5
- v0.9.0-beta4
- v0.9.0-beta3
- v0.9.0-beta2
This package is auto-updated.
Last update: 2026-09-10 07:32:54 UTC
README
PHP stub declarations for the EasyCommerce plugin, for IDE completion and static analysis. Generated with php-stubs/generator directly from the plugin source.
Generated from EasyCommerce 1.47 โ 115 classes ยท 10 traits ยท 128 functions ยท 7 constants.
๐ Features
- Complete class, interface, trait and function declarations
- Constants in a separate file, so PHPStan can scan them rather than analyse them
- IDE autocompletion for a plugin that is not a Composer dependency
- Reproducible: the source is downloaded from WordPress.org, never vendored
๐ Requirements
- PHP >= 7.4
- Composer
๐ฆ Installation
composer require --dev mralaminahamed/easycommerce-stubs
Or download the stub files directly:
๐ง Configuration
Add both files to PHPStan. scanFiles rather than bootstrapFiles: the stubs declare
symbols for analysis, they are not meant to be executed.
parameters: scanFiles: - vendor/mralaminahamed/easycommerce-stubs/easycommerce-stubs.stub - vendor/mralaminahamed/easycommerce-stubs/easycommerce-constants-stubs.stub
For IDE completion, point your IDE at the same files โ in PhpStorm, mark them as an Include Path rather than a source root, so the empty method bodies never shadow the real plugin.
๐ Quick usage example
<?php if ( defined( 'EASYCOMMERCE_VERSION' ) ) { // Your implementation }
โ ๏ธ Limitations
- Stubs are a snapshot. They describe EasyCommerce 1.47. Regenerate when the plugin changes a signature, or pin the stub version alongside the plugin version you support.
- Method bodies are empty by design. PHPStan reads declarations and types; it never needs the implementation. Do not load these files at runtime.
- Only top-level constants are captured. All seven of its top-level constants are captured. A constant defined inside a
function or method is invisible to any stub generator; declare those in your own
bootstrapFiles, or list them under PHPStan'sdynamicConstantNames.
๐ Regenerating
composer install composer generate # reads source/easycommerce, writes both .stub files composer release # tag a new version for each untagged upstream release
bin/generate.sh expects the plugin unpacked at source/easycommerce; bin/release-latest-versions.sh
downloads each version from WordPress.org and tags it. Sources are gitignored โ the repository
carries stubs, not a copy of the plugin.
The finder reads app/. Assets, templates, language files and vendor/ are excluded:
they declare nothing a consumer calls, and vendored packages ship their own stubs.
๐ Package structure
phpstan-easycommerce-stubs/
โโโ bin/ # generate.sh, release scripts
โโโ configs/ # finder.php (what to read), bootstrap.php (WP constants)
โโโ source/ # plugin source, gitignored
โโโ tests/ # smoke tests over the generated stubs
โโโ easycommerce-stubs.stub # classes, interfaces, traits, functions
โโโ easycommerce-constants-stubs.stub # constants only
โโโ phpstan.neon # analyses the stubs themselves
๐ License
The tooling in this repository is MIT. The generated stubs are derived from EasyCommerce, which is GPL-licensed; using them for static analysis is fair use of the declarations, but redistributing them as your own product is not. See LICENSE.