PHPackages                             roslov/psr12ext - 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. roslov/psr12ext

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

roslov/psr12ext
===============

PSR-12 Extended Coding Standard

14.1.0(5mo ago)326.7k↓48.4%1[6 issues](https://github.com/roslov/psr12ext/issues)8MITPHP ^7.4|^8.0

Since Jun 5Pushed 5mo agoCompare

[ Source](https://github.com/roslov/psr12ext)[ Packagist](https://packagist.org/packages/roslov/psr12ext)[ RSS](/packages/roslov-psr12ext/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (33)Used By (8)

PSR-12 Extended Coding Standard
===============================

[](#psr-12-extended-coding-standard)

[![Latest Stable Version](https://camo.githubusercontent.com/366202087fc1c00d7765c4ff733e4df1de2f17264ddf0d8b307d017746ec1027/687474703a2f2f706f7365722e707567782e6f72672f726f736c6f762f70737231326578742f76)](https://packagist.org/packages/roslov/psr12ext)[![Total Downloads](https://camo.githubusercontent.com/3b4b731a2faeea4fb8179b7d933dcf642e89bcb8e37a8bad7830968e89cce8ff/687474703a2f2f706f7365722e707567782e6f72672f726f736c6f762f70737231326578742f646f776e6c6f616473)](https://packagist.org/packages/roslov/psr12ext)[![Latest Unstable Version](https://camo.githubusercontent.com/195147631f671b5e5907ed4bc1ed77b2e9fb36c5a3d4679dc72132d508f3196e/687474703a2f2f706f7365722e707567782e6f72672f726f736c6f762f70737231326578742f762f756e737461626c65)](https://packagist.org/packages/roslov/psr12ext)[![License](https://camo.githubusercontent.com/086818b7fa711ae78fe3847dcc676022b6ca914fdebbeb43be2062167b697611/687474703a2f2f706f7365722e707567782e6f72672f726f736c6f762f70737231326578742f6c6963656e7365)](https://packagist.org/packages/roslov/psr12ext)[![PHP Version Require](https://camo.githubusercontent.com/7b2fd355e153d4a0c3416feb31cbb923dd4b86c209ecf63a12f31fc02b4cc3ea/687474703a2f2f706f7365722e707567782e6f72672f726f736c6f762f70737231326578742f726571756972652f706870)](https://packagist.org/packages/roslov/psr12ext)

This repository extends the [PSR-12 coding style](https://www.php-fig.org/psr/psr-12/).

In addition to PSR-12 this coding style also contains some rules from the [Slevomat Coding Standard](https://github.com/slevomat/coding-standard)and [PHP\_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer).

Using This Code Style
---------------------

[](#using-this-code-style)

After CodeSniffer is installed, you can launch it with a custom code style using the following syntax:

```
composer require --dev roslov/psr12ext
./vendor/bin/phpcs --extensions=php --standard=PSR12Ext /app
```

If you are planning to integrate the code quality check with your IDE or CI, create the file `ruleset.xml` in the project’s root folder.

This file can include the list of rules you want to disable, as well as your custom settings. For example:

```

    Local Project Coding Standard

    vendor/*
    var/*

        tests/*

        tests/*

```

Instead of ``, you can run `phpcs --runtime-set php_version 80300`

The List Of Rules Used In This Coding Standard
----------------------------------------------

[](#the-list-of-rules-used-in-this-coding-standard)

All used rules with their options are described in [PSR12Ext/ruleset.xml](PSR12Ext/ruleset.xml).

Below you can find only names of the rules:

- **All rules of PSR12**:
    - *All rules of PSR1*:
        - Generic.Files.ByteOrderMark
        - Generic.NamingConventions.UpperCaseConstantName
        - Generic.PHP.DisallowAlternativePHPTags
        - Generic.PHP.DisallowShortOpenTag
        - Generic.PHP.DisallowShortOpenTag.EchoFound
        - Squiz.Classes.ValidClassName
    - Generic.ControlStructures.InlineControlStructure
    - Generic.Files.LineEndings
    - Generic.Files.LineLength
    - Generic.Formatting.DisallowMultipleStatements
    - Generic.Functions.FunctionCallArgumentSpacing
    - Generic.PHP.LowerCaseConstant
    - Generic.PHP.LowerCaseKeyword
    - Generic.PHP.LowerCaseType
    - Generic.WhiteSpace.DisallowTabIndent
    - Generic.WhiteSpace.GotoTargetSpacing
    - Generic.WhiteSpace.IncrementDecrementSpacing
    - Generic.WhiteSpace.ScopeIndent
    - PEAR.Functions.ValidDefaultValue
    - PSR2.Classes.ClassDeclaration
    - PSR2.Classes.PropertyDeclaration
    - PSR2.ControlStructures.ElseIfDeclaration
    - PSR2.ControlStructures.SwitchDeclaration
    - PSR2.Files.ClosingTag
    - PSR2.Files.EndFileNewline
    - PSR2.Methods.FunctionCallSignature
    - PSR2.Methods.FunctionCallSignature.OpeningIndent
    - PSR2.Methods.FunctionCallSignature.SpaceAfterCloseBracket
    - PSR2.Methods.FunctionClosingBrace
    - PSR2.Methods.MethodDeclaration
    - PSR2.Methods.MethodDeclaration.Underscore
    - Squiz.ControlStructures.ControlSignature
    - Squiz.ControlStructures.ForEachLoopDeclaration
    - Squiz.ControlStructures.ForEachLoopDeclaration.AsNotLower
    - Squiz.ControlStructures.ForEachLoopDeclaration.SpaceAfterOpen
    - Squiz.ControlStructures.ForEachLoopDeclaration.SpaceBeforeClose
    - Squiz.ControlStructures.ForLoopDeclaration
    - Squiz.ControlStructures.ForLoopDeclaration.SpacingAfterOpen
    - Squiz.ControlStructures.ForLoopDeclaration.SpacingBeforeClose
    - Squiz.ControlStructures.LowercaseDeclaration
    - Squiz.Functions.FunctionDeclaration
    - Squiz.Functions.FunctionDeclarationArgumentSpacing
    - Squiz.Functions.LowercaseFunctionKeywords
    - Squiz.Functions.MultiLineFunctionDeclaration
    - Squiz.Scope.MethodScope
    - Squiz.WhiteSpace.CastSpacing
    - Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen
    - Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose
    - Squiz.WhiteSpace.ScopeClosingBrace
    - Squiz.WhiteSpace.ScopeKeywordSpacing
    - Squiz.WhiteSpace.SuperfluousWhitespace
    - Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines
    - Squiz.WhiteSpace.SuperfluousWhitespace.EndFile
    - Squiz.WhiteSpace.SuperfluousWhitespace.StartFile
- **Custom rules:**
    - Generic.Arrays.DisallowLongArraySyntax
    - Generic.CodeAnalysis.EmptyPHPStatement
    - Generic.CodeAnalysis.EmptyStatement
    - Generic.CodeAnalysis.JumbledIncrementer
    - Generic.CodeAnalysis.UnnecessaryFinalModifier
    - Generic.CodeAnalysis.UnusedFunctionParameter
    - Generic.CodeAnalysis.UselessOverridingMethod
    - Generic.ControlStructures.DisallowYodaConditions
    - Generic.Files.EndFileNewline
    - Generic.Files.ExecutableFile
    - Generic.Formatting.SpaceAfterCast
    - Generic.NamingConventions.InterfaceNameSuffix
    - Generic.NamingConventions.TraitNameSuffix
    - Generic.PHP.DisallowRequestSuperglobal
    - Generic.PHP.Syntax
    - Generic.Strings.UnnecessaryHeredoc
    - Generic.VersionControl.GitMergeConflict
    - Generic.WhiteSpace.HereNowdocIdentifierSpacing
    - Generic.WhiteSpace.SpreadOperatorSpacingAfter
    - PEAR.ControlStructures.ControlSignature
    - PSR1.Files.SideEffects
    - PSR1.Files.SideEffects.FoundWithSymbols
    - PSR12.Classes.AnonClassDeclaration
    - PSR12.Classes.ClosingBrace
    - PSR12.ControlStructures.BooleanOperatorPlacement
    - PSR12.ControlStructures.ControlStructureSpacing
    - PSR12.Files.DeclareStatement
    - PSR12.Files.FileHeader
    - PSR12.Files.ImportStatement
    - PSR12.Files.OpenTag
    - PSR12.Functions.ReturnTypeDeclaration
    - PSR12.Properties.ConstantVisibility
    - PSR12.Traits.UseDeclaration
    - PSR2.Methods.FunctionCallSignature.SpaceBeforeCloseBracket
    - SlevomatCodingStandard.Arrays.ArrayAccess
    - SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation
    - SlevomatCodingStandard.Arrays.DisallowPartiallyKeyed
    - SlevomatCodingStandard.Arrays.SingleLineArrayWhitespace
    - SlevomatCodingStandard.Arrays.TrailingArrayComma
    - SlevomatCodingStandard.Attributes.AttributeAndTargetSpacing
    - SlevomatCodingStandard.Attributes.AttributesOrder
    - SlevomatCodingStandard.Attributes.DisallowAttributesJoining
    - SlevomatCodingStandard.Attributes.DisallowMultipleAttributesPerLine
    - SlevomatCodingStandard.Attributes.RequireAttributeAfterDocComment
    - SlevomatCodingStandard.Classes.BackedEnumTypeSpacing
    - SlevomatCodingStandard.Classes.ClassConstantVisibility
    - SlevomatCodingStandard.Classes.ClassLength
    - SlevomatCodingStandard.Classes.ClassMemberSpacing
    - SlevomatCodingStandard.Classes.ClassStructure
    - SlevomatCodingStandard.Classes.ConstantSpacing
    - SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants
    - SlevomatCodingStandard.Classes.DisallowMultiConstantDefinition
    - SlevomatCodingStandard.Classes.DisallowMultiPropertyDefinition
    - SlevomatCodingStandard.Classes.DisallowStringExpressionPropertyFetch
    - SlevomatCodingStandard.Classes.EnumCaseSpacing
    - SlevomatCodingStandard.Classes.MethodSpacing
    - SlevomatCodingStandard.Classes.ModernClassNameReference
    - SlevomatCodingStandard.Classes.ParentCallSpacing
    - SlevomatCodingStandard.Classes.PropertyDeclaration
    - SlevomatCodingStandard.Classes.PropertySpacing
    - SlevomatCodingStandard.Classes.RequireAbstractOrFinal
    - SlevomatCodingStandard.Classes.RequireMultiLineMethodSignature
    - SlevomatCodingStandard.Classes.RequireSelfReference
    - SlevomatCodingStandard.Classes.TraitUseSpacing
    - SlevomatCodingStandard.Classes.UselessLateStaticBinding
    - SlevomatCodingStandard.Commenting.AnnotationName
    - SlevomatCodingStandard.Commenting.DeprecatedAnnotationDeclaration
    - SlevomatCodingStandard.Commenting.DisallowCommentAfterCode
    - SlevomatCodingStandard.Commenting.DocCommentSpacing
    - SlevomatCodingStandard.Commenting.EmptyComment
    - SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration
    - SlevomatCodingStandard.Commenting.RequireOneDocComment
    - SlevomatCodingStandard.Commenting.UselessFunctionDocComment
    - SlevomatCodingStandard.Complexity.Cognitive
    - SlevomatCodingStandard.ControlStructures.DisallowContinueWithoutIntegerOperandInSwitch
    - SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing
    - SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses
    - SlevomatCodingStandard.ControlStructures.NewWithParentheses
    - SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator
    - SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator
    - SlevomatCodingStandard.ControlStructures.RequireNullSafeObjectOperator
    - SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn
    - SlevomatCodingStandard.ControlStructures.UselessTernaryOperator
    - SlevomatCodingStandard.Exceptions.DeadCatch
    - SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly
    - SlevomatCodingStandard.Exceptions.RequireNonCapturingCatch
    - SlevomatCodingStandard.Files.FileLength
    - SlevomatCodingStandard.Functions.ArrowFunctionDeclaration
    - SlevomatCodingStandard.Functions.DisallowEmptyFunction
    - SlevomatCodingStandard.Functions.NamedArgumentSpacing
    - SlevomatCodingStandard.Functions.RequireMultiLineCall
    - SlevomatCodingStandard.Functions.RequireTrailingCommaInCall
    - SlevomatCodingStandard.Functions.RequireTrailingCommaInClosureUse
    - SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration
    - SlevomatCodingStandard.Functions.StaticClosure
    - SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure
    - SlevomatCodingStandard.Functions.UselessParameterDefaultValue
    - SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses
    - SlevomatCodingStandard.Namespaces.DisallowGroupUse
    - SlevomatCodingStandard.Namespaces.MultipleUsesPerLine
    - SlevomatCodingStandard.Namespaces.NamespaceDeclaration
    - SlevomatCodingStandard.Namespaces.NamespaceSpacing
    - SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly
    - SlevomatCodingStandard.Namespaces.RequireOneNamespaceInFile
    - SlevomatCodingStandard.Namespaces.UnusedUses
    - SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash
    - SlevomatCodingStandard.Namespaces.UselessAlias
    - SlevomatCodingStandard.Namespaces.UseSpacing
    - SlevomatCodingStandard.Operators.NegationOperatorSpacing
    - SlevomatCodingStandard.Operators.RequireCombinedAssignmentOperator
    - SlevomatCodingStandard.Operators.SpreadOperatorSpacing
    - SlevomatCodingStandard.PHP.ForbiddenClasses
    - SlevomatCodingStandard.PHP.OptimizedFunctionsWithoutUnpacking
    - SlevomatCodingStandard.PHP.RequireExplicitAssertion
    - SlevomatCodingStandard.PHP.ShortList
    - SlevomatCodingStandard.PHP.UselessParentheses
    - SlevomatCodingStandard.PHP.UselessSemicolon
    - SlevomatCodingStandard.Strings.DisallowVariableParsing
    - SlevomatCodingStandard.TypeHints.ClassConstantTypeHint
    - SlevomatCodingStandard.TypeHints.DeclareStrictTypes
    - SlevomatCodingStandard.TypeHints.DNFTypeHintFormat
    - SlevomatCodingStandard.TypeHints.LongTypeHints
    - SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue
    - SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition
    - SlevomatCodingStandard.TypeHints.ParameterTypeHint
    - SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing
    - SlevomatCodingStandard.TypeHints.PropertyTypeHint
    - SlevomatCodingStandard.TypeHints.ReturnTypeHint
    - SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing
    - SlevomatCodingStandard.TypeHints.UselessConstantTypeHint
    - SlevomatCodingStandard.Variables.DisallowSuperGlobalVariable
    - SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable
    - SlevomatCodingStandard.Variables.UnusedVariable
    - SlevomatCodingStandard.Variables.UselessVariable
    - SlevomatCodingStandard.Whitespaces.DuplicateSpaces
    - Squiz.Classes.ClassDeclaration
    - Squiz.Classes.LowercaseClassKeywords
    - Squiz.Commenting.DocCommentAlignment
    - Squiz.Commenting.PostStatementComment
    - Squiz.PHP.NonExecutableCode
    - Squiz.Scope.StaticThisUsage
    - Squiz.Strings.ConcatenationSpacing
    - Squiz.Strings.DoubleQuoteUsage.NotRequired
    - Squiz.WhiteSpace.ControlStructureSpacing
    - Squiz.WhiteSpace.OperatorSpacing

Versioning
----------

[](#versioning)

PSR-12 Extended Coding Standard uses a `MAJOR.MINOR.PATCH` version number format.

The `MAJOR` version is incremented when:

- the major version of Slevomat Coding Standard is changed, or
- the major version of PHP\_CodeSniffer is changed, or
- the major version of PHP is added, or
- the minor version of PHP is removed, or
- backward-incompatible changes are made to the `ruleset.xml` format, or
- existing sniffs are removed from this standard (removed from the list).

The `MINOR` version is incremented when:

- the minor version of Slevomat Coding Standard is changed, or
- the minor version of PHP\_CodeSniffer is changed, or
- the minor version of PHP is added, or
- new sniffs are enabled in this standard (added to the list), or
- backward-compatible changes are made to the `ruleset.xml` format.

The `PATCH` version is incremented when:

- backward-compatible bug fixes are made.

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance50

Moderate activity, may be stable

Popularity30

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 98.6% 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 ~76 days

Recently: every ~7 days

Total

32

Last Release

177d ago

Major Versions

9.1.0 → 10.0.02024-04-07

10.0.1 → 11.0.02024-04-12

11.0.0 → 12.0.02025-09-18

12.0.0 → 13.0.02025-09-18

13.1.3 → 14.0.02025-10-26

PHP version history (3 changes)1.0.0PHP &gt;=7.1.0

7.0.0PHP ^7.2|^8.0

13.0.0PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/464fc58072b48a348a355eeca35b6fe2e341fd494b4ffb8e30f2007c3a2a6ad5?d=identicon)[tr](/maintainers/tr)

---

Top Contributors

[![roslov](https://avatars.githubusercontent.com/u/6573063?v=4)](https://github.com/roslov "roslov (71 commits)")[![shaunthegeek](https://avatars.githubusercontent.com/u/4971414?v=4)](https://github.com/shaunthegeek "shaunthegeek (1 commits)")

---

Tags

devcodesnifferpsr12slevomat

### Embed Badge

![Health badge](/badges/roslov-psr12ext/health.svg)

```
[![Health](https://phpackages.com/badges/roslov-psr12ext/health.svg)](https://phpackages.com/packages/roslov-psr12ext)
```

###  Alternatives

[symfony/contracts

A set of abstractions extracted out of the Symfony components

3.9k64.6M103](/packages/symfony-contracts)[yoast/yoastcs

PHP\_CodeSniffer rules for Yoast projects

221.1M29](/packages/yoast-yoastcs)[szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset

Hybrid PHPCS ruleset for OOP WordPress development

1149.1k9](/packages/szepeviktor-phpcs-psr-12-neutron-hybrid-ruleset)[mayflower/mo4-coding-standard

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

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

Strict PHP coding standard

19193.5k62](/packages/orisai-coding-standard)

PHPackages © 2026

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