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

## Describe the bug While working on #482, I found two issues in the Generic.ControlStructures.InlineControlStructure sniff when fixing some do-while statements that contain syntax errors. ### Code sample Code sample...

Type: bug
Status: triage

# Description This PR makes a few changes to the Generic.ControlStructures.InlineControlStructure sniff: - Fixes a bug when handling `else if` statements (daa1940b80f6de71d3233f17c59e7d47bfb25960) and another one when handling `elseif/if/foreach` without a...

Type: bug
Standard: Generic
Status: triage

## Describe the bug When checking a specific file (see minimal code sample), phpcs throws an `undefined array key` error. ### Code sample ```php

Type: bug
Standard: Generic

## Describe the bug While working on another task, it was noticed that the auto-fixer for `PSR2.Namespaces.UseDeclaration` is incorrect for some parse errors. ### Code sample ```php

Type: bug
Standard: PSR2
Status: triage

As per the note left on PR #424 : > at a glance, this sniff could probably do with a more thorough review and more defensive token walking/more precise checking...

Standard: PSR2
Status: needs investigation
Status: help wanted

## Describe the bug This sniff incorrectly reports an error while using in my case `\Psl\Str\join` function and reports forbidden use of the native PHP function ### Code sample src/a.php...

Type: bug
Standard: Generic
Status: triage

The following issues were found during the review of PR #385. ## Describe the bug While the sniff works well for the most common case of a variable being incremented/decremented...

Type: bug
Standard: Generic

Inspired by PR #385 (thought which came up while reviewing the changes made in #385). ## Is your feature request related to a problem? Given the following code sample (taken...

Type: enhancement
Standard: Generic

## Describe the bug `PSR2.Classes.PropertyDeclaration.ReadonlyBeforeVisibility` doesn't apply when constructor property promotion is used ### Code sample ```php

Type: enhancement
Standard: PSR2

## Describe the bug Calculation of the align seems incorrect inside `match`. ### Code sample ```php ``` ### To reproduce Steps to reproduce the behavior: 1. Create a file called...

Type: bug
Standard: Squiz
Status: triage