PHPackages                             sparhandy/codingstandard - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. sparhandy/codingstandard

ActivePhpcodesniffer-standard[PSR &amp; Standards](/categories/psr-standards)

sparhandy/codingstandard
========================

This is the Sparhandy coding standard.

2.0.0(8y ago)31.1k31BSD-3-ClausePHPPHP &gt;=5.4.0

Since Nov 30Pushed 7y ago11 watchersCompare

[ Source](https://github.com/Sparhandy/CodingStandard)[ Packagist](https://packagist.org/packages/sparhandy/codingstandard)[ Docs](https://github.com/Sparhandy/CodingStandard)[ RSS](/packages/sparhandy-codingstandard/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (5)Dependencies (4)Versions (12)Used By (1)

[![Build Status](https://camo.githubusercontent.com/60f7c03d4b55ec8bd1cff1f00f6663acba9694f819722ba2a845a876d6e71b65/68747470733a2f2f7472617669732d63692e6f72672f5370617268616e64792f436f64696e675374616e646172642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Sparhandy/CodingStandard) ![Github Releases](https://camo.githubusercontent.com/c12a2701d49cb7b2743193e18da73d9b2b44c6396e0e21fe26f338f89a0c7221/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f5370617268616e64792f436f64696e675374616e646172642f6c61746573742f746f74616c2e737667) ![Release](https://camo.githubusercontent.com/483c66bf8be7e127bd38529c9db19275d44b7212b42ef0d162a0808f24c0a3b0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f5370617268616e64792f436f64696e675374616e646172642e737667) ![Packagist](https://camo.githubusercontent.com/a191015d5784c0ab656754227f64853b20bd1212d77168abc4c799c444d1f50a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f5370617268616e64792f436f64696e675374616e646172642e737667)

Sparhandy Coding Standard
=========================

[](#sparhandy-coding-standard)

This repository contains all necessary files to configure PHP Code Sniffer and PHP Mess Detector according to our coding standard.

Installation with composer
--------------------------

[](#installation-with-composer)

For now you have to use the dev-master version.

```
composer require "sparhandy/codingstandard" "dev-master"
```

Usage
-----

[](#usage)

### From Terminal (Cli)

[](#from-terminal-cli)

#### PHP Code Sniffer

[](#php-code-sniffer)

To execute PHP Code Sniffer configured for sparhandy coding standards do the following.

```
./vendor/bin/phpcs --extensions=php --standard=./vendor/sparhandy/codingstandard/src/phpcs/Production/ruleset.xml ./path/to ./your/sources
```

#### PHP Mess Detector

[](#php-mess-detector)

To execute PHP Mess Detector configured for sparhandy coding standards do the following.

```
./vendor/bin/phpmd ./path/to ./your/sources text ./vendor/sparhandy/codingstandard/src/phpmd/phpmd.xml --suffixes php
```

### Travis-CI configuration

[](#travis-ci-configuration)

For use in your Travis-Ci configuration file just adapt the following example and save it to .travis.yml in your root directory.

```
language: php

php:
  - 5.4
  - 5.5
  - 5.6
  - 7.0

matrix:
  allow_failures:
    - php: 7.0

before_script:
  - composer self-update

install: travis_retry composer update

script:
  - ./vendor/bin/phpmd ./path/to ./your/sources text ./configuration/phpmd/phpmd.xml --suffixes php
  - ./vendor/bin/phpcs --extensions=php --standard=./configuration/phpcs/Production/ruleset.xml ./path/to ./your/sources

```

How to contribute
=================

[](#how-to-contribute)

If you want to contribute to the standard here is how it works.

- Create a fork of Sparhandy/CodingStandard.
- Create your branch from master and commit your changes.
- Push your branch to your fork.
- Create a pull request on GitHub.
- Discuss your pull request with us.
- Our devs will then merge or close the pull request.

Acknowledgements
================

[](#acknowledgements)

This would not be possible without the tremendous work of the good people at [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer) and [PHP Mess Detector](https://github.com/phpmd/phpmd) and of course the authors annotated in the source files.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 61.5% 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 ~26 days

Recently: every ~14 days

Total

11

Last Release

2829d ago

Major Versions

1.0.0.1 → 2.0.02018-04-20

### Community

Maintainers

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

---

Top Contributors

[![sk-sparhandy](https://avatars.githubusercontent.com/u/7532845?v=4)](https://github.com/sk-sparhandy "sk-sparhandy (8 commits)")[![d1m1-87](https://avatars.githubusercontent.com/u/31273041?v=4)](https://github.com/d1m1-87 "d1m1-87 (3 commits)")[![AmTagEndeSlashSchreiber](https://avatars.githubusercontent.com/u/33055309?v=4)](https://github.com/AmTagEndeSlashSchreiber "AmTagEndeSlashSchreiber (1 commits)")[![hco](https://avatars.githubusercontent.com/u/156839?v=4)](https://github.com/hco "hco (1 commits)")

---

Tags

standardsphpcssparhandy

### Embed Badge

![Health badge](/badges/sparhandy-codingstandard/health.svg)

```
[![Health](https://phpackages.com/badges/sparhandy-codingstandard/health.svg)](https://phpackages.com/packages/sparhandy-codingstandard)
```

###  Alternatives

[phpcompatibility/php-compatibility

A set of sniffs for PHP\_CodeSniffer that checks for PHP cross-version compatibility.

2.3k74.3M1.3k](/packages/phpcompatibility-php-compatibility)[automattic/vipwpcs

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

25510.2M145](/packages/automattic-vipwpcs)[mayflower/mo4-coding-standard

PHP CodeSniffer ruleset implementing the MO4 coding standards extending the Symfony coding standards.

17508.3k5](/packages/mayflower-mo4-coding-standard)[drupal/coder

Coder is a library to review Drupal code.

3043.6M461](/packages/drupal-coder)[wptrt/wpthemereview

PHP\_CodeSniffer rules (sniffs) to verify theme compliance with the rules for theme hosting on wordpress.org

217736.5k29](/packages/wptrt-wpthemereview)[yoast/yoastcs

PHP\_CodeSniffer rules for Yoast projects

221.1M29](/packages/yoast-yoastcs)

PHPackages © 2026

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