App\Exceptions\Handler.report retuning void - supposedly.

Posted 3 years ago by thomthom

I was poking around and noticed that PhpStorm squawked on the default App\Exceptions\Handler.report:

    /**
     * Report or log an exception.
     *
     * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
     *
     * @param  \Exception  $e
     * @return void
     */
    public function report(Exception $e)
    {
        return parent::report($e);
    }

PhpStorm complains about two things here, using a return statement in a function marked as returing void, and trying to return the value from a void function.

The doc block says it returns void, and the parent::report function appear to also return void.

It appear to me that PhpStorm is correct here, the return statement is meaningless. Is this correct or is there some Laravel dynamic magic somewhere?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.