php-beautifier.el is a lightweight extension that integrates PHP source code beautification into Emacs using the PHP_Beautifier tool. It also supports running code through phpcbf to fix coding standard issues.
php-beautifier-executable-path - The full path to the PHP_Beautifier executable. This is php_beautifier by default.
php-beautifier-indent-method - The indentation method to use. Either spaces or tabs. Default is spaces.
php-beautifier-phpcbf-path - The full path to the phpcbf executable. This is phpcbf by default.
php-beautifier-phpcbf-standard - The coding standard to use with phpcbf. This is nil by default and must be set for phpcbf to be run.
When using phpcbf the code is still run through php_beautifier first. In some circumstances this may create some odd results but it usually works.
php-beautifier can either format an entire buffer or a single region. The php_beautifier tool will only format code contained in a <?php block, so formatting a region that doesn’t contain one will not work.
php-beautifier-format-region - Format the current region and replace it with formatted code.
php-beautifier-format-buffer - Format the current buffer and replace its contents with formatted code.
To run unit tests you’ll need Cask installed.
Released under the GPLv3. See COPYING for the full licence.