Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

RoboRobok's avatar

How to configure PHP Code Sniffer for Sublime Text 3?

Hi guys, I'm using Sublime Text 3. I also use SublimeLinter-phpcs package, but I never know how to configure it. The docs are so confusing.

How to set it in Sublime to use PSR-2, but disable some of the rules, like requiring the file doc and a few others?

0 likes
1 reply
adibhanna's avatar

I'm using php-cs-fixer

you can create a file in /Users/{your-username}/.phpcsfixer and put something like this:

(my config)

<?php
return PhpCsFixer\Config::create()
->setRules([
    '@PSR2' => true,
    'array_syntax' => ['syntax' => 'short'],
    'no_unused_imports' => true,
    'ordered_imports' => ['sortAlgorithm' => 'length']
]);

then in sublime in your package user config, you can put something like this:

{
    "on_save": true,
    "config": "/Users/{your-username}/.phpcsfixer",
}

Please or to participate in this conversation.