Download the PHP package rtcamp/wp-phpstan without Composer
On this page you can find all versions of the php package rtcamp/wp-phpstan. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rtcamp/wp-phpstan
More information about rtcamp/wp-phpstan
Files in rtcamp/wp-phpstan
Package wp-phpstan
Short Description rtCamp PHPStan configuration and baseline for WordPress projects.
License GPL-2.0-or-later
Homepage https://github.com/rtCamp/wp-tooling/tree/main/composer-packages/phpstan
Informations about the package wp-phpstan
wp-phpstan
rtCamp's shared PHPStan baseline for WordPress projects (rtcamp/wp-phpstan).
Developed in rtCamp/wp-tooling. The
rtCamp/wp-phpstanrepository is a read-only mirror, split from there on each release. Please open issues and pull requests in wp-tooling.
This package ships a single phpstan.neon.dist of rtCamp defaults (level 5, WordPress-aware
rules) and pulls in szepeviktor/phpstan-wordpress,
which loads the WordPress function stubs and dynamic return-type extensions PHPStan
needs to understand core.
Install
This brings phpstan/phpstan and szepeviktor/phpstan-wordpress (and the WordPress
stubs) along with it — you do not need to require them separately.
Use
Create a phpstan.neon.dist at your project root that includes this baseline,
then point PHPStan at your code:
That single include is all you need. Run the analysis with:
The WordPress extension must load exactly once. This baseline already includes
szepeviktor/phpstan-wordpress, and loading it twice fails PHPStan. So: don't include itsextension.neonin your own neon, and if you usephpstan/extension-installer, make it skip the package incomposer.json:
Overriding
Anything you set under parameters after the includes wins, so a project can
raise the level, add paths, or add ignoreErrors without forking this baseline.
Per-project suppressions belong in your own neon — keep this shared file clean.
License
GPL-2.0-or-later. See LICENSE.
