PHP_CodeSniffer icon indicating copy to clipboard operation
PHP_CodeSniffer copied to clipboard

PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.

Results 100 PHP_CodeSniffer issues
Sort by recently updated
recently updated
newest added

The coding standard of this code base was historically/organically grown and is likely influenced by some internal rules which were being used in Squiz projects at one time or another....

Type: chores/QA
Status: waiting for opinions

## Description This is a re-creation of https://github.com/squizlabs/PHP_CodeSniffer/pull/3631 > `Generic.WhiteSpace.ScopeIndent` and `PSR2.Methods.FunctionCallSignature` both try to fix indentation differently. This results in files not being able to be fixed automatically with...

Type: bug
Focus: Fixer Conflicts
Standard: Generic
Standard: PSR2
Status: triage

# Description This PR adds documentation for the `Squiz.WhiteSpace.FunctionSpacing` Sniff. ## Suggested changelog entry Add documentation for the Squiz Function Spacing Sniff ## Related issues/external references Part of https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/148 ##...

Status: awaiting feedback
Type: documentation
Standard: Squiz

## Describe the bug The Generic.ControlStructures.DisallowYodaConditions sniff has a method called `isArrayStatic()` that determines what the sniff considers to be static arrays. When static arrays are found on the side...

Type: bug
Standard: Generic

Repost from https://github.com/squizlabs/PHP_CodeSniffer/issues/2962: > The `Generic.ControlStructures.DisallowYodaConditions` reports a `Usage of Yoda conditions is not allowed; switch the expression order` error for the below code, which IMO is incorrect (the error,...

Type: bug
Standard: Generic

## Description Recreation of upstream PR https://github.com/squizlabs/PHP_CodeSniffer/pull/1542: > I've explicitly not added metrics for: > * lowercase keyword as those are already recorded by the `Generic.PHP.LowerCaseKeyword` sniff > * `break`/`return`...

Type: enhancement
Standard: PSR2

## Description The `AbstractVariableSniff` by default listens to all `T_VARIABLE`, `T_DOUBLE_QUOTED_STRING` and `T_HEREDOC` tokens. The majority of the sniffs extending the `AbstractVariableSniff`, however, only handle `T_VARIABLE` tokens and in particular,...

Focus: Comments/Docblocks
Focus: Performance
Standard: PEAR
Standard: PSR2
Standard: Squiz

## Description This PR adds the XML documentation for the Generic.Commenting.DocComment sniff. This sniff contains several errors, so I opted to add a `` block at the top summarizing all...

Type: documentation
Standard: Generic

The original PHP_CodeSniffer project contained a code consistency analysis website: https://squizlabs.github.io/PHP_CodeSniffer/analysis/ That website hadn't been updated since 2018. For now, I've removed the site from the `gh-pages` branch of this...

Type: documentation
Status: needs investigation
Status: help wanted
Status: waiting for opinions

## Describe the bug Seems PEAR.Functions.FunctionCallSignature.Indent sniff and fix works incorrectly with some nested structures. The problem appears when there is indentation issue together with another issue, like PEAR.WhiteSpace.ScopeIndent.Incorrect. After...

Type: bug
Standard: PEAR