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

PSR2R Code Sniffer

The PSR2R standard contains 209 sniffs

Generic (24 sniffs)

  • Generic.Arrays.ArrayIndent
  • Generic.Arrays.DisallowLongArraySyntax
  • Generic.CodeAnalysis.ForLoopShouldBeWhileLoop
  • Generic.CodeAnalysis.ForLoopWithTestFunctionCall
  • Generic.CodeAnalysis.JumbledIncrementer
  • Generic.CodeAnalysis.UnconditionalIfStatement
  • Generic.CodeAnalysis.UnnecessaryFinalModifier
  • Generic.ControlStructures.InlineControlStructure
  • Generic.Files.ByteOrderMark
  • Generic.Files.LineEndings
  • Generic.Formatting.DisallowMultipleStatements
  • Generic.Formatting.SpaceAfterCast
  • Generic.NamingConventions.UpperCaseConstantName
  • Generic.PHP.DeprecatedFunctions
  • Generic.PHP.DisallowAlternativePHPTags
  • Generic.PHP.DisallowShortOpenTag
  • Generic.PHP.ForbiddenFunctions
  • Generic.PHP.LowerCaseConstant
  • Generic.PHP.LowerCaseKeyword
  • Generic.PHP.LowerCaseType
  • Generic.PHP.NoSilencedErrors
  • Generic.WhiteSpace.IncrementDecrementSpacing
  • Generic.WhiteSpace.LanguageConstructSpacing
  • Generic.WhiteSpace.ScopeIndent

Modernize (1 sniff)

  • Modernize.FunctionCalls.Dirname

NormalizedArrays (1 sniff)

  • NormalizedArrays.Arrays.ArrayBraceSpacing

PEAR (3 sniffs)

  • PEAR.ControlStructures.ControlSignature
  • PEAR.Functions.ValidDefaultValue
  • PEAR.NamingConventions.ValidClassName

PhpCollective (47 sniffs)

  • PhpCollective.Arrays.ArrayBracketSpacing
  • PhpCollective.Classes.ClassFileName
  • PhpCollective.Classes.EnumCaseCasing
  • PhpCollective.Classes.MethodArgumentDefaultValue
  • PhpCollective.Classes.MethodDeclaration
  • PhpCollective.Classes.MethodTypeHint
  • PhpCollective.Classes.PropertyDefaultValue
  • PhpCollective.Classes.Psr4
  • PhpCollective.Classes.ReturnTypeHint
  • PhpCollective.Classes.SelfAccessor
  • PhpCollective.Commenting.DocBlockConst
  • PhpCollective.Commenting.DocBlockConstructor
  • PhpCollective.Commenting.DocBlockNoInlineAlignment
  • PhpCollective.Commenting.DocBlockParamAllowDefaultValue
  • PhpCollective.Commenting.DocBlockParamTypeMismatch
  • PhpCollective.Commenting.DocBlockPipeSpacing
  • PhpCollective.Commenting.DocBlockReturnNull
  • PhpCollective.Commenting.DocBlockReturnNullableType
  • PhpCollective.Commenting.DocBlockReturnTag
  • PhpCollective.Commenting.DocBlockReturnVoid
  • PhpCollective.Commenting.DocBlockStructure
  • PhpCollective.Commenting.DocBlockTagIterable
  • PhpCollective.Commenting.DocBlockTagOrder
  • PhpCollective.Commenting.DocBlockTypeOrder
  • PhpCollective.Commenting.DocBlockVar
  • PhpCollective.Commenting.DocBlockVarNotJustNull
  • PhpCollective.Commenting.FullyQualifiedClassNameInDocBlock
  • PhpCollective.Commenting.InlineDocBlock
  • PhpCollective.Commenting.TypeHint
  • PhpCollective.ControlStructures.ConditionalExpressionOrder
  • PhpCollective.ControlStructures.ControlStructureEmptyStatement
  • PhpCollective.ControlStructures.NoInlineAssignment
  • PhpCollective.Formatting.ArrayDeclaration
  • PhpCollective.PHP.DisallowTrailingCommaInSingleLine
  • PhpCollective.PHP.NoIsNull
  • PhpCollective.PHP.NotEqual
  • PhpCollective.PHP.PhpSapiConstant
  • PhpCollective.PHP.PreferCastOverFunction
  • PhpCollective.PHP.RemoveFunctionAlias
  • PhpCollective.PHP.ShortCast
  • PhpCollective.PHP.SingleQuote
  • PhpCollective.Testing.AssertPrimitives
  • PhpCollective.Testing.Mock
  • PhpCollective.WhiteSpace.CommaSpacing
  • PhpCollective.WhiteSpace.ConcatenationSpacing
  • PhpCollective.WhiteSpace.ImplicitCastSpacing
  • PhpCollective.WhiteSpace.ObjectAttributeSpacing

