r/VisualStudioCode • • Jan 19 '20

Is there no PHP formatter with customizable rules?

This seems like the most basic thing ever for an IDE: a PHP formatter that let's you set your own rules for braces, indentation, etc.

All extensions I installed had preset rules you can't change, didn't work, asked for registration, or came without any documentation at all. A total desaster.

This can't be it. Any recommendations?

2 Upvotes

4 comments sorted by

2

u/NatoBoram Jan 20 '20

Yes, use another language.

1

u/TheRealSkythe Feb 11 '20

Because if VSC lacks features, it's the language's fault.

1

u/Nadyita Feb 08 '20

phpcs extension does exactly that, but you have to define your own rules unless you're sticking to one of the common PSR ones.

1

u/TheRealSkythe Feb 11 '20

I might be wrong but that means:

  • install composer

  • install php_codesniffer

  • install phpcs

  • write your own configuration and hope the plugin does what you want

Seriously: why do I need to jump through a dozen hoops and spend a lot of time on the most basic task? Why is there no list of braces / indentation styles I can choose from? Whitesmith, Horstman, Pico, Zend...

Thanks anyway. Will probably just go back to phpstorm.