mralaminahamed / fluent-cart-pro-stubs
Fluent Cart Pro function and class declaration stubs for static analysis.
Package info
github.com/mralaminahamed/phpstan-fluent-cart-pro-stubs
pkg:composer/mralaminahamed/fluent-cart-pro-stubs
Requires
- php: >=7.4
- mralaminahamed/fluent-cart-stubs: ^1.6
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
README
PHP stub declarations for Fluent Cart Pro, for IDE completion and static analysis. Generated with php-stubs/generator from the plugin source.
Generated from Fluent Cart Pro 1.5.3 โ 200 classes ยท 2 interfaces ยท 4 traits ยท 7 constants.
๐ Requirements
- PHP >= 7.4
mralaminahamed/fluent-cart-stubs, installed automatically: Pro extends the free plugin, so its declarations only resolve alongside them.
๐ฆ Installation
composer require --dev mralaminahamed/fluent-cart-pro-stubs
๐ง Configuration
parameters: scanFiles: # The free plugin first โ Pro's classes extend it. - vendor/mralaminahamed/fluent-cart-stubs/fluent-cart-stubs.stub - vendor/mralaminahamed/fluent-cart-stubs/fluent-cart-constants-stubs.stub - vendor/mralaminahamed/fluent-cart-pro-stubs/fluent-cart-pro-stubs.stub - vendor/mralaminahamed/fluent-cart-pro-stubs/fluent-cart-pro-constants-stubs.stub
โ ๏ธ Notes specific to a paid plugin
No source is redistributed here, and regeneration needs a licence. Fluent Cart Pro is commercial and
has no WordPress.org endpoint, so this repository carries only generated declarations โ empty
method bodies and signatures. There are no release scripts that poll for new versions, because
there is nothing public to poll; to regenerate, unpack a licensed copy at source/fluent-cart-pro and run
composer generate.
That also means the stubs lag behind Pro releases until someone with a licence regenerates them. Pin the version you tested against rather than tracking a range loosely.
โ ๏ธ General limitations
- Stubs are a snapshot of Fluent Cart Pro 1.5.3. Regenerate when a signature changes.
- Method bodies are empty by design. Never load these files at runtime.
- Only top-level constants are captured. All seven of Pro's are. A constant defined inside a
function or method is invisible to any stub generator โ declare those in your own
bootstrapFilesor under PHPStan'sdynamicConstantNames. - The WPFluent framework is not duplicated here. It ships inside the free plugin, namespaced
as
FluentCart\Framework, and comes fromfluent-cart-stubs. Declaring it twice would have PHPStan reporting redeclarations.
๐ Regenerating
composer install
# unpack a licensed copy of Fluent Cart Pro at source/fluent-cart-pro
composer generate
๐ Package structure
phpstan-fluent-cart-pro-stubs/
โโโ bin/generate.sh # regeneration, from a locally supplied source
โโโ configs/ # finder.php (what to read), bootstrap.php (WP constants)
โโโ source/ # licensed plugin source, gitignored
โโโ tests/ # smoke tests over the generated stubs
โโโ fluent-cart-pro-stubs.stub # classes, interfaces, traits
โโโ fluent-cart-pro-constants-stubs.stub # constants only
โโโ phpstan.neon # analyses the stubs themselves
๐ License
The tooling here is MIT. The generated declarations derive from Fluent Cart Pro, which is commercial software: they exist so static analysis can resolve its API, and they are not a substitute for a licence or a means of redistributing it. See LICENSE.