1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

VSCode の php-cs-fixer で使っている設定

Last updated at Posted at 2020-11-12

このページについて

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"
  },
1
2
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?