PHPStorm 2017.3关闭提示 this inspection reports exceptions which are neither enclosed in a try-catch...

原创
2017/11/30 10:57
阅读数 5.6K

PHPStorm 2017.3中新增加了Unhandled Exception 异常提示: 比如使用了throw new Exception("...") 的地方 方法体的phpdoc中没有添加@throw Exception 标签或者在代码块中没有添加try-catch 就会有该提示,官方描述如下: In PhpStorm 2017.3 we’ve added a new inspection Unhandled Exception, which can be found under Settings | Editor | Inspections | PHP | Probable bugs | Unhandled exception. It reports exceptions which are neither enclosed in a try-catch block nor documented using the @throws tag. The inspection helps you find all the places where exceptions could be thrown what would, in turn, lead to Fatal Error. There is a quick fix: “Add @throws tag” and in the next EAP we’re planning to release “Surround with try/catch” quick fix.

如何关掉提示: Preferences->Editor->Inspections-> 搜索框输入“Unhandled Exception” 把后面的框变为未勾选状态 点击OK 即可 输入图片说明

同理关掉 Error handling

展开阅读全文
打赏
0
0 收藏
分享

作者的其它热门文章

打赏
0 评论
0 收藏
0
分享
返回顶部
顶部