Skip to content

WordPress core test suite function and class declaration stubs for static analysis by PHPStan

License

Notifications You must be signed in to change notification settings

php-stubs/wordpress-tests-stubs

Repository files navigation

WordPress Core Test Suite Stubs

This package provides stub declarations for the WordPress Core Test Suite functions, classes and interfaces.

These stubs can help plugin and theme developers leverage static analysis tools like PHPStan, when writing tests for WordPress plugins, themes, and core.

Stubs are generated directly from the source using giacocorsiglia/stubs-generator.

Requirements

  • PHP >=7.3

Installation

Require this package as a development dependency with Composer.

composer require --dev php-stubs/wordpress-tests-stubs

Alternatively you may download wordpress-tests-stubs.php directly.

Usage in PHPStan

Include all stubs in PHPStan configuration file.

parameters:
    scanFiles:
        - %rootDir%/../../php-stubs/wordpress-stubs/wordpress-stubs.php
        - %rootDir%/../../php-stubs/wordpress-tests-stubs/wordpress-tests-stubs.php

About

WordPress core test suite function and class declaration stubs for static analysis by PHPStan

Resources

License

Stars

Watchers

Forks

Sponsor this project