PackageTrack
Sign in Get early access

fig-r/psr2r-sniffer

Code-Sniffer, Auto-Fixer and Tokenizer for PSR2-R

2.9.0 1.4M downloads/mo #4620 most downloaded on Packagist php-fig-rectified/psr2r-sniffer

What this package is like to depend on

Last release 17 days ago

06 Aug 2026

Release timing varies

gaps range from 2 weeks to 4 months

Rarely documented

notes for 10 of 45 stable releases

Nothing withdrawn

no release was ever pulled

11 years old

46 releases · first in 2016

12 releases in the last 12 months

see the full history below

Release timeline

46 releases · Feb 2016 to Aug 2026
2017 2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 46
  1. 2.9.0 06 Aug 2026
    Release notes

    Fixes

    • Security: raise the squizlabs/php_codesniffer floor to ^4.0.2. CVE-2026-67434, an OS command injection advisory published 2026-08-05, covers >=4.0.0,<4.0.2. The previous constraint allowed an affected version.

    • Generic.PHP.DeprecatedFunctions was effectively disabled (#45). The ruleset set the sniff's forbiddenFunctions property, which replaces the list the sniff builds in its constructor from the Reflection API rather than adding to it. The standard reported fewer deprecations than plain Generic did - utf8_encode() among them. Removed functions such as create_function() and each() moved to Generic.PHP.ForbiddenFunctions, where a property override is safe.

    Improvements

    • Duplicate reporting removed (#47). Four constructs were each flagged by two rules at once: inline assignment, method modifier order, double semicolons and Yoda conditions. In every case the rule with the wider coverage stays and the narrower one is silenced, so the same code is still caught - once instead of twice.

    Removed sniffs

    Both are fully covered by rules the standard already enables, so nothing stops being reported. Only the error codes change, which is why this is a minor rather than a patch - adjust any baseline or phpcs:ignore that names them.

    • PSR2R.PHP.DuplicateSemicolon (#47), superseded by SlevomatCodingStandard.PHP.UselessSemicolon, which reports everything it did and also catches a stray ; after a block.

    • PSR2R.WhiteSpace.UnaryOperatorSpacing, superseded by PhpCollective.WhiteSpace.ImplicitCastSpacing together with Generic.WhiteSpace.IncrementDecrementSpacing, both already enabled here. The reference operator was the last construct only the PSR2R sniff handled; php-collective/code-sniffer 0.6.7 covers it, and the floor moves to ^0.6.7 accordingly. The replacement also catches ! $b, which the PSR2R sniff missed.

    Note

    Most PSR2R rules come from php-collective/code-sniffer. Its 0.6.5 to 0.6.7 releases land here with this bump and carry several fixes to sniffs PSR2R enables, including ConsistentIndent on PHP 8.4 property hooks, attribute names being rewritten as function calls, and DocBlockTagGrouping reporting a fix it never applied.

    Full Changelog: 2.8.1...2.9.0

    Open source →
  2. 2.8.1 28 Jun 2026
    Release notes

    Fixes

    • Changed PSR2R.PHP.PreferStaticOverSelf to skip self:: usages inside final classes.
    • This avoids a fixer conflict with Universal.CodeAnalysis.StaticInFinalClass, which correctly prefers self:: where late static binding cannot apply.

    Full Changelog: 2.8.0...2.8.1

    Open source →
  3. 2.8.0 08 Jun 2026
    Release notes

    Fixes

    • PSR2R.Commenting.DocBlock: skip fully-typed methods. Methods whose parameters and return type are all natively typed no longer require a docblock, reducing noise on modern PHP 8.1+ codebases.
    • PSR2R.WhiteSpace.DocBlockAlignment: avoid a PHPCBF max-loop conflict with PSR2R.WhiteSpace.TabIndent when fixing over-indented docblocks. The fixer now keeps structural docblock indentation tab-based instead of alternating between spaces and tabs. #43

    Improvements

    • Bumped php-collective/code-sniffer to ^0.6.0, picking up its upstream fixes (including the DocBlockParamAllowDefaultValue positional-mismatch fix and additional type-safety improvements across sniffs).
    • Enabled 22 additional sniffs to stay aligned with php-collective/code-sniffer 0.6:
      • UniversalAnonClassKeywordSpacing, FirstClassCallableSpacing, Operators.TypeSeparatorSpacing, Attributes.BracketSpacing, Attributes.DisallowAttributeParentheses, Attributes.TrailingComma, ControlStructures.DisallowAlternativeSyntax, CodeAnalysis.NoEchoSprintf, CodeAnalysis.ConstructorDestructorReturn, CodeAnalysis.ForeachUniqueAssignment, CodeAnalysis.StaticInFinalClass
      • SlevomatCodingStandardArrays.ArrayAccess, Attributes.AttributeAndTargetSpacing, Attributes.RequireAttributeAfterDocComment, Classes.BackedEnumTypeSpacing, Classes.EnumCaseSpacing, Classes.ClassMemberSpacing, Functions.NamedArgumentSpacing, ControlStructures.LanguageConstructWithParentheses, PHP.ForbiddenClasses
      • SquizPHP.DisallowSizeFunctionsInLoops, WhiteSpace.FunctionOpeningBraceSpace

    Full Changelog: 2.7.1...2.8.0

    Open source →
  4. 2.7.1 24 Jan 2026
    Release notes

    Fixes

    • Allow @link and @see as inline doc comment markers
    • Relax docblocks when fully typed (as per parent lib)
    • Improve DocBlockReturnSelfSniff and DocBlockParamNotJustNullSniff (as per parent lib)

    Full Changelog: 2.7.0...2.7.1

    Open source →
  5. 2.7.0 27 Nov 2025
    Release notes

    Improvements

    • Fix up new code-sniffer dependency v0.5 compatibility. Adds 1 sniff, removed 1.

    Notable change: Attributes are now handled like classes, so no FQCN inside, but normal use statements.

    Full Changelog: 2.6.1...2.7.0

    Open source →
  6. 2.6.1 12 Nov 2025
    Release notes

    Fixes

    • Fixed up TabAndSpaceSniff issues

    Full Changelog: 2.6.0...2.6.1

    Open source →
  7. 2.6.0 25 Oct 2025
    Release notes

    Improvements

    • Cleaned up signatures.
    • Added PSR2R.WhiteSpace.ArrayDeclarationSpacing sniff
    • Added Squiz.WhiteSpace.ScopeClosingBrace sniff

    Full Changelog: 2.5.0...2.6.0

    Open source →
  8. 2.5.0 22 Oct 2025
    Release notes

    Improvements

    • Added Squiz.ControlStructures.ForLoopDeclaration sniff
    • Improved PSR2R.ControlStructures.ControlStructureSpacing sniff

    Full Changelog: 2.4.3...2.5.0

    Open source →
  9. 2.4.3 22 Oct 2025
    Release notes

    Fixes

    • Fixed up UnneededElse sniff
    Open source →
  10. 2.4.2 20 Oct 2025
    Release notes

    Fixes

    • Added missing if/else sniffs.
    Open source →
  11. 2.4.1 20 Oct 2025

    Nothing published for this version

  12. 2.4.0 29 Sep 2025

    Nothing published for this version

  13. 2.3.0 23 Aug 2025

    Nothing published for this version

  14. 2.2.1 12 May 2025

    Nothing published for this version

  15. 2.2.0 29 Mar 2025

    Nothing published for this version

  16. 2.1.2 23 Dec 2024

    Nothing published for this version

  17. 2.1.1 15 Nov 2024

    Nothing published for this version

  18. 2.1.0 29 Mar 2024

    Nothing published for this version

  19. 2.0.0 15 Oct 2023

    Nothing published for this version

  20. 1.5.1 23 Sep 2023

    Nothing published for this version

  21. 1.5.0 01 Jan 2023

    Nothing published for this version

  22. 1.4.0 15 Aug 2022

    Nothing published for this version

  23. 1.3.5 18 Jun 2022

    Nothing published for this version

  24. 1.3.4 23 Nov 2021

    Nothing published for this version

  25. 1.3.3 19 Nov 2021

    Nothing published for this version

  26. 1.3.2 15 Nov 2021

    Nothing published for this version

  27. 1.3.1 08 Nov 2021

    Nothing published for this version

  28. 1.3.0 01 Nov 2021

    Nothing published for this version

  29. 1.2.0 19 Oct 2021

    Nothing published for this version

  30. 1.0.1 13 Nov 2020

    Nothing published for this version

  31. 1.0.0 26 Jun 2020

    Nothing published for this version

  32. 1.0.0-beta 19 Apr 2020 pre-release

    Nothing published for this version

  33. 0.6.4 28 Nov 2019

    Nothing published for this version

  34. 0.6.3 21 Nov 2019

    Nothing published for this version

  35. 0.6.2 28 Sep 2019

    Nothing published for this version

  36. 0.6.1 05 Sep 2019

    Nothing published for this version

  37. 0.6.0 03 Sep 2019

    Nothing published for this version

  38. 0.5.2 30 Jul 2019

    Nothing published for this version

  39. 0.5.1 16 May 2019

    Nothing published for this version

  40. 0.5.0 30 Aug 2017

    Nothing published for this version

  41. 0.4.1 09 Mar 2017

    Nothing published for this version

  42. 0.3.1 11 Jul 2016

    Nothing published for this version

  43. 0.4 27 Feb 2017

    Nothing published for this version

  44. 0.3 13 Apr 2016

    Nothing published for this version

  45. 0.2 10 Mar 2016

    Nothing published for this version

  46. 0.1 15 Feb 2016

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive