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

sos99's avatar

super fast install psr 2 on Sumblime text without any composer or bash command

How codding with PSR-2

  1. install phpfmt with Pakage manager

  2. add this to phpfmt user settings:

{
    "enable_auto_align": false,
    "format_on_save": false,
    "indent_with_space": 4,
    "passes":
    [
    ],
    "excludes": [ "OrderUseClauses" ],
    "psr1": true,
    "psr1_naming": true,
    "psr2": true,
    "space_around_exclamation_mark": true,
    "version": 3,
    "visibility_order": true
}



to use it just press F11

0 likes
2 replies
mstnorris's avatar

@sos99 thank you for this. It works great! So simple and most importantly for me, it is automatic! Great little tool.

Shaun's avatar

I had to disable the auto format on save because it was changing the entire structure of some of Laravel 5.1's built-in files (configs, etc).

Also noticed that it ignores the setting to put spaces around exclamation marks (e.g. if ( ! $isValid)), etc.

Anyone know a way around this?

1 like

Please or to participate in this conversation.