Skip to content

[Feature Request]: Using rescue should "swallow" exceptions #1379

Description

@smares

Feature Description

Consider this method:

/**
 * @throws Exception
 */
public function foo(): void
{
    // ...
    throw new Exception("Oh no!");
    // ...
}

If this method is called somewhere and there is no try...catch wrapping it, PhpStorm will suggest either wrapping the call in a try...catch or adding @throws Exception to the PHPDoc of the caller.
If you wrap the method call in Laravel's helper rescue however, no exception is thrown - at least not unless the fallback is a method that itself throws own exceptions, but PhpStorm still thinks an exception is thrown.

Do you think it would make sense for Laravel Idea to stop PhpStorm from thinking the caller throws an exception?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions