-1

I have a doccomment on a class like so:

/**
 * @method Response\FooResponse foo(Parameters\FooParameters $parameters)
 */
class Foo
{
}

This method can throw a FooException. How do I indicate this in the doccomment?

bcmcfc
  • 25,966
  • 29
  • 109
  • 181

2 Answers2

0

Just use PHPDoc's @throws in the docblock to specify which kind of exception might occur in that method.

mrodo
  • 565
  • 5
  • 21
  • This would be a better answer if you showed the OP that coded into his docblock – RiggsFolly Jul 19 '21 at 12:56
  • I know that exists but I don't know how to bring it into a `@method` annotation specifically. I couldn't find that documented anywhere. – bcmcfc Jul 19 '21 at 12:57
0

Since JSDocs are similar in definitions, you can use @throws. Check this article for reference: https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html#throwstag

CyberDev
  • 228
  • 1
  • 7