【问题标题】:Netbeans PHP CS Fixer issueNetbeans PHP CS修复程序问题
【发布时间】:2017-06-01 13:25:47
【问题描述】:

我正在尝试在 Netbeans 8.2 上安装有用的插件 PHP CS Fixer。 我习惯了在 Netbeans 8 上使用它,它运行良好,我希望我不能仅仅为此而回到那个版本。 请注意,CodeSniffer 已成功设置。

当我尝试安装插件 0.53 时,它说我需要额外的插件,但我真的不知道它们是什么。

跟随错误

The plugin org.netbeans.modules.projectuiapi.base is requested in version 1.83.1.9.  The following plugin is affected:       PHP CS Fixer 
Some plugins require plugin org.openide.filesystems.nb to be installed.
The plugin org.openide.filesystems.nb is requested in version 9.6.1.  The following plugin is affected:       PHP CS Fixer 
Some plugins require plugin org.openide.util.ui to be installed.
The plugin org.openide.util.ui is requested in version 9.3.1.  The following plugin is affected:       PHP CS Fixer  Some plugins not installed to avoid potential installation problems.

有什么建议吗? 谢谢

【问题讨论】:

  • 据我所知,该插件现在直接包含在 Netbeans 中。检查工具 > 选项 > PHP > 代码分析 > 编码标准修复程序。但是我不知道怎么用,上下文菜单已经不在了……
  • 您找到解决方案了吗,我仍然遇到同样的问题。

标签: netbeans netbeans-8 netbeans-plugins


【解决方案1】:

NetBeans 8.2 原生包含该插件。

您所要做的就是导航到“选项”窗口并在相应选项卡中设置 PHP CS Fixer .phar 文件所在的路径。当然,如果您没有 .phar 文件,您必须先去下载它,方法是点击official PHP CS Fixer website 中的“立即安装”。

由于一张图讲了1000多字,所以截图如下:

最后但同样重要的是:为了在 NetBeans 8.2 中使用 PHP CS Fixer,您必须使用晦涩的菜单:Source > Inspect... 像过去一样在上下文菜单上快速又好用,太简单实用了;) 我花了 2 个小时才弄清楚这个“细节”。

【讨论】:

  • 请问您是如何最终让 NetBeans 做的不仅仅是试运行?
【解决方案2】:

对于找到此页面但仍然遇到困难的其他人,请注意在现代版本的 php-cs-fixer 上,您不能使用 level 选项。

相反,在自定义选项下,设置如下内容:

--rules=@Symfony

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-06-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-10
    • 1970-01-01
    相关资源
    最近更新 更多