PHPackages                             arxeiss/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. arxeiss/coding-standards

ActivePhpcodesniffer-standard[Utility &amp; Helpers](/categories/utility)

arxeiss/coding-standards
========================

Custom PHP CodeSniffer ruleset

v0.14.1(6mo ago)838.7k15Apache-2.0PHP ^7.4 || ^8.0

Since Dec 21Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/arxeiss/php-coding-standards)[ Packagist](https://packagist.org/packages/arxeiss/coding-standards)[ RSS](/packages/arxeiss-coding-standards/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (1)Versions (20)Used By (5)

PHP CodeSniffer - Custom standard ruleset
=========================================

[](#php-codesniffer---custom-standard-ruleset)

[![PHP from Packagist](https://camo.githubusercontent.com/0417dd6bd98ed138162b80c8b3e43bd7a0546c8a17aac3bca5e637cccd976bb1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f617278656973732f636f64696e672d7374616e6461726473)](https://packagist.org/packages/arxeiss/coding-standards)[![Packagist Version](https://camo.githubusercontent.com/96ab9bf14812703a268b93423cdc20c477dd6f9acad7e527e9aaee019d172cf3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617278656973732f636f64696e672d7374616e6461726473)](https://packagist.org/packages/arxeiss/coding-standards)

Custom ruleset for [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) with [Slevomat sniffs](https://github.com/slevomat/coding-standard). Ruleset is based on **PSR2 + PSR12** with additional rules, more detailed list is below. Ruleset is possible to use with **space indentation** and also **tabs indentation**.

Installation and running
------------------------

[](#installation-and-running)

Install with composer:

```
composer require --dev arxeiss/coding-standards
```

and run CodeSniffer

```
./vendor/bin/phpcs --standard=./vendor/arxeiss/coding-standards/Rules/phpcs-spaces.xml .
```

### Custom ruleset file

[](#custom-ruleset-file)

Better way is to create custom file `phpcs.xml`, with content like *phpcs.example.xml*. After that it is possible to run

```
./vendor/bin/phpcs --standard=./phpcs.xml
```

> More info about PHP CodeSniffer can be found in the [PHP CS wiki](https://github.com/squizlabs/PHP_CodeSniffer/wiki)

### Groups of sniffs

[](#groups-of-sniffs)

Package consist of multiple files based on the used sniffs.
There are 3 files basic files including all selected sniffs. Use *phpcs-spaces.xml* or *phpcs-tabs.xml*, not both. Optionally it is possible to add also *phpcs-strict.xml*.

- **phpcs-spaces.xml** - Contains all sniffs with space indentation
- **phpcs-tabs.xml** - Contains all sniffs with tabs indentation
- **phpcs-strict.xml** - Contains extra, more strict rules based on Slevomat rules

It can be handy to not include all sniffs at once, specially when migrating big project. Files above just including these partial files:

- **Parts/phpcs-psr.xml** - PSR2 + PSR12 standards
- **Parts/phpcs-use-spaces.xml** or **Parts/phpcs-use-tabs.xml** - Include only one file on the indentation preferences
- **Parts/phpcs-generic.xml** - Additional Generic rules
- **Parts/phpcs-pear.xml** - Additional PEAR rules
- **Parts/phpcs-squiz.xml** - Additional Squiz rules
- **Parts/phpcs-slevomat.xml** - Selected Slevomat rules

If building own ruleset based on partial files, always use *Parts/phpcs-psr.xml*, then *Parts/phpcs-use-spaces.xml* or *Parts/phpcs-use-tabs.xml*.
Later more additional rules can be added. See *phpcs.example.xml*.

Included sniffs
---------------

[](#included-sniffs)

See [SniffList](SniffsList.md), I wrote one sentence explanation for each used sniff into XML files.

Also Slevomat rules have some comments about in their repository Readme

More suggested
--------------

[](#more-suggested)

Check that Namespace matches file structure
-------------------------------------------

[](#check-that-namespace-matches-file-structure)

This is used from my own blog in Laravel, where main folder `app` is `BlogApp` namespace.

```

```

Since v0.11.0 `mixed` typehint is not required
----------------------------------------------

[](#since-v0110-mixed-typehint-is-not-required)

Explanation can be found here [\#6](https://github.com/arxeiss/php-coding-standards/pull/6)

If you want to force linter to use `mixed` typehint, you can enable by adding this into phpcs.xml file.

```

```

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance66

Regular maintenance activity

Popularity32

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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 ~120 days

Recently: every ~306 days

Total

19

Last Release

203d ago

PHP version history (4 changes)v0.1PHP ^7.1

v0.7.1PHP ^7.1 || ^8.0

v0.10.0PHP ^7.2 || ^8.0

v0.13.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/1347794365895adc762fab67e3e8bd39460ab7be355626bd666ec2c28e53dd49?d=identicon)[arxeiss](/maintainers/arxeiss)

---

Top Contributors

[![arxeiss](https://avatars.githubusercontent.com/u/5103109?v=4)](https://github.com/arxeiss "arxeiss (32 commits)")

---

Tags

custom-rulesetphp-codesnifferphpcsphpcs-psrphpcs-strictslevomat-rulessquiz

### Embed Badge

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

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

###  Alternatives

[nette/coding-standard

41933.9k19](/packages/nette-coding-standard)[laminas/laminas-coding-standard

Laminas Coding Standard

341.8M592](/packages/laminas-laminas-coding-standard)[worksome/coding-style

Worksomes coding style

49799.3k64](/packages/worksome-coding-style)[shopsys/coding-standards

Coding standards definition compatible with PSR-2

20276.8k20](/packages/shopsys-coding-standards)[contao/easy-coding-standard

EasyCodingStandard configurations for Contao

12221.3k327](/packages/contao-easy-coding-standard)[ramsey/coding-standard

A common coding standard for Ramsey's PHP libraries.

1095.3k40](/packages/ramsey-coding-standard)

PHPackages © 2026

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