What tools or editors can help with automatically formatting PHP code for better readability?

When working with PHP code, it's important to maintain consistent formatting for better readability. Tools like PHP_CodeSniffer, PHP-CS-Fixer, and IDEs like PhpStorm have built-in features to automatically format PHP code according to coding standards. These tools can help ensure that your code is consistently formatted, making it easier to read and maintain.

// Example of using PHP-CS-Fixer to automatically format PHP code
// Install PHP-CS-Fixer using Composer: composer require friendsofphp/php-cs-fixer
// Run PHP-CS-Fixer on your PHP files: php vendor/bin/php-cs-fixer fix /path/to/your/php/files