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 235 PHP_CodeSniffer issues
Sort by recently updated
recently updated
newest added

Added some missing documentation ## Description This is just some house-keeping to keep the docs up to date. I had to spend some time reviewing the php code to figure...

A sniff similar to `Squiz.Classes.SelfMemberReference.NotUsed` for the new statement would be useful. `Squiz.Classes.SelfMemberReference` is only looking for `T_DOUBLE_COLON` and that does not include "new ClassName"

Type: enhancement
Status: good first issue
Standard: Squiz

## Context At places like https://github.com/squizlabs/PHP_CodeSniffer/blob/7566b4d89de1d08d2a8ad85910507d6633a35d28/src/Reports/Code.php#L169 we report the full file location. `basepath` is a config property that can be used to remove it, but doesn't fully work for this....

Status: awaiting feedback
Type: question

## Describe the bug `phpcs:enable` can sometimes wind up overriding a later `phpcs:ignore` for the rule. This can particularly happen when multiple `phpcs:enable` comments are present in the file. ###...

Type: bug
Core Component: File
Focus: Ignore Annotations/Excludes

## Describe the bug If a closure/anonymous function is used as a callback in a function call, then indentations doesn't get fixed with `Generic.WhiteSpace.ScopeIndent` sniff property `exact` set to `true`....

Type: bug
Status: triage

## Describe the bug `Generic.Formatting.MultipleStatementAlignment` doesn't work correctly with `match()`. ### Code sample ```php ./packages ``` ### To reproduce Steps to reproduce the behavior: 1. Create a file called `test.php`...

Type: bug
Standard: Generic

**Describe the bug** Generic.WhiteSpace.ScopeIndent reports multiline `yield from` statements as being incorrectly indented even if the indentation is correct. I've only tested this with tab indentation. **Code sample** ```php ```...

Type: bug
Standard: Generic

## Describe the bug The ScopeIndent sniff suggests a quite strange indentation when processing multi-nested `match`-statements ### Code sample ```php

Type: bug
Standard: Generic
Focus: Modern PHP

Inject the configuration object in the constructor instead of creating the instance without having the ability to change it. Currently it's not possible to change the configuration because it's using...

Status: close candidate