PSR1 (3 sniffs)

  • PSR1.Classes.ClassDeclaration
  • PSR1.Files.SideEffects
  • PSR1.Methods.CamelCapsMethodName

PSR2 (6 sniffs)

  • PSR2.ControlStructures.ElseIfDeclaration
  • PSR2.ControlStructures.SwitchDeclaration
  • PSR2.Files.EndFileNewline
  • PSR2.Methods.FunctionCallSignature
  • PSR2.Namespaces.NamespaceDeclaration
  • PSR2.Namespaces.UseDeclaration

PSR2R (43 sniffs)

  • PSR2R.Classes.BraceOnSameLine
  • PSR2R.Classes.InterfaceName
  • PSR2R.Classes.PropertyDeclaration
  • PSR2R.Classes.TraitName
  • PSR2R.Commenting.DocBlock
  • PSR2R.Commenting.DocBlockEnding
  • PSR2R.Commenting.DocBlockNoEmpty
  • PSR2R.Commenting.DocBlockParam
  • PSR2R.Commenting.DocBlockParamArray
  • PSR2R.Commenting.DocBlockParamNoOp
  • PSR2R.Commenting.DocBlockParamNotJustNull
  • PSR2R.Commenting.DocBlockReturnSelf
  • PSR2R.Commenting.DocBlockShortType
  • PSR2R.Commenting.DocBlockTagTypes
  • PSR2R.Commenting.DocBlockVarWithoutName
  • PSR2R.Commenting.DocComment
  • PSR2R.Commenting.NoControlStructureEndComment
  • PSR2R.ControlStructures.ConditionalExpressionOrder
  • PSR2R.ControlStructures.ControlStructureSpacing
  • PSR2R.ControlStructures.ElseIfDeclaration
  • PSR2R.ControlStructures.NoInlineAssignment
  • PSR2R.ControlStructures.TernarySpacing
  • PSR2R.ControlStructures.UnneededElse
  • PSR2R.Files.ClosingTag
  • PSR2R.Files.EndFileNewline
  • PSR2R.Methods.MethodDeclaration
  • PSR2R.Methods.MethodMultilineArguments
  • PSR2R.Namespaces.NoInlineFullyQualifiedClassName
  • PSR2R.PHP.DuplicateSemicolon
  • PSR2R.PHP.ListComma
  • PSR2R.PHP.NoShortOpenTag
  • PSR2R.PHP.PreferStaticOverSelf
  • PSR2R.WhiteSpace.ArrayDeclarationSpacing
  • PSR2R.WhiteSpace.ArraySpacing
  • PSR2R.WhiteSpace.DocBlockAlignment
  • PSR2R.WhiteSpace.EmptyEnclosingLine
  • PSR2R.WhiteSpace.EmptyLines
  • PSR2R.WhiteSpace.LanguageConstructSpacing
  • PSR2R.WhiteSpace.MethodSpacing
  • PSR2R.WhiteSpace.NamespaceSpacing
  • PSR2R.WhiteSpace.TabAndSpace
  • PSR2R.WhiteSpace.TabIndent
  • PSR2R.WhiteSpace.UnaryOperatorSpacing

PSR12 (7 sniffs)

  • PSR12.Classes.ClassInstantiation
  • PSR12.Files.ImportStatement
  • PSR12.Functions.NullableTypeDeclaration
  • PSR12.Functions.ReturnTypeDeclaration
  • PSR12.Keywords.ShortFormTypeKeywords
  • PSR12.Namespaces.CompoundNamespaceDepth
  • PSR12.Operators.OperatorSpacing

