PHP Code Beautifier and Fixer for Visual Studio Code
This extension provides the PHP Code Beautifier and Fixer (
phpcbf must be installed. phpcbf is installed when you install phpcs.
A quick install is using composer. After installing composer, in your workspace root, run the following command:
This extension has the following settings:
The default settings are
In a multi-root project, settings can be saved in
When set to
By default, the following standards are available:
If you add a standard to phpcs, it will be available for phpcbf. Some popular standards are: Drupal, WordPress, Yii2, Magento and Symfony.
You can also point to a phpcs.xml rules file, eg:
None, but this is my first vscode extension, you're warned :)
Please see the changelog.
I learned a lot reading the code of, and borrowing code from PHP CS Fixer for Visual Studio Code.
Copyright and License
PHP Code Beautifier and Fixer for Visual Studio Code is copyright 2018 Per Soderlind
PHP Code Beautifier and Fixer for Visual Studio Code is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
PHP Code Beautifier and Fixer for Visual Studio Code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the Extension. If not, see http://www.gnu.org/licenses/.