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

May be closed by ~#3686~ #3728 **Describe the bug** In PHP 8.2, "readonly class" feature was introduced. Using readonly classes, we can shorten readonly property declarations as follows: ```php class...

Includes unit test. Ref: * https://wiki.php.net/rfc/readonly_classes Fixes #3727

Hey there, 3.7.2 has a nice little bug fix/support for negative number in match statements: (#3653) Any chance we could get a tag published?

Hi, I'd like to know how can I install this on WordPress as a plugin? Looking forward to your support.

... in the backfill for the PHP 8.1 explicit octal notation. Includes unit tests.

**Describe the bug** The rule `PEAR.WhiteSpace.ObjectOperatorIndent` always shows an error for indentation space for object operator when on a array that has a embedded array before it. If i move...

The `Squiz.Commenting.FunctionComment.InvalidNoReturn` causes false positives when it encounters the `never` return type. Tested this locally with: ```xml ``` ```php /** * @return never */ private function foo() { throw new...

**Describe the bug** I want to report variable or members not in camelCase, but with some exceptions. So I would like to report only on variable/member declaration, not on usage...

Status: awaiting feedback

I was considering writing my own sniffer to check file names match namespace names case sensitively for the PSR-4 namespace standard - does anything like this already exist? Can it...

**Describe the bug** `Generic.Arrays.DisallowShortArraySyntax.Found` creates a fatal when it's an array assignment, where it should replace with list, not array **Code sample** ```php [, $foo] = explode( '=', 'hello=world=bar', 2...

Type: bug
Standard: Generic
Focus: Modern PHP