简体   繁体   English

禁止Zend Studio中的警告

[英]Suppress warnings in Zend Studio

In Eclipse writing Java, it's easy to suppress warnings on some scopes, by annotating a method or variable within the IDE. 在用Java编写的Eclipse中,通过在IDE中注释方法或变量,很容易在某些范围内抑制警告。

Is it possible to suppress warnings at scopes while writing PHP within Zend Studio 7.0? 在Zend Studio 7.0中编写PHP时是否有可能在作用域内抑制警告?

Not that I know of, but in PHP you can use the Error Control Operator to suppress error messages. 我不知道,但是在PHP中,您可以使用错误控制运算符来禁止显示错误消息。 Mind the Warning though. 不过要注意警告。 This won't disable any error annotations given by Zend Studio itself. 这不会禁用Zend Studio本身给出的任何错误注释。 Which annotations are shown in general can be configured in Window | 可以在“ 窗口” |“窗口”中配置通常显示的注释 Preferences | 首选项| PHP | PHP | Editor | 编辑器 Mark Occurences . 标记出现

Java annotations like @SuppressWarnings don't work in Zend Studio or PHP because PHP does not know the concept of Annotations like Java implements them. 像@SuppressWarnings这样的Java注释在Zend Studio或PHP中不起作用,因为PHP不知道像Java那样实现注释的注释概念。

Not on a section-by-section basis, though you can turn off certain warnings globally via the preferences. 尽管可以通过首选项全局关闭某些警告,但不能逐节进行。 Be forewarned, however, that a lot of the warnings you see in Zend Studio would actually cause compiler errors in other languages so it is a good idea to mind them. 但是请注意,在Zend Studio中看到的许多警告实际上会导致其他语言的编译器错误,因此,最好记住这些警告。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM