Skip to content
| Marketplace
Sign in
Visual Studio Code>Linters>PHP Sniffer ToolNew to Visual Studio Code? Get it now.
PHP Sniffer Tool

PHP Sniffer Tool

haruncox

|
20 installs
| (0) | Free
Uses PHP_CodeSniffer to format and lint PHP code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

PHP Sniffer Tool

Uses PHP_CodeSniffer to format and lint PHP code.

Check Extension: PHP Sniffer Tool

Features

  • Lint PHP code using PHP_CodeSniffer.

  • Format PHP code using PHP_CodeSniffer.

  • Entire PHP file formatting.

  • Selected PHP code formatting.

  • Override rules if inner directory has xml ruleset file. For example: WordPress project has multiple plugins and themes, each plugin and theme has its own ruleset file.

    workspace-folder/
      plugins/
        plugin-1/
          .phpcs.xml
        plugin-2/
          .phpcs.xml
      themes/
        theme-1/
          .phpcs.xml
        theme-2/
          .phpcs.xml
    
  • Set as default formatter for PHP files.

    {
      "[php]": {
        "editor.defaultFormatter": "haruncox.php-sniffer-tool"
      }
    }
    

Requirements

  • PHP
  • PHP_Codesniffer

Extension Settings

Quick Setup

settings.json:

{
  "phpSniffer.autoDetect": true
}

And if your projects look like this:

workspace-folder/
  vendor/
    bin/
      phpcs
      phpcbf
  .phpcs.xml
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft