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

Hi, I use MacOS Monterey 12.3 and I want using PHP CodeSniffer on my Laravel project on version 9.5.1. The PHPCS version is 3.6.2 (stable). When I type this command...

**Describe the bug** In PHPStorm by [JetBrains](https://jetbrains.com) code highlights red, because he scanning vendor directory and find global functions in ForbiddenFunctionsUnitTest.inc. Exclude directory not helping. Example: **Code sample** ``` function...

**Describe the bug** Property promotions handling like variables, but they are class property **Code sample** ```php ``` **To reproduce** Steps to reproduce the behavior: 1. Create a file called `test.php`...

Version 4 is a good time to review the exit codes that both scripts produce to ensure that success cases all use `0` and that all failure cases have codes...

**Describe the bug** I've done some - not entirely scientific - benchmark checks and am finding that enabling the caching option when on Windows (not sure about other OSes), makes...

**Describe the bug** Since PHP 8.1 unpacking of associative arrays is supported. Unpacking an associative array into another results in one of the errors `Squiz.Arrays.ArrayDeclaration.NoKeySpecified` or `Squiz.Arrays.ArrayDeclaration.KeySpecified` (depending on the...

**Describe the bug** In our project we sometimes prepare pipelines to be used for future files. However, as those files might not yet exist, phpcs could stop with `No files...

Add new sniff for checking Control structure brackets are on a new line Add new test for the new sniff checking Control structure brackets are on a new line

While testing #2992, I really missed an option to clear the cache, but allow for it to be set. The `--no-cache` option only tells PHPCS to not _use_ the cache...

Enhancement

Hello, I'm looking for a way to store formatted code as a string in a variable within PHP scripts, not from a console program. Is it possible with this library?...