Atom editor 在为windows用户修复了问题6之后,php cs修复程序在linux用户中出现故障

Atom editor 在为windows用户修复了问题6之后,php cs修复程序在linux用户中出现故障,atom-editor,Atom Editor,我使用Linux Ubuntu 16.04。我已经为atom 1.9.8安装了php cs修复程序 $ php-cs-fixer PHP CS Fixer version 1.11.6 by Fabien Potencier Usage: command [options] [arguments] Options: -h, --help Display this help message -q, --quiet Do not output

我使用Linux Ubuntu 16.04。我已经为atom 1.9.8安装了php cs修复程序

$ php-cs-fixer
PHP CS Fixer version 1.11.6 by Fabien Potencier

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  fix          Fixes a directory or a file
  help         Displays help for a command
  list         Lists commands
  readme       Generates the README content, based on the fix command help
  self-update  Update php-cs-fixer.phar to the latest version.
  selfupdate   Update php-cs-fixer.phar to the latest version.
这个问题来自于配置带有atom的php cs修复程序。事实上,一揽子计划要求:

  • PHP可执行路径(由defaut
    PHP
    )(对于linux用户,该路径必须为空,这在实际版本的软件包中是不可能的)(请参阅isse)
  • PHP-CS fixer可执行路径(仅适用于linux用户
    PHP CS fixer
    (不使用PHAR文件))
因此,当我从atom运行php cs fixer时,我得到了以下错误:无法打开输入文件:php cs fixer

我可以使用以下控制台命令生成此错误消息:

php php-cs-fixer fix Class.php 
    Could not open input file: php-cs-fixer
那么,您能为atom的包设置
PHP可执行路径
可选(非强制)吗

谢谢


有关这一问题的最新情况: 我设法从下载了
php cs fixer.phar
,并将其放入文件夹
~/.composer/
,以便:

  • PHP可执行路径是
    PHP
  • PHP-CS修复程序可执行路径为:
    ~/.composer/PHP-CS-composer.phar
但现在我遇到了这个错误:无法打开输入文件:~/.composer/php cs fixer.phar

那怎么了


供您参考,运行console
php~/.composer/php-cs-composer.phar Class.php
命令是成功的。

在github上可以找到解决方案:

  • PHP可执行路径是
    PHP
  • PHP-CS修复程序的可执行路径是:
    /home/username/.composer/PHP-CS-composer.phar
    ,不要在atom中使用
    ~

解决方案可在github上找到:

  • PHP可执行路径是
    PHP
  • PHP-CS修复程序的可执行路径是:
    /home/username/.composer/PHP-CS-composer.phar
    ,不要在atom中使用
    ~