arts / elementor-stubs
Comprehensive PHPStan stubs for Elementor and Elementor Pro WordPress page builder - auto-generated, self-contained, plug & play
Installs: 7
Dependents: 3
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/arts/elementor-stubs
Requires
- php: >=7.2
- ergebnis/composer-normalize: ^2.48
- php-stubs/woocommerce-stubs: ^10.4
- php-stubs/wordpress-stubs: ^6.9
- php-stubs/wp-cli-stubs: ^2.12
Requires (Dev)
- captainhook/captainhook: ^5.27
- php-stubs/generator: ^0.8
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.0
- vlucas/phpdotenv: ^5.6
- wp-coding-standards/wpcs: ^3.0
This package is auto-updated.
Last update: 2025-12-22 04:48:01 UTC
README
Comprehensive PHPStan stubs for Elementor and Elementor Pro WordPress page builder.
Auto-generated, self-contained, plug & play.
Installation
composer require --dev arts/elementor-stubs
Usage
Add to your phpstan.neon:
parameters: bootstrapFiles: - vendor/php-stubs/wordpress-stubs/wordpress-stubs.php - vendor/php-stubs/woocommerce-stubs/woocommerce-stubs.php - vendor/arts/elementor-stubs/elementor-stubs.php
The stubs include both Elementor Free and Elementor Pro type definitions.
Included Constants
The stubs define essential constants for static analysis:
Elementor Free:
ELEMENTOR_VERSIONELEMENTOR__FILE__ELEMENTOR_PLUGIN_BASEELEMENTOR_PATHELEMENTOR_URLELEMENTOR_ASSETS_PATHELEMENTOR_ASSETS_URL
Elementor Pro:
ELEMENTOR_PRO_VERSIONELEMENTOR_PRO__FILE__ELEMENTOR_PRO_PLUGIN_BASEELEMENTOR_PRO_PATHELEMENTOR_PRO_URLELEMENTOR_PRO_ASSETS_PATHELEMENTOR_PRO_ASSETS_URL
Regenerating Stubs
For contributors or to generate stubs from a specific Elementor version:
- Copy
.env.exampleto.env - Set
ELEMENTOR_PATHto your Elementor installation - Optionally set
ELEMENTOR_PRO_PATHfor Pro stubs - Run:
composer generate
cp .env.example .env
# Edit .env with your paths
composer generate