The Modern Tribe Coding Standard for PHPCS

Installs: 20 376

Dependents: 7

Suggesters: 0

Security: 0

Stars: 7

Watchers: 3

Forks: 2

Open Issues: 1


v3.3.0 2023-10-13 14:59 UTC


The Modern Tribe Coding Standard is a set of PHP_CodeSniffer rules for use primarily with the SquareOne framework.


  • PHP ^8.0


Composer v2:

composer require --dev moderntribe/coding-standards "^3.0"`

Composer v1:

Add to the repositories object:

      "type": "vcs",
      "url": ""

And require-dev:

  "moderntribe/coding-standards": "^3.0"

Project ruleset

Ensure you're running PHP 8.0 locally!

To use this ruleset, create a phpcs.xml.dist in the root of the project and add the following content:

<?xml version="1.0"?>
	<arg name="basepath" value="." />
	<arg name="extensions" value="php" />
	<arg name="severity" value="4" />
	<arg name="tab-width" value="4" />
	<arg name="parallel" value="80" />
	<arg name="colors" />

	<!--  Update to the PHP version your production/local docker container runs on -->
	<config name="testVersion" value="8.0" />
	<!-- php -r 'echo PHP_VERSION_ID;' -->
	<config name="php_version" value="80022" />

	<!-- Fix WordPress's terrible typing breaking PHPCS -->
	<config name="minimum_supported_wp_version" value="5.6.0" />

	<!-- Ignore warnings, show progress of the run and show sniff names -->
	<arg value="nps" />

	<!-- Directories to be checked -->

	<!-- Exclude files -->

	<!-- Include the Modern Tribe coding standard -->
	<rule ref="ModernTribe" />

Add phpcs.xml to your .gitignore

Manual Usage


./vendor/bin/phpcs --standard=ModernTribe /path/to/files/**.php


./vendor/bin/phpcbf --standard=ModernTribe /path/to/files/**.php