PHP PSR Auto Formatting Tool

PHP PSR Auto Formatting Tool

Sharing is caring!

PSR format is one of the code formatting standard of PHP. Its very tough to format each and every line in big projects. To Resolve this PSR auto formatting tool is available as opensource kit called – PHP-CS-Fixer. You can simply use it from command line and change your code formatting within seconds.

1. Install the PHP-CS-Fixer via Composer

Installig PHP-CS-Fixer via composer is very easy task to go. You can run composer with this command. It will download and install the PHP-CS-Fixer within minutes.

Set Path

Setting path is important to run PHP-CS-Fixer.

Test Drive

After Installed and set path its time to run PHP-CS-Fixer. But before do it on real time make sure it will run and properly works. Use this command to check the tool without changing anything.

Real Run

Now this is time to run PHP-CS-Fixer for realtime purpose. You can use a single file or a folder in a single command to get format done within seconds.

Sharing is caring!

Comments are closed.