Visual Studio Code Extension designed to help PHP developers keep their code clean, readable, and consistent
Features
Format associative arrays by aligning the characters => on the same level
Format opening and closing braces
Format comments
Format function parameters
Format control structures
Removes empty lines inside the blocks at the beginning and at the end
Removes multiple consecutive empty lines
Removes unnecessary spaces in opening and closing parentheses
Before
After
Usage
Document
Open a PHP file
Right click and select "PHP Clean Code Document" or use the command palette (Ctrl+Shift+P) and search for "PHP Clean Code Document"
Selection
Open a PHP file
Select the text you want to format and right click and select "PHP Clean Code Selection" or use the command palette (Ctrl+Shift+P) and search for "PHP Clean Code Selection"
Settings
This extension contributes the following settings:
php-clean-code.formatAssociativeArrayAlignment: Format associative arrays by aligning the characters => on the same level
php-clean-code.formatBraces: Format opening and closing braces
php-clean-code.formatComments: Format comments
php-clean-code.formatFunctionParams: Format function parameters
php-clean-code.formatKeywords: Format control structures
php-clean-code.removeBlockInitEndEmptyLines: Removes empty lines inside the blocks at the beginning and at the end