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

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

efabrica/coding-standard
========================

PSR2 based coding standard for PHP PHP\_CodeSniffer

0.8.0(6mo ago)1183.3k↑151.1%[1 issues](https://github.com/efabrica-team/coding-standard/issues)1MITPHP

Since Aug 2Pushed 6mo ago3 watchersCompare

[ Source](https://github.com/efabrica-team/coding-standard)[ Packagist](https://packagist.org/packages/efabrica/coding-standard)[ RSS](/packages/efabrica-coding-standard/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (1)Dependencies (2)Versions (11)Used By (1)

eFabrica coding standards
=========================

[](#efabrica-coding-standards)

eFabrica coding standards for [PHP\_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) are based on [PSR2](https://github.com/squizlabs/PHP_CodeSniffer/tree/master/src/Standards/PSR2).

eFabrica coding standard
------------------------

[](#efabrica-coding-standard)

Is based on PSR2 and adds some rules:

1. Allows max. 1 empty line between code lines
2. Doesn't allow any whitespace at the end of lines
3. Doesn't allow any whitespace between closing parenthesis and return type colon
4. Requires exactly one space between type and variable
5. Requires exactly one space between return type colon and return type
6. Requires exactly one space before and after each operator
7. Requires exactly one space before and after . (dot) in string concatenating
8. Requires exactly one space after keywords private, protected, public, abstract, final
9. Requires exactly one blank line before and one blank line after namespace statement
10. Requires max. one namespace per file
11. Doesn't allow any blank lines between uses and trait uses
12. Requires one line before first use and one line after last use (not applied if it is trait use and it is first / last in class)
13. Requires exactly one blank line before and after each function except first and last
14. Requires exactly one blank line before and after each member var except first and last
15. Requires `new` with parentheses.
16. Prefer to use single quotes over double quotes. Double quotes are allowed if string contains variable
17. Requires trailing comma after the last element of multi-line array
18. Requires all class names as reference (no fully qualified or partial names - everything is in uses)
19. Requires all uses to be used
20. Requires alphabetically sorted uses
21. Disallows leading backslash for uses
22. Disallows snake\_case for properties, variables, function names, method names
23. Doesn't allow underscore in method names
24. Doesn't allow multiple spaces between type and property / variable / parameter
25. Class structure is defined as follows: uses, enum cases, constants, properties, constructor, methods
26. Requires visibility for all constants
27. Requires exactly one blank line between methods
28. Doesn't allow any useless comments

### Usage

[](#usage)

```
composer require efabrica/coding-standard --dev
vendor/bin/phpcs {dirs} --standard="vendor/efabrica/coding-standard/eFabrica" {other-options}
```

> for {dirs} use space-separated list of directories
> for {other-options} see `vendor/bin/phpcs --help` or visit [PHP\_CodeSniffer documentation](https://github.com/squizlabs/PHP_CodeSniffer)

eFabricaDeclareStrictAndUse
---------------------------

[](#efabricadeclarestrictanduse)

Is based on eFabrica coding standard and adds some rules:

1. Use `declare(strict_types=1);` at the top of each PHP file. Use one empty line before and also after declare
2. Requires all names (classes, functions, constants) as reference (no fully qualified or partial names - everything is in uses)

### Usage

[](#usage-1)

```
composer require efabrica/coding-standard --dev
vendor/bin/phpcs {dirs} --standard="vendor/efabrica/coding-standard/eFabricaDeclareStrictAndUse" {other-options}
```

> for {dirs} use space-separated list of directories
> for {other-options} see `vendor/bin/phpcs --help` or visit [PHP\_CodeSniffer documentation](https://github.com/squizlabs/PHP_CodeSniffer)

eFabricaStrict coding standard
------------------------------

[](#efabricastrict-coding-standard)

Is based on eFabricaDeclareStrictAndUse coding standard and adds some strict rules:

1. Requires each class to be declared either as abstract or as final

### Usage

[](#usage-2)

```
composer require efabrica/coding-standard --dev
vendor/bin/phpcs {dirs} --standard="vendor/efabrica/coding-standard/eFabricaStrict" {other-options}
```

> for {dirs} use space-separated list of directories
> for {other-options} see `vendor/bin/phpcs --help` or visit [PHP\_CodeSniffer documentation](https://github.com/squizlabs/PHP_CodeSniffer)

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance46

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.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 ~227 days

Recently: every ~305 days

Total

8

Last Release

202d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/25289c62a88df1c404543693ba52e44748dbce486bcfab91fc8c5931a6bb38e1?d=identicon)[dev-efabrica](/maintainers/dev-efabrica)

---

Top Contributors

[![lulco](https://avatars.githubusercontent.com/u/9377319?v=4)](https://github.com/lulco "lulco (21 commits)")[![adrianpanicek](https://avatars.githubusercontent.com/u/693432?v=4)](https://github.com/adrianpanicek "adrianpanicek (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[sylius-labs/coding-standard

Battle-tested coding standard configuration used in Sylius.

886.5M564](/packages/sylius-labs-coding-standard)[infinum/eightshift-coding-standards

Eightshift WordPress Coding Standards

1790.9k6](/packages/infinum-eightshift-coding-standards)[yoast/yoastcs

PHP\_CodeSniffer rules for Yoast projects

221.2M34](/packages/yoast-yoastcs)[mayflower/mo4-coding-standard

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

17534.2k7](/packages/mayflower-mo4-coding-standard)

PHPackages © 2026

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