このページについて
PHP を VSCode を使用して開発する事がことが多く、
現場が変わる度に設定を調べ直すのが面倒だったので、ここにメモがわりに書くことにする。
settings.json
"php-cs-fixer.onsave": true,
"php-cs-fixer.executablePath": "${extensionPath}/php-cs-fixer.phar",
"php-cs-fixer.lastDownload": 999999999999999,
"php-cs-fixer.rules": {
"@PSR2": true, // PSR-2 Coding Style Guide に即した形式にフォーマットする
"no_unused_imports": true, // 使用していない use 句を削除する
// "ordered_imports": true, // use 句をアルファベット順にソートする
"array_syntax": { "syntax": "short" }, // 配列の定義方法を短縮形(例: $hoge = [];)にする
"single_quote": true
},
"[php]": {
"editor.defaultFormatter": "junstyle.php-cs-fixer"
},