Skip to content
Advertisement

PHPDoc – Function exits

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.

Advertisement

Answer

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.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement