Linked Questions

Popular Questions

I would like to inherit PHPDoc for exceptions thrown in a dispatcher to improve documentation and be aware of all the possible exceptions thrown.

class SomeController
{ 
   ...
   /**
     * @return JsonResponse
     * ### MISSING AUTO GENERATED PHPDOC: @throws SomeException 
     */
    public function changePassword()
    {
        /** @uses SomedHandler::handleSomething()*/
        $this->commandBus->dispatch(Something::fromArray([
        ...
        ]));

        return new JsonResponse(null, Response::HTTP_NO_CONTENT);
    }
}


class SomedHandler extends SimpleCommandHandler
{
    /**
     * @param Something $something
     * @throws SomeException
     */
    public function handleSomething(Something $something)
    {
        throw new SomeException();
    }
}

As shown in above I can't get the thrown exceptions nested in the handler. My attempt was to use tag @uses with the class and the method to dispatch, but PhpStorm isn't generating the exceptions for the method handleSomething(). While @uses helps the navigation I would like to get the exceptions thrown as well.

Related Questions