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(5mo ago)838.5k↓100%14Apache-2.0PHP ^7.4 || ^8.0

Since Dec 21Pushed 5mo 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 1mo ago

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

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

48

—

FairBetter than 94% of packages

Maintenance72

Regular maintenance activity

Popularity32

Limited adoption so far

Community14

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

158d 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

[worksome/coding-style

Worksomes coding style

49771.7k57](/packages/worksome-coding-style)[laminas/laminas-coding-standard

Laminas Coding Standard

331.7M534](/packages/laminas-laminas-coding-standard)[nette/coding-standard

41930.0k15](/packages/nette-coding-standard)[shopsys/coding-standards

Coding standards definition compatible with PSR-2

20269.1k12](/packages/shopsys-coding-standards)[mrm-commerce/magento-coding-standard-phpcs

MRM Commerce PHP Code Sniffer Coding Standard designed for Magento 2 applications

4751.2k](/packages/mrm-commerce-magento-coding-standard-phpcs)[genealabs/php-coding-standards

1654.8k1](/packages/genealabs-php-coding-standards)

PHPackages © 2026

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