### Install via Composer Source: https://github.com/szepeviktor/phpstan-wordpress/blob/2.x/README.md Use Composer to add the extension as a development dependency. ```bash composer require --dev szepeviktor/phpstan-wordpress ``` -------------------------------- ### Configure PHPStan Parameters Source: https://github.com/szepeviktor/phpstan-wordpress/blob/2.x/README.md Example configuration for PHPStan analysis levels and paths. ```neon parameters: level: 5 paths: - plugin.php - inc/ ``` -------------------------------- ### Documenting apply_filters() with PHPDoc Source: https://github.com/szepeviktor/phpstan-wordpress/blob/2.x/README.md Example of using a docblock to define the return type for an apply_filters call. ```php /** * Filters the page title when creating an HTML drop-down list of pages. * * @param string $title Page title. * @param WP_Post $page Page data object. */ $title = apply_filters( 'list_pages', $title, $page ); ``` -------------------------------- ### Run PHPStan Analysis Source: https://github.com/szepeviktor/phpstan-wordpress/blob/2.x/README.md Execute the analysis using the vendor binary. ```bash vendor/bin/phpstan analyze ``` -------------------------------- ### Manual Configuration in PHPStan Source: https://github.com/szepeviktor/phpstan-wordpress/blob/2.x/README.md Include the extension manually in your project's PHPStan configuration file if not using the extension-installer. ```neon includes: - vendor/szepeviktor/phpstan-wordpress/extension.neon ``` -------------------------------- ### Exclude Function Stubs with sed Source: https://github.com/szepeviktor/phpstan-wordpress/blob/2.x/README.md Use sed to rename function stubs to avoid conflicts with conditional definitions in WordPress. ```bash sed -i -e 's#function is_gd_image#function __is_gd_image#' vendor/php-stubs/wordpress-stubs/wordpress-stubs.php ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.