Polylang and Polylang Pro function and class declaration stubs for static analysis.
Stubs are generated directly from the source using php-stubs/generator.
- PHP >=7.1
Require this package as a development dependency with Composer.
composer require --dev wpsyntex/polylang-stubs
Include the stubs in the PHPStan configuration file.
parameters: bootstrapFiles: - vendor/wpsyntex/polylang-stubs/polylang-stubs.php
It's also recommended to use the Polylang PHPStan extension wpsyntex/polylang-phpstan