

To automate the code formatting process, we're going to set up a build process in a sublime text, so whenever you need to format your code instead of running the long command, you could just press the button on a keyword to fix it. Specifically, I’m imagining case-conversion. What I’m curious about, however, is a feature to auto-replace/format text as I type it. Please refer to the official doc to discover all the available rules and commands you could use for your formatting. Auto-replace/auto-format as you type General Discussion Bond January 13, 2016, 8:42am 1 I’ve been using snippets and completions and they’re a great feature and certainly have their uses. Below, I have an example for you if you want to try to format your files manually. It is always a tedious job when you go and fix the formatting on each file you have in your project. composer global require friendsofphp/php-cs-fixerĪfter the installation process is completed open your terminal and simply run php-cs-fixer command just to confirm it's installed properly. Installing php-cs-fixer via composer to run globally on your machine. The team at symfony and the contributors have done really great job building a package that can be used with sublime text to format coding standard. I personally use sublime as my primary code editor all the time, the main reason is its lightness and popularity among the developers around the world, another beneficial part is the huge availability of open-source packages for it.īelow, I'm going to cover how we format our PHP code to PSR-2 coding standard in sublime text.
