PHPCompatibility检测php版本语法兼容

直接上步骤:

 1 cd /datas/htdocs/
 2 mkdir PHPCompatibility
 3 cd PHPCompatibility/
 4 curl -s http://getcomposer.org/installer | php
 5 ./composer.phar require "squizlabs/php_codesniffer=2.*"
 6 cd vendor/squizlabs/php_codesniffer/CodeSniffer/Standards
 7 git clone https://github.com/wimg/PHPCompatibility.git
 8 cd /datas/htdocs/PHPCompatibility/
 9 ./vendor/bin/phpcs -i
10 ./vendor/bin/phpcs --standard=PHPCompatibility --runtime-set testVersion 7.1 /datas/htdocs/thinkphp/

上面第10行是那thinkphp做测试,结果类似:

1 FILE: ...s/htdocs/thinkphp/Library/Vendor/TemplateLite/class.compiler.php
2 ----------------------------------------------------------------------
3 FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
4 ----------------------------------------------------------------------
5  159 | ERROR   | preg_replace() - /e modifier is deprecated since PHP
6      |         | 5.5 and removed since PHP 7.0
7 ----------------------------------------------------------------------

更多PHPCompatibility相关内容,请参考 https://www.sitepoint.com/quick-intro-phpcompatibility-standard-for-phpcs-are-you-php7-ready/

时间: 2024-08-29 18:25:40

PHPCompatibility检测php版本语法兼容的相关文章

IE下判断IE版本语法使用

先摆一下判断IE版本语法 <!--[if lte IE 6]> <![endif]--> IE6及其以下版本可见 <!--[if lte IE 7]> <![endif]--> IE7及其以下版本可见 <!--[if IE 6]> <![endif]--> 只有IE6版本可见 <![if !IE]> <![endif]> 除了IE以外的版本 <!--[if lt IE 8]> <![endif

各版本浏览器兼容实现本地图片预览

1.IE浏览器  6: 直接获取inputFile对象的value 填充到img 标签的src 中        7++: 由于浏览器安全限制 直接使用绝对路径已经不能显示图片了. 需要AlphaImageLoader 滤镜技巧 (IE特有 )          filter : progid:DXImageTransform.Microsoft.AlphaImageLoader ( enabled=bEnabled , sizingMethod=sSize , src=sURL )     

spring定时任务包Quartz版本不兼容

使用spring定时任务包Quartz时,必须使用Quartz1.85以下版本的.     查看发现spring3.0.5中org.springframework.scheduling.quartz.CronTriggerBean继承了     org.quartz.CronTrigger(public class CronTriggerBeanextends CronTrigger),     而在quartz2.1.3中org.quartz.CronTrigger是个接口(publicabs

Selenium2学习-007-WebUI自动化实战实例-005-解决 Firefox 版本不兼容:org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary

此文主要讲述 Java 运行 Selenium 脚本时,因 Friefox 浏览器版本与 selenium-server-standalone-x.xx.x.jar 不兼容引起的 org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary 报错解决方法. 希望能对初学 Selenium2 WebUI 自动化测试编程的亲们有所帮助.若有不足之处,敬请大神指正,不胜感激! 之前给朋友初步介绍了 S

低版本系统兼容的ActionBar(二)ActionProvider+分离式ActionBar+分离式的ActionMode

       这篇文章主要讲的是在低版本兼容的ActionBar中实现自定义的ActionProvider,ShareActionProvider的使用方法,如何实现分离式ActionBar,外加在分离式ActionBar上的ActionMode的效果. 一.自定义ActionProvider 建立一个类,继承android.support.v4.view.ActionProvider,然后复写里面的方法即可.主要就是初始化视图和相应点击事件. 范例一: SettingsActionProvid

Gradle &#39;MYasprj&#39; project refresh failed Error:CreateProcess error=216, 该版本的 %1 与您运行的 Windows 版本不兼容

Gradle ‘MYasprj’ project refresh failed Error:CreateProcess error=216, 该版本的 %1 与您运行的 Windows 版本不兼容.请查看计算机的系统信息,了解是否需要 x86 (32 位)或 x64 (64 位)版本的程序,然后联系软件发布者. 解决方案: 你开发项目的引用Javajdk,与本机安装的Java jdk版本不一致,打开项目后,在project structure里面更改一下本机的真实的java jdk路径.  Gr

低版本系统兼容的ActionBar(三)自定义Item视图+进度条的实现+下拉导航+透明ActionBar

       一.自定义MenuItem的视图 custom_view.xml (就是一个单选按钮) <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android

检测应用版本

? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ?#pragma mark - 版本检测 - (void) checkVersion {     //  版本号的key     NSString *key = (NSString *)kCFBundleVersionKey;          //  从info.plist取版本号     NSString *version = [NSBundle mainBundle].in

Hibernate 验证版本不兼容问题

Hibernate验证版本不兼容 用5.0以上Hibernate 验证即可