PHPCS sniffs for Alley Interactive

Installs: 50 080

Dependents: 29

Suggesters: 0

Security: 0

Stars: 5

Watchers: 33

Forks: 2

Open Issues: 3


v1.0.0 2022-12-12 15:42 UTC


This is a PHPCS ruleset for Alley Interactive.


To use this standard in a project, declare it as a dependency.

composer require alleyinteractive/alley-coding-standards

This will install the latest compatible version of PHPCS, WPCS, and VIPCS to your vendor directory in order to run sniffs locally.

You can also manually add this to your project's composer.json file as part of the require property:

"require": {
    "alleyinteractive/alley-coding-standards": "^1.0"


To use this standard with phpcs directly from your command line, use the command:

vendor/bin/phpcs --standard=Alley-Interactive .

Alternatively, you can set this as a composer script, which will automatically reference the correct version of phpcs and the dependent standards.

"scripts": {
    "phpcs" : "phpcs --standard=Alley-Interactive ."

Then use the following command:

composer run phpcs

You can also pass arguments to the composer phpcs script, following a -- operator like this:

composer run phpcs -- --report=summary

Extending the ruleset

You can create a custom ruleset for your project that extends or customizes these rules by creating your own phpcs.xml or phpcs.xml.dist file in your project, which references these rules, like this:

<?xml version="1.0"?>
  <description>Example project ruleset</description>

  <!-- Include Alley Rules -->
  <rule ref="Alley-Interactive" />

  <!-- Project customizations go here -->

Using Alley Coding Standards on PHP 8.1

If you plan on using this ruleset on PHP 8.1, you will need to make some modifications to your Composer configuration. For some context, the current version of this ruleset requires wp-coding-standards/wpcs 2.3. This package is not compatible with PHP 8.1 and runs into some issues when being used. Until wp-coding-standards/wpcs 3.0 is released we can use a forked version of the package that is compatible with PHP 8.1.

1. Add the Repository

Add the Composer repository to your project's composer.json file:

  "repositories": [
      "type": "vcs",
      "url": ""

2. Switch to the Forked Version

Add the following to your composer.json file autoload-dev section:

  "require-dev": {
    "alleyinteractive/alley-coding-standards": "^1.0",
    "wp-coding-standards/wpcs": "dev-php-8-1 as 2.3.x-dev",

3. Run composer update

If you run into any problems, please open an issue. After wp-coding-standards/wpcs 3.0 is released we will remove the above fork from our projects and rely on the official release.

Change Log

This project adheres to Keep a CHANGELOG.


  • No changes, tagging a stable release of Alley Coding Standards.


  • Upgrading to automattic/vipwpcs v2.3.3 and dealerdirect/phpcodesniffer-composer-installer v0.7.2.


  • Add PHPCompatibilityWP sniffs to our rules, configured for PHP 8.0+
  • Make template-parts rule checking more ambiguous to better support scanning standalone plugins and themes
  • Added static analysis keyword to Composer to promote package to be installed with --dev.


  • Add PHPCompatibilityWP standard as a dependency (#9)
  • Exclude plugin template parts from WordPress.NamingConventions.PrefixAllGlobals sniff (#11)
  • Remove 'wp_cache_set' from forbidden functions (#12)


  • Sniff name changed to Alley-Interactive.
  • Composer package renamed to alleyinteractive/alley-coding-standards.
  • Allow short ternary syntax (#6)


  • Initial release.