Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Psr2R Sniffer Laravel Package

fig-r/psr2r-sniffer

PHP_CodeSniffer ruleset implementing PSR-2-R for PHP 8.1+ projects. Includes 190+ sniffs, supports CI, and can auto-fix many issues via phpcbf. Install with Composer and reference the bundled PSR2R ruleset in phpcs.xml.

View on GitHub
Deep Wiki
Context7
2.7.1

Fixes

  • Allow [@link](https://github.com/link) and [@see](https://github.com/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: https://github.com/php-fig-rectified/psr2r-sniffer/compare/2.7.0...2.7.1

2.7.0

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: https://github.com/php-fig-rectified/psr2r-sniffer/compare/2.6.1...2.7.0

2.6.1

Fixes

  • Fixed up TabAndSpaceSniff issues

Full Changelog: https://github.com/php-fig-rectified/psr2r-sniffer/compare/2.6.0...2.6.1

2.6.0

Improvements

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

Full Changelog: https://github.com/php-fig-rectified/psr2r-sniffer/compare/2.5.0...2.6.0

2.5.0

Improvements

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

Full Changelog: https://github.com/php-fig-rectified/psr2r-sniffer/compare/2.4.3...2.5.0

2.4.3

Fixes

  • Fixed up UnneededElse sniff
2.4.2

Fixes

  • Added missing if/else sniffs.
2.4.1

Fixes

  • Fixed bug in UnneededElse.
2.4.0

Improvements

  • Update sniffs to PHPCS v4
2.3.0

Improvements

This improvement ships with 14 new sniffs, many of them making array notation more consistent and reliable.

2.2.1

Improvements

  • Removed deprecations
2.2.0

Improvements

  • Removed deprecations
2.1.2

Fixes

  • Fix broken unused uses sniff.
  • Fix ternary spacing sniff.
2.1.1

Fixes

  • Skip FQCN to use statement refactor requirement for attributes
2.1.0

Improvements

  • Added new PSR4 sniff

Full Changelog: https://github.com/php-fig-rectified/psr2r-sniffer/compare/2.0.0...2.1.0

2.0.0

PHP 8.1+ release

Includes quite a few improvements including type safety. Currently, PSR2R ships with over 190 sniffs.

1.5.1

Fixes

Reverted "silence removal of SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName" for now as there is no way to ignore Attributes for now.

1.5.0

Improvements

  • Remove silencing of SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly
  • Fix up DisallowTrailingComma sniffs
1.4.0

Improvements

Allow for new slevomat/coding-standard 8.x. This is to allow for all new fixes of that series to be used by everyone.

Please note You need to add the php_version config in your root phpcs.xml file before upgrading.

E.g. if you are using >= 7.4 in composer as PHP min requirement:

<config name="php_version" value="70400"/>

The reason is that it would otherwise execute your local PHP version (e.g. 8.1) and modify the code according to "too new language features".

1.3.5

Fixes

  • Fixed DocBlockReturnSelfSniff handling of self

Improvements

  • Added enum support
  • Updated whitelisted tags to be consistent with PHPUnit 9
1.3.4

Fixes

Re-added fixed TabIndent sniff.

1.3.3

Fixes

Replace faulty sniff with working one.

1.3.2

Fixes

  • Resolved problem of tab indentation breaking for certain sniffs
  • Removed superfluous sniff
1.3.1

Fixes

Removed invalid sniff, added some more useful ones.

1.3.0

Improvements

Generics syntax instead of legacy array syntax

The old string[] syntax is deprecated and replaced by generics, as it can now also focus on key instead of just value:

  • array<string> (list) vs array<string, string> (assoc array)
  • It is recommended not to upgrade object collections outside of \ArrayObject and \ArrayAccess etc, as IDEs do not yet understand those. Here we can keep \MyCollection|\MyObject[] as legacy typehint in place. Custom [@phpstan-](https://github.com/phpstan-)* tags on top can be "clean" already.

PHP 7.3+

With PHP 7.3 being already EOL soon, it only makes sense to drop the already very long EOL 7.2 version. It is already PHP 8.1 tested, however, as well.

More quality sniffs

Quite a few more sniffs to make sure the code is also semantically checked even before any static analyzer like PHPStan/Psalm look at it.

1.2.0

Improvements

Upgrade to new slevomat/coding-standard v7

Previous releases were a bit wonky (1.1.0 was released on a wrong branch it seems), please use this one moving forward.

1.0.1

Fixes

  • Allowed phpstan-* and psalm-* tags to work.
  • Fixed conflict on class opening lines
1.0.0

Release of PHP 7.2+ version (LTS)

Note: This version recommends changing code as per PHP 7.2+. If your code needs to run also on lower versions, please use the previous version and the corresponding ^0.6 constraint here.

This sniffer is now a combination of

creating a best practice bundle of ~180 sniffs.

1.0.0-beta

Beta Release of PHP 7.2+ version (LTS)

This sniffer is now a combination of

creating a best practice bundle of ~180 sniffs.

0.6.4

Improvements

  • Added NamespaceSpacingSniff to assert a newline before namespace statements as per PSR-12.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport