首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PHP CS修复程序无法在Visual Studio代码中加载.php-cs文件

PHP CS修复程序无法在Visual Studio代码中加载.php-cs文件
EN

Stack Overflow用户
提问于 2020-01-26 06:56:53
回答 1查看 2.8K关注 0票数 0

我从https://github.com/FriendsOfPHP/PHP-CS-Fixer下载并安装了PHP VSCode扩展(由junstyle提供)和官方的php- CS - Fixer -v2.phar文件。我创建了一个名为config.php-cs的文件,并将参考配置代码粘贴到其中:

代码语言:javascript
复制
return PhpCsFixer\Config::create()
    ->setRules(array(
        '@PSR2' => true,
        'array_indentation' => true,
         ....

我把这两个文件都放在C:\wamp64\www\configuration_php\里了

这是我的settings.json

代码语言:javascript
复制
{
    "workbench.iconTheme": "file-icons",
    "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
    "editor.formatOnPaste": true,
    "workbench.colorTheme": "One Dark Pro",
    "editor.fontLigatures": true,
    "editor.lineHeight": 22,
    "files.trimTrailingWhitespace": true,
    "editor.fontWeight": "400",
    "editor.renderWhitespace": "all",
    "editor.tabSize": 2,
    "editor.cursorStyle": "line",
    "editor.insertSpaces": false,
    "prettier.useTabs": true,
    "terminal.integrated.fontSize": 15,
    "javascript.validate.enable": false,
    "editor.formatOnSave": true,
    "files.autoSave": "off",
    "window.zoomLevel": 0,
    "editor.fontFamily": "JetBrains Mono, Consolas, 'Courier New', monospace",
    "editor.cursorBlinking": "smooth",
    "editor.formatOnSaveTimeout": 5000,
    "php-cs-fixer.executablePath": "C:\\wamp64\\www\\configuration_php\\php-cs-fixer-v2.phar",
    "php-cs-fixer.config": "C:\\wamp64\\www\\configuration_php\\config.php_cs",
    "php-cs-fixer.onsave": true,
}

我可以告诉我的编辑器考虑executablePath,因为如果我在路径中放了一个错误,我会得到一个错误消息。问题出在配置路径上。VSCode似乎完全忽略了它,不会使用配置文件,如果我在路径或文件内容中引入错误,也不会引发任何错误。

我是不是漏掉了什么?

EN

回答 1

Stack Overflow用户

发布于 2020-01-26 17:59:16

对不起,伙计们,我是个土豆,我写了"php-cs“而不是"php_cs”。关着的不营业的。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59914126

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档