PHPackages                             max-antipin/php-code-sniffs - 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. max-antipin/php-code-sniffs

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

max-antipin/php-code-sniffs
===========================

Coding Standard for PHP\_CodeSniffer by Max Antipin provides sniffs with additional checks.

0.11.3(1mo ago)01121UnlicensePHPPHP &gt;=8.3

Since Mar 2Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/max-antipin/php-code-sniffs)[ Packagist](https://packagist.org/packages/max-antipin/php-code-sniffs)[ RSS](/packages/max-antipin-php-code-sniffs/feed)WikiDiscussions master Synced 1mo ago

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

Sniffs for [PHP\_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) by Max Antipin
===============================================================================================

[](#sniffs-for-php_codesniffer-by-max-antipin)

[![Quality Gate Status](https://camo.githubusercontent.com/4c6e5a4eee5473dda5ffca9c079e74c72856b4b78726ca10063f97becee24569/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6d61782d616e746970696e5f7068702d636f64652d736e69666673266d65747269633d616c6572745f737461747573)](https://sonarcloud.io/summary/new_code?id=max-antipin_php-code-sniffs)[![Bugs](https://camo.githubusercontent.com/c19b99098bc025f8212b6d987cd08fbc9f506594b3d8e6abac4681df5ad4ab69/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6d61782d616e746970696e5f7068702d636f64652d736e69666673266d65747269633d62756773)](https://sonarcloud.io/summary/new_code?id=max-antipin_php-code-sniffs)[![Code Smells](https://camo.githubusercontent.com/0aabcebd61f453c2e69eb6c1ce841c98038ce801089463be4703ce1bc9804024/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6d61782d616e746970696e5f7068702d636f64652d736e69666673266d65747269633d636f64655f736d656c6c73)](https://sonarcloud.io/summary/new_code?id=max-antipin_php-code-sniffs)[![Duplicated Lines (%)](https://camo.githubusercontent.com/ebb15eb31bb6067a1b04de913e0590b3bc7512d29383b4beaacddf1afca185e8/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6d61782d616e746970696e5f7068702d636f64652d736e69666673266d65747269633d6475706c6963617465645f6c696e65735f64656e73697479)](https://sonarcloud.io/summary/new_code?id=max-antipin_php-code-sniffs)[![Lines of Code](https://camo.githubusercontent.com/bc34dc753be183b87552ef7dd8cd3952b1d98cf1f1ee56d8507e0dd8c85a6276/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6d61782d616e746970696e5f7068702d636f64652d736e69666673266d65747269633d6e636c6f63)](https://sonarcloud.io/summary/new_code?id=max-antipin_php-code-sniffs)

[![Reliability Rating](https://camo.githubusercontent.com/4a1afbd4f3d75071c21840d59b35f3bd0740fe7df1e95efbb5026bec72ed8d19/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6d61782d616e746970696e5f7068702d636f64652d736e69666673266d65747269633d72656c696162696c6974795f726174696e67)](https://sonarcloud.io/summary/new_code?id=max-antipin_php-code-sniffs)[![Security Rating](https://camo.githubusercontent.com/e9088f5641435f60f9880d3064f99824c7f74c4d876502c5164938f863506275/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6d61782d616e746970696e5f7068702d636f64652d736e69666673266d65747269633d73656375726974795f726174696e67)](https://sonarcloud.io/summary/new_code?id=max-antipin_php-code-sniffs)[![Technical Debt](https://camo.githubusercontent.com/33d312ba29a220af1ecec2cf70460475fd5bcca45695b6db2c6b00a000fe079c/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6d61782d616e746970696e5f7068702d636f64652d736e69666673266d65747269633d7371616c655f696e646578)](https://sonarcloud.io/summary/new_code?id=max-antipin_php-code-sniffs)[![Maintainability Rating](https://camo.githubusercontent.com/4770471a01b2f7495f2b360bd2611e729c2185ccdaa0ee8ecc27a17c8b4b7bad/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6d61782d616e746970696e5f7068702d636f64652d736e69666673266d65747269633d7371616c655f726174696e67)](https://sonarcloud.io/summary/new_code?id=max-antipin_php-code-sniffs)[![Vulnerabilities](https://camo.githubusercontent.com/93d5dd0155b53727f8744520af2fa49e2082d4a20c35a2e65f881681dd793c0f/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d6d61782d616e746970696e5f7068702d636f64652d736e69666673266d65747269633d76756c6e65726162696c6974696573)](https://sonarcloud.io/summary/new_code?id=max-antipin_php-code-sniffs)

Development &amp; testing
-------------------------

[](#development--testing)

Start dev container:

```
docker compose -f .docker/compose.yaml up -d
```

For the first time run:

```
docker exec php-code-sniffs-dev composer install
```

Enter dev container:

```
docker exec -it php-code-sniffs-dev sh
```

Run all tests (or view this file to get list of commands for testing):

```
./test.sh
```

Run all tests without creating one more service:

```
PHP_VERSION=8.3 docker compose -f .docker/compose.yaml run --rm --build --quiet-build -e XDEBUG_MODE=off php-dev ./test.sh
```

Run service with test coverage:

```
docker compose -f .docker/compose.yaml up dev-coverage
```

The results will be stored in `var/coverage-report/`.

Below `PHP 8.4` there is a conflict between `PHP_CodeSniffer` and `nikic/php-parser` which causes fatal error: `Token T_PUBLIC_SET has ID of type string, should be int. You may be using a library with broken token emulation`. `nikic/php-parser` package is used by `PHPUnit` while calculation code coverage.

`PHP_CodeSniffer` file `src/Util/Tokens.php`, lines `183-194`:

```
// Some PHP 8.4 tokens, replicated for lower versions.
if (defined('T_PUBLIC_SET') === false) {
    define('T_PUBLIC_SET', 'PHPCS_T_PUBLIC_SET');
}

if (defined('T_PROTECTED_SET') === false) {
    define('T_PROTECTED_SET', 'PHPCS_T_PROTECTED_SET');
}

if (defined('T_PRIVATE_SET') === false) {
    define('T_PRIVATE_SET', 'PHPCS_T_PRIVATE_SET');
}
```

`nikic/php-parser` file `lib/PhpParser/compatibility_tokens.php`, lines `34-42`:

```
        foreach ($compatTokens as $token) {
            if (\defined($token)) {
                $tokenId = \constant($token);
                if (!\is_int($tokenId)) {
                    throw new \Error(sprintf(
                        'Token %s has ID of type %s, should be int. ' .
                        'You may be using a library with broken token emulation',
                        $token, \gettype($tokenId)
                    ));
                }
                // ...
            }
        }
```

Run test containers with all PHP versions and code coverage:

```
docker compose -f .docker/compose-test.yaml up --quiet-build
```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance80

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

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

Recently: every ~35 days

Total

6

Last Release

43d ago

PHP version history (2 changes)v0.9.0PHP &gt;=8.2

0.11.3PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/15674cb2af7574ebcf80404dd81ad9d0de126c58a04a1a5bb0956e53069a9470?d=identicon)[max-antipin](/maintainers/max-antipin)

---

Top Contributors

[![max-antipin](https://avatars.githubusercontent.com/u/92847830?v=4)](https://github.com/max-antipin "max-antipin (65 commits)")

---

Tags

standardsphpcsdevstatic analysis

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/max-antipin-php-code-sniffs/health.svg)

```
[![Health](https://phpackages.com/badges/max-antipin-php-code-sniffs/health.svg)](https://phpackages.com/packages/max-antipin-php-code-sniffs)
```

###  Alternatives

[slevomat/coding-standard

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

1.5k123.5M1.8k](/packages/slevomat-coding-standard)[wp-coding-standards/wpcs

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

2.7k42.5M1.6k](/packages/wp-coding-standards-wpcs)[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)[mayflower/mo4-coding-standard

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

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

PHPackages © 2026

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