Yifans_Z's Blog.

在 PhpStorm 中使用 PHP-CS-Fixer

字数统计: 115阅读时长: 1 min
2018/04/16 Share

The PHP Coding Standards Fixer (PHP CS Fixer) tool fixes your code to follow standards.

工作环境:MacBook。

打开 PhpStorm Preferences > Tools > External Tools 添加:

Preferences > Tools > External Tools

  • Program: /usr/local/bin/php-cs-fixer
  • Parameters: --rules=@Symfony --verbose fix "$FileDir$/$FileName$"(Note that previous verions of PHP-CS-Fixer used –levels instead of –rules. 未找到)
  • Working directory: $ProjectFileDir$
  • 我取消勾选了 Open console,可以不输出日志信息

设置快捷键 Preferences > Keymap

Preferences > Keymap

相关阅读:

References: