axepress / wp-graphql-stubs
WPGraphQL function and class declaration stubs for static analysis.
Fund package maintenance!
AxeWp
Installs: 240 699
Dependents: 10
Suggesters: 0
Security: 0
Stars: 7
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php-stubs/wordpress-stubs: ^5.4 || ^6.0
Requires (Dev)
- php: >=7.3
- php-stubs/generator: ^0.8.0
- phpstan/phpstan: ^1.8
Suggests
- szepeviktor/phpstan-wordpress: WordPress extensions for PHPStan
- dev-main
- v1.29.3
- v1.29.2
- v1.29.1
- v1.29.0
- v1.28.1
- v1.28.0
- v1.27.1
- v1.27.0
- v1.26.0
- v1.25.0
- v1.24.0
- v1.23.0
- v1.22.1
- v1.22.0
- v1.21.0
- v1.20.0
- v1.19.0
- v1.18.2
- v1.18.1
- v1.17.0
- v1.16.0+repack.1
- v1.15.0+repack.1
- v1.14.10+repack.1
- v1.14.9+repack.1
- v1.14.8+repack.1
- v1.14.7+repack.1
- v1.14.6+repack.1
- v1.14.5+repack.1
- v1.14.4+repack.1
- v1.14.3+repack.1
- v1.14.2+repack.1
- v1.14.0+repack.1
- v1.13.10+repack.1
- v1.13.9+repack.1
- v1.13.8+repack.1
- v1.13.7+repack.1
- v1.13.6+repack.1
- v1.13.5+repack.1
- v1.13.4+repack.1
- v1.13.2+repack.1
- v1.13.1+repack.1
- v1.13.0+repack.1
- v1.12.3+repack.1
- v1.12.2+repack.1
- v1.12.1+repack.1
- v1.12.0+repack.1
- v1.11.3+repack.1
- v1.11.2+repack.1
- v1.11.1+repack.1
- v1.11.0+repack.1
- v1.10.0+repack.1
- v1.9.1+repack.1
- v1.9.0+repack.1
- v1.8.7+repack.1
- v1.8.6+repack.1
- v1.8.5+repack.1
- v1.8.4+repack.1
- v1.8.3+repack.1
- v1.8.2+repack.1
- v1.8.1+repack.1
- v1.8.0+repack.1
- v1.7.2+repack.1
- v1.7.1+repack.1
- v1.7.0+repack.1
- v1.6.12+repack.1
- v1.6.11+repack.1
- v1.6.10+repack.1
- v1.6.9+repack.1
- v1.6.8+repack.1
- v1.6.7+repack.1
- v1.6.6+repack.1
- v1.6.5+repack.1
- v1.6.4+repack.1
- v1.6.3+repack.1
- v1.6.2+repack.1
- v1.6.1+repack.1
- v1.6.0+repack.1
- v1.5.9+repack.1
- v1.5.8+repack.1
- v1.5.7+repack.1
- v1.5.6+repack.1
- v1.5.5+repack.1
- v1.5.4+repack.1
- v1.5.3+repack.1
- v1.5.2+repack.1
- v1.5.1+repack.1
- v1.5.0+repack.1
- v1.4.3+repack.1
- v1.4.2+repack.1
- v1.4.1+repack.1
- v1.4.0+repack.1
- v1.3.10+repack.1
- v1.3.9+repack.1
- v1.3.8+repack.1
- v1.3.7+repack.1
- v1.3.6+repack.1
- v1.3.5+repack.1
- v1.3.4+repack.1
- v1.3.3+repack.1
- v1.3.2+repack.1
- v1.3.1+repack.1
- v1.3.0+repack.1
- v1.2.6+repack.1
- v1.2.5+repack.1
- v1.2.4+repack.1
- v1.2.3+repack.1
- v1.2.1+repack.1
- v1.2.0+repack.1
- v1.1.8+repack.1
- v1.1.7+repack.1
- v1.1.6+repack.1
- v1.1.5+repack.1
- v1.1.4+repack.1
- v1.1.3+repack.1
- v1.1.2+repack.1
- v1.1.1+repack.1
- v1.1.0+repack.1
- v1.0.5+repack.1
- v1.0.4+repack.1
- v1.0.3+repack.1
- v1.0.2+repack.1
- v1.0.1+repack.1
This package is auto-updated.
Last update: 2024-12-06 12:48:49 UTC
README
Provides stub declarations for WPGraphQL core functions, classes and interfaces. These stubs can help plugin and theme developers leverage static analysis tools like PHPStan.
The stubs are generated with php-stubs/generator.
Requirements
- PHP 7.3+
- Sodium PHP extension as latest WordPress core uses it and compat code is removed from stubs.
Installation
Require this package as a development dependency with Composer.
composer require --dev axepress/wp-graphql-stubs
Alternatively you may download wp-graphql-stubs.php
directly.
Usage with PHPStan
composer require --dev szepeviktor/phpstan-wordpress axepress/wp-graphql-stubs
The package szepeviktor/phpstan-wordpress
depends on phpstan/phpstan
.
Please do read
that package's README
and see the example
directory over there.
Versioning
This package is versioned to match the WPGraphQL version from which the stubs are generated.
When changes are made to the actual stub generation that require a new release, the old release is deleted and a new tag is created with the format x.x.x+repack.y
where x.x.x
is the WPGraphQL version and y
is the the repack iteration. This is necessary because Composer's SemVer implementation ignores build meta when determining the latest version.
If you already have an old build of the version installed, you will need to run composer update --no-cache
to get the latest repack.
Generating stubs for a different WPGraphQL version
- Clone this repository and
cd
into it. - Update
"wpackagist-plugin/wp-graphql": "x.x.x"
incomposer.json
with the desired version - Run
composer update
- Run
composer generate
The wp-graphql-stubs.php
file should now be updated.
Prior Art
- Based on php-stubs/woocommerce-stubs.
- Inspired by the original wp-graphql-stubs project.