Download the PHP package rtcamp/wp-phpcs without Composer
On this page you can find all versions of the php package rtcamp/wp-phpcs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rtcamp/wp-phpcs
More information about rtcamp/wp-phpcs
Files in rtcamp/wp-phpcs
Package wp-phpcs
Short Description rtCamp PHP_CodeSniffer standards for WordPress projects (rtCampWP + rtCampWP-Basic).
License GPL-2.0-or-later
Homepage https://github.com/rtCamp/wp-tooling/tree/main/composer-packages/phpcs
Informations about the package wp-phpcs
wp-phpcs
rtCamp's PHP_CodeSniffer standards for WordPress projects
(rtcamp/wp-phpcs): rtCampWP-Basic and the stricter rtCampWP.
Developed in rtCamp/wp-tooling. The
rtCamp/wp-phpcsrepository is a read-only mirror, split from there on each release. Please open issues and pull requests in wp-tooling.
Shared PHP_CodeSniffer standards for rtCamp WordPress projects. Each skeleton (plugin, theme, and future tracks) extends one of these instead of copying — and drifting — a long PHPCS config. The rules curate and combine:
- WordPress Coding Standards (WPCS)
- Automattic VIP Coding Standards
- PHPCompatibility
- Slevomat Coding Standard (strict tier only)
These are WordPress standards. The base sniffs (WPCS, VIP) assume a WordPress codebase and will be noisy on non-WordPress PHP — use a framework-agnostic standard for that.
Standards
| Standard | What it is | Use when |
|---|---|---|
rtCampWP |
The full strict superset: everything in rtCampWP-Basic plus short-array enforcement and the Slevomat strict-typing, code-quality and doc-block sniffs (declare(strict_types=1), mandatory parameter/property/return type hints, etc.). |
New or public projects ready to adopt strict types. Default for greenfield work. |
rtCampWP-Basic |
WPCS (WordPress-Extra) + WordPress-VIP-Go + WordPress-Docs + PHPCompatibilityWP, with modern idioms ([], ?:) allowed and one-blank-line function spacing. No strict-typing requirements. |
Adopting standards on an existing codebase, or when strict types are not yet practical. |
rtCampWP is rtCampWP-Basic plus the strict layer, so the two never diverge — there is a
single source of truth.
Installation
This pulls in PHPCS and every external sniff (WPCS, VIPCS, PHPCompatibilityWP, Slevomat), so
you do not list them yourself. The
PHP_CodeSniffer Standards Composer Installer
registers the standards automatically — just allow the plugin in your composer.json:
Confirm they registered with vendor/bin/phpcs -i — you should see rtCampWP and
rtCampWP-Basic in the list.
Usage
Add a phpcs.xml.dist at your project root that references the standard and supplies the
project-specific configuration the shared standard deliberately leaves out — the files to
scan, testVersion, minimum_wp_version, global prefixes, text domain, and file-naming mode:
A complete, commented starting point is in
phpcs.xml.dist.example — copy it to your project root, rename it
to phpcs.xml.dist, and adjust the values.
Overriding rules
Both standards are a starting point. Exclude or down-tune any sniff in your own
phpcs.xml.dist:
What stays in your project config (not the shared standard)
testVersion, minimum_wp_version, WordPress.WP.I18n text domain,
WordPress.NamingConventions.PrefixAllGlobals prefixes, WordPress.Files.FileName
(is_theme vs PSR-4), the <file> paths to scan, and per-path test excludes — these are
project-specific and live in your phpcs.xml.dist, never here.
License
GPL-2.0-or-later. See LICENSE.
All versions of wp-phpcs with dependencies
dealerdirect/phpcodesniffer-composer-installer Version ^1.0
wp-coding-standards/wpcs Version ^3.2
automattic/vipwpcs Version ^3.0
phpcompatibility/phpcompatibility-wp Version ^2.1
slevomat/coding-standard Version ~8.22.0
