PHPackages                             gpalab/coding-standards - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. gpalab/coding-standards

ActivePhpcodesniffer-standard[Testing &amp; Quality](/categories/testing)

gpalab/coding-standards
=======================

PHP\_CodeSniffer rules (sniffs) to enforce GPA Lab coding conventions

v1.1.0(1y ago)093MITPHP ^7.2 || ^8.0

Since Mar 31Pushed 1y ago2 watchersCompare

[ Source](https://github.com/IIP-Design/php-coding-standards)[ Packagist](https://packagist.org/packages/gpalab/coding-standards)[ Docs](https://github.com/IIP-Design/php-coding-standards)[ RSS](/packages/gpalab-coding-standards/feed)WikiDiscussions main Synced 5d ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

GPA Lab PHP Code Standards
==========================

[](#gpa-lab-php-code-standards)

This collection of PHP CodeSniffer rules helps ensure consistency across PHP projects developed and managed by the GPA Lab. It helps to maintain a high level of code quality and standardizes the team's approach to PHP projects.

The repository contains two ruleset:

- [GPA Lab Standard](#general-projects) - Base rules applicable to any PHP project
- [GPA Lab WordPress](#wordpress-projects) - An extension of the WordPress Coding Standards ruleset for use when developing WordPress plugins/themes

Rulesets
--------

[](#rulesets)

### General Projects

[](#general-projects)

The GPA Lab Standard ruleset is a general set of rule applicable to any PHP project. In order to utilize these standards, you will need to install the following dependencies into your project:

- `gpalab/coding-standards` - The ruleset defined in this repository.
- `squizlabs/php_codesniffer` - A tool that conducts static code analysis in order to identify and fix problems.
- `dealerdirect/phpcodesniffer-composer-installer` - A Composer plugin that handles the registration of standards with PHP CodeSniffer.

The recommended way to install these dependencies is to add them to the development requirements listed in your project's `composer.json` file. The result will look something like this:

```
{
  "name": "my-project",
  "require-dev": {
    "gpalab/coding-standards": "v1.0.0",
    "squizlabs/php_codesniffer": "^3.6.2",
    "dealerdirect/phpcodesniffer-composer-installer": "^v0.7.1"
  }
}
```

With this done, run `composer install` to install the dependencies to your project.

Once installed, you will need to identify which ruleset PHP Code Sniffer should utilize. The easiest way to do so is by adding a PHP Code Sniffer configuration file such as `.phpcs.xml` to the root of your project. In this file, use the `rule` tag to reference the GPA Lab standard ruleset using the key `GPA-Lab`. The result will look something like this:

```

  *.php

  */vendor

```

### WordPress Projects

[](#wordpress-projects)

This repository also contains a ruleset for use with WordPress projects (such as plugins and themes). In addition to the PHP best practice and style rules in the standard ruleset, this ruleset includes Wordpress-specific rules and best practices.

The process for installing the WordPress ruleset is largely the same. However, since we are extending the WordPress ruleset, you will also need to install the following peer dependencies: `php-compatibility`, `phpcompatibility-wp`, and `wp-coding-standards/wpcs`. The resulting composer.json file will look like this:

```
{
  "name": "my-wordpress-project",
  "require-dev": {
    "gpalab/coding-standards": "v1.0.0",
    "squizlabs/php_codesniffer": "^3.7.1",
    "dealerdirect/phpcodesniffer-composer-installer": "^v0.7.1",
    "phpcompatibility/php-compatibility": "*",
    "phpcompatibility/phpcompatibility-wp": "^2.1.3",
    "wp-coding-standards/wpcs": "^2.3.0"
  }
}
```

Your PHP Code Sniffer configuration file will look the same, except that you should use the `GPA-Lab-WordPress` reference key rather than the `GPA-Lab` key.

```

  *.php

  */vendor

```

Usage
-----

[](#usage)

### CI

[](#ci)

Often times, the easiest way to run PHP Code Sniffer in a continuous integration context is by adding an NPM script to execute the test. For example:

```
"lint:PHP": "./vendor/bin/phpcs -n",
```

This script requires that PHP Code Sniffer is installed into the project's vendor directory, so make sure that you run `composer install` or `composer update` before executing this command.

*Note:* The `-n` flag indicates that warnings should be omitted.

### VSCode

[](#vscode)

There are a number of ways to integrate PHP Code Sniffer into your local IDE. For VSCode, we have found that the combination of these two extensions works best:

- [PHP Intelephense](https://marketplace.visualstudio.com/items?itemName=bmewburn.vscode-intelephense-client)
- [PHP Sniffer &amp; Beautifier](https://marketplace.visualstudio.com/items?itemName=ValeryanM.vscode-phpsab)

Thanks
------

[](#thanks)

This project owes a huge debt to the [WordPress Coding Standards](https://github.com/WordPress/WordPress-Coding-Standards) project, which provided both inspiration and a sane set of defaults on which we were able to build.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance47

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~556 days

Total

3

Last Release

393d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bf8b3cccc3a75f78e397b32e59f9d746c325a65b253fa0ec17eefd2495f21240?d=identicon)[mrewers](/maintainers/mrewers)

---

Top Contributors

[![mrewers](https://avatars.githubusercontent.com/u/8512964?v=4)](https://github.com/mrewers "mrewers (8 commits)")

---

Tags

phpphp-codesnifferphpcsrulesetstandardsphpcsgpalab

### Embed Badge

![Health badge](/badges/gpalab-coding-standards/health.svg)

```
[![Health](https://phpackages.com/badges/gpalab-coding-standards/health.svg)](https://phpackages.com/packages/gpalab-coding-standards)
```

###  Alternatives

[wp-coding-standards/wpcs

PHP\_CodeSniffer rules (sniffs) to enforce WordPress coding conventions

2.7k42.5M1.6k](/packages/wp-coding-standards-wpcs)[dealerdirect/phpcodesniffer-composer-installer

PHP\_CodeSniffer Standards Composer Installer Plugin

596161.9M1.9k](/packages/dealerdirect-phpcodesniffer-composer-installer)[phpcompatibility/phpcompatibility-wp

A ruleset for PHP\_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.

21830.6M587](/packages/phpcompatibility-phpcompatibility-wp)[phpcsstandards/phpcsextra

A collection of sniffs and standards for use with PHP\_CodeSniffer.

10224.3M44](/packages/phpcsstandards-phpcsextra)[acquia/coding-standards

PHP\_CodeSniffer rules (sniffs) for Acquia coding standards

214.8M28](/packages/acquia-coding-standards)[yoast/yoastcs

PHP\_CodeSniffer rules for Yoast projects

221.1M29](/packages/yoast-yoastcs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
