首页 > Web开发 > 详细

vs code的 php 格式化设置

时间:2020-01-14 09:42:09      阅读:113      评论:0      收藏:0      [点我收藏+]

安装扩展 

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"

vs code的 php 格式化设置

原文:https://www.cnblogs.com/ryanzheng/p/12190240.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!