PHPackages                             unleashedtech/php-coding-standard - 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. unleashedtech/php-coding-standard

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

unleashedtech/php-coding-standard
=================================

CodeSniffer ruleset used by Unleashed Technologies

v3.1.1(4y ago)0216.5k↑151.4%12MITPHP ^7.1 || ^8.0

Since Mar 7Pushed 10mo agoCompare

[ Source](https://github.com/jonnyeom/php-coding-standard)[ Packagist](https://packagist.org/packages/unleashedtech/php-coding-standard)[ Docs](https://github.com/unleashedtech/php-coding-standard)[ RSS](/packages/unleashedtech-php-coding-standard/feed)WikiDiscussions 4.0.x Synced 1w ago

READMEChangelogDependencies (4)Versions (23)Used By (12)

Unleashed Technologies PHP\_CodeSniffer Coding Standard
=======================================================

[](#unleashed-technologies-php_codesniffer-coding-standard)

[![Latest Version](https://camo.githubusercontent.com/f4bfb3aafbe88c2bee5841be37e35c77eeea5b3c9462db138bde22f933ec07e6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f756e6c656173686564746563682f7068702d636f64696e672d7374616e646172642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/unleashedtech/php-coding-standard)[![Total Downloads](https://camo.githubusercontent.com/4fcbeb324a3f2367132e03a8c50ed3a03c6c441090a949d4f0bb163d3f2646a4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f756e6c656173686564746563682f7068702d636f64696e672d7374616e646172642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/unleashedtech/php-coding-standard)[![Build Status](https://camo.githubusercontent.com/f71bf0b7b44c9c4087530290f1ed744eaba8e3f06d6579e15d798ecd5091eaf0/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f756e6c656173686564746563682f7068702d636f64696e672d7374616e646172642f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/unleashedtech/php-coding-standard)[![Software License](https://camo.githubusercontent.com/c2bffd81d308ced1cc3b0d66fb0ed453ab478a5e17c988b780f9de986a390ee2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

A PHP coding standard for Unleashed Technologies, originally based on [doctrine/coding-standard](https://github.com/doctrine/coding-standard).

Overview
--------

[](#overview)

This coding standard is based on [PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md) and [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md), with some noticeable exceptions/differences/extensions based on best-practices adopted by Symfony, Doctrine, and the wider community:

- Keep the nesting of control structures per method as small as possible
- Add spaces around a concatenation operator `$foo = 'Hello ' . 'World!';`
- Add spaces between assignment, control and return statements
- Add spaces after the colon in return type declaration `function (): void {}`
- Add spaces after a type cast `$foo = (int) '12345';`
- Use single-quotes for enclosing strings
- Always use strict comparisons
- Always add `declare(strict_types=1)` at the beginning of a file
- Always add native types where possible
- Omit phpDoc for parameters/returns with native types, unless adding description
- Don't use `@author`, `@since` and similar annotations that duplicate Git information
- Use parentheses when creating new instances that do not require arguments `$foo = new Foo()`
- Use Null Coalesce Operator `$foo = $bar ?? $baz`
- Use Null Safe Object Operator `$foo = $object?->property`
- Prefer early exit over nesting conditions or using else
- Always use fully-qualified global functions (without needing `use function` statements)
- Forbids the use of `\DateTime`

For full reference of enforcements, go through `src/Unleashed/ruleset.xml` where each sniff is briefly described.

Installation
------------

[](#installation)

You can install the Unleashed Coding Standard as a [Composer](https://getcomposer.org/) dependency in your project:

```
composer require --dev unleashedtech/php-coding-standard
```

Then you can use it like this:

```
vendor/bin/phpcs --standard=Unleashed /path/to/some/files.php
```

You can also use `phpcbp` to automatically find and fix any violations:

```
vendor/bin/phpcbf --standard=Unleashed /path/to/some/files.php
```

### Project-Level Ruleset

[](#project-level-ruleset)

To enable the Unleashed Coding Standard for your project, create a `phpcs.xml.dist` file with the following content:

```

    src
    tests

```

This will enable the full Unleashed Coding Standard with all rules included with their defaults. From now on you can just run `vendor/bin/phpcs` and `vendor/bin/phpcbf` without any arguments.

Don't forget to add `.phpcs-cache` and `phpcs.xml` (without `.dist` suffix) to your `.gitignore`. The first ignored file is a cache used by PHP CodeSniffer to speed things up, the second one allows any developer to adjust configuration locally without touching the versioned file.

For further reading about the CodeSniffer configuration, please refer to [the configuration format overview](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-Ruleset)and [the list of configuration options](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options).

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance40

Moderate activity, may be stable

Popularity32

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 69.7% 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 ~89 days

Recently: every ~264 days

Total

21

Last Release

865d ago

Major Versions

v0.1.1 → v2.0.0-alpha12020-04-07

1.x-dev → v2.0.0-alpha22020-04-07

v2.7.0 → v3.0.02021-04-13

v3.1.1 → 4.0.x-dev2024-01-26

PHP version history (5 changes)v0.1.0PHP &gt;=5.4.0

v2.0.0-alpha1PHP ^7.1

v1.0.0PHP &gt;=7.1.0

v2.6.1PHP ^7.1 || ^8.0

4.0.x-devPHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/4325b62a6ad366c731c3120595d861469be50f9da88df3ea99752c30ff98c179?d=identicon)[colinodell](/maintainers/colinodell)

![](https://www.gravatar.com/avatar/7d9a86dff06e980231b17661029866a88221218947d31f8b75bcd7d958597e8d?d=identicon)[jonnyeom](/maintainers/jonnyeom)

![](https://www.gravatar.com/avatar/1b4a05f5f91f08040a5da3529f35a62560c72fe9dbcc6609d11519f44cb30425?d=identicon)[dl-unleashed-technologies](/maintainers/dl-unleashed-technologies)

---

Top Contributors

[![colinodell](https://avatars.githubusercontent.com/u/202034?v=4)](https://github.com/colinodell "colinodell (76 commits)")[![jonnyeom](https://avatars.githubusercontent.com/u/19575068?v=4)](https://github.com/jonnyeom "jonnyeom (33 commits)")

---

Tags

phpcsCoding Standard

### Embed Badge

![Health badge](/badges/unleashedtech-php-coding-standard/health.svg)

```
[![Health](https://phpackages.com/badges/unleashedtech-php-coding-standard/health.svg)](https://phpackages.com/packages/unleashedtech-php-coding-standard)
```

###  Alternatives

[slevomat/coding-standard

Slevomat Coding Standard for PHP\_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.

1.5k130.4M2.1k](/packages/slevomat-coding-standard)[wp-cli/wp-cli-tests

WP-CLI testing framework

423.0M129](/packages/wp-cli-wp-cli-tests)[consistence/coding-standard

Consistence - Coding Standard - PHP Code Sniffer rules

76840.1k94](/packages/consistence-coding-standard)[acquia/coding-standards

PHP\_CodeSniffer rules (sniffs) for Acquia coding standards

234.9M33](/packages/acquia-coding-standards)[mreduar/laravel-phpcs

PHP Codesniffer ruleset to follow Laravel's coding style

3817.4k1](/packages/mreduar-laravel-phpcs)

PHPackages © 2026

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