SlevomatCodingStandard (45 sniffs)

  • SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation
  • SlevomatCodingStandard.Arrays.MultiLineArrayEndBracketPlacement
  • SlevomatCodingStandard.Arrays.SingleLineArrayWhitespace
  • SlevomatCodingStandard.Arrays.TrailingArrayComma
  • SlevomatCodingStandard.Classes.ClassConstantVisibility
  • SlevomatCodingStandard.Classes.ConstantSpacing
  • SlevomatCodingStandard.Classes.ModernClassNameReference
  • SlevomatCodingStandard.Classes.PropertySpacing
  • SlevomatCodingStandard.Commenting.DeprecatedAnnotationDeclaration
  • SlevomatCodingStandard.Commenting.DisallowOneLinePropertyDocComment
  • SlevomatCodingStandard.Commenting.EmptyComment
  • SlevomatCodingStandard.ControlStructures.AssignmentInCondition
  • SlevomatCodingStandard.ControlStructures.DisallowContinueWithoutIntegerOperandInSwitch
  • SlevomatCodingStandard.ControlStructures.DisallowYodaComparison
  • SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing
  • SlevomatCodingStandard.ControlStructures.NewWithParentheses
  • SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator
  • SlevomatCodingStandard.ControlStructures.RequireShortTernaryOperator
  • SlevomatCodingStandard.Exceptions.DeadCatch
  • SlevomatCodingStandard.Functions.ArrowFunctionDeclaration
  • SlevomatCodingStandard.Functions.DisallowTrailingCommaInCall
  • SlevomatCodingStandard.Functions.DisallowTrailingCommaInClosureUse
  • SlevomatCodingStandard.Functions.DisallowTrailingCommaInDeclaration
  • SlevomatCodingStandard.Functions.RequireTrailingCommaInCall
  • SlevomatCodingStandard.Functions.RequireTrailingCommaInClosureUse
  • SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration
  • SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses
  • SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly
  • SlevomatCodingStandard.Namespaces.RequireOneNamespaceInFile
  • SlevomatCodingStandard.Namespaces.UnusedUses
  • SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash
  • SlevomatCodingStandard.Namespaces.UseFromSameNamespace
  • SlevomatCodingStandard.Namespaces.UselessAlias
  • SlevomatCodingStandard.Namespaces.UseSpacing
  • SlevomatCodingStandard.Operators.SpreadOperatorSpacing
  • SlevomatCodingStandard.PHP.ShortList
  • SlevomatCodingStandard.PHP.TypeCast
  • SlevomatCodingStandard.PHP.UselessSemicolon
  • SlevomatCodingStandard.TypeHints.DNFTypeHintFormat
  • SlevomatCodingStandard.TypeHints.LongTypeHints
  • SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue
  • SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing
  • SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing
  • SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable
  • SlevomatCodingStandard.Whitespaces.DuplicateSpaces

Squiz (23 sniffs)

  • Squiz.Arrays.ArrayBracketSpacing
  • Squiz.Classes.LowercaseClassKeywords
  • Squiz.Classes.ValidClassName
  • Squiz.ControlStructures.ControlSignature
  • Squiz.ControlStructures.ForEachLoopDeclaration
  • Squiz.ControlStructures.ForLoopDeclaration
  • Squiz.ControlStructures.LowercaseDeclaration
  • Squiz.Functions.FunctionDeclaration
  • Squiz.Functions.FunctionDeclarationArgumentSpacing
  • Squiz.Functions.LowercaseFunctionKeywords
  • Squiz.Operators.ValidLogicalOperators
  • Squiz.PHP.Eval
  • Squiz.PHP.NonExecutableCode
  • Squiz.Scope.MemberVarScope
  • Squiz.Scope.MethodScope
  • Squiz.Scope.StaticThisUsage
  • Squiz.WhiteSpace.CastSpacing
  • Squiz.WhiteSpace.LogicalOperatorSpacing
  • Squiz.WhiteSpace.MemberVarSpacing
  • Squiz.WhiteSpace.ScopeClosingBrace
  • Squiz.WhiteSpace.ScopeKeywordSpacing
  • Squiz.WhiteSpace.SemicolonSpacing
  • Squiz.WhiteSpace.SuperfluousWhitespace

Universal (5 sniffs)

  • Universal.Constants.LowercaseClassResolutionKeyword
  • Universal.Constants.UppercaseMagicConstants
  • Universal.Operators.ConcatPosition
  • Universal.UseStatements.NoUselessAliases
  • Universal.WhiteSpace.PrecisionAlignment

Zend (1 sniff)

  • Zend.Files.ClosingTag
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