vs code的php格式化

下载php-cs-fixer

https://cs.sensiolabs.org/download/php-cs-fixer-v2.phar

安装扩展 

phpformatter

点击配置

//打印日志信息,用于调试
    "phpformatter.logging": true,
    //不使用composer方式
    "phpformatter.composer": false,
    //添加自定义参数,默认的参数level已经在新版本中移出所以会导致运行出错
    //RULES=[@PSR1,@PSR2,@Symfony]
    //source:https://github.com/FriendsOfPHP/PHP-CS-Fixer#usage
    "phpformatter.arguments": [
        "--rules=@Symfony"
    ],
    // Should point to php-cs-fixer.phar file, if you have installed this manually (without Composer). Should include .phar extension.
    // php-cs-fixer.phar路径,使用composer方式时可以不填
    "phpformatter.pharPath": "C:/phpStudy/PHPTutorial/php/php-7.2.1-nts/php-cs-fixer-v2.phar",
    // If the pharPath is set, and you are not using Composer, and you haven't added PHP to your PATH, this should point to the php.exe file.
    // php路径,使用composer方式时可以不填
    "phpformatter.phpPath": "C:/phpStudy/PHPTutorial/php/php-7.2.1-nts/php.exe",

    "php.validate.executablePath": "C:/phpStudy/PHPTutorial/php/php-7.2.1-nts/php.exe"

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值