PHP Code beautifier for docker
###How to use this with Sublime Text 3
on Ubuntu
?
To use this you need docker installed.
-
Install this sublime text plugin https://packagecontrol.io/packages/Phpcs
-
clone this repo
git clone https://github.com/kalehrishi/docker-phpcs.git
cd docker-phpcs
sudo cp phpcs.sh /usr/local/bin/phpcs
sudo cp phpcbf.sh /usr/local/bin/phpcbf
- Open
Preferences > Package Settings > PHP Code Sniffer > Settings - User
- Copy these settings
{
"phpcs_executable_path": "/usr/local/bin/phpcs",
"phpcbf_executable_path": "/usr/local/bin/phpcbf",
"phpcbf_additional_args": {
"--standard": "PSR2",
"-n": "",
"--no-patch":""
}
}
- on every save it will show errors in code
- to fix errors automatically
Ctrl + Shift + P
and select optionPHP Coding Standard Fixed: Fix this file ( PHP Code Beautifier )