PHPDoc - Function exits

喜欢而已 提交于 2019-12-12 09:56:10

问题


Is there a way to document that a particular function calls exit()?

The use case is that we have a function that is responsible for handling redirects (checks for already sent headers, set the response code, etc...) and then crucially calls exit(). Unfortunately, PHPStorm has no idea that this particular function terminates execution and thus suggests further warnings as if this function has returned when in practice, it never would.


回答1:


At the moment it's not possible.

https://youtrack.jetbrains.com/issue/WI-10673 -- watch this ticket (star/vote/comment) to get notified on progress.


ATM I may only suggest placing explicit die() or exit() calls after such function calls.



来源:https://stackoverflow.com/questions/31672862/phpdoc-function-exits

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!