haptiq/coding-standards

Haptiq Coding Standards

Maintainers

Package info

github.com/haptiq/coding-standards

Type:phpcodesniffer-standard

pkg:composer/haptiq/coding-standards

Transparency log

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.2.0 2026-06-19 22:30 UTC

This package is auto-updated.

Last update: 2026-06-19 22:51:04 UTC


README

PHPCS ruleset for WordPress projects developed at Haptiq.

Combines WordPress Coding Standards with PHPCompatibilityWP to catch both style violations and WordPress/PHP version compatibility issues.

Installation

composer require --dev haptiq/coding-standards

The Composer installer plugin registers the standard automatically โ€” no manual PHPCS path configuration needed.

Usage

Run PHPCS with the HaptiqWordPress standard:

vendor/bin/phpcs --standard=HaptiqWordPress .

Or copy the provided phpcs.xml.dist to your project root as phpcs.xml and run:

vendor/bin/phpcs

If phpcs.xml configures the use of HaptiqWordPress, run:

vendor/bin/phpcs

What it checks

Rule group Default severity What it covers
WordPress-Core warning WordPress coding style and conventions
WordPress-Extra warning Stricter WordPress best practices
PHPCompatibilityWP warning PHP and WP API version compatibility

All violations are warnings by default โ€” they are reported but do not block CI. See Adjusting severity to promote specific groups to errors.

Targets: PHP 7.4โ€“8.4 ยท WordPress 6.8+

Adjusting severity

To promote a rule group to an error in your project's phpcs.xml:

<rule ref="HaptiqWordPress/WordPress-Core">
    <type>error</type>
</rule>

Excluding rules

<rule ref="HaptiqWordPress">
    <exclude name="WordPress.Files.FileName"/>
</rule>

Adding docblock enforcement

WordPress-Docs is available but not included by default. Add it to your phpcs.xml:

<rule ref="WordPress-Docs"/>