comments - Using DocBlocks on PHP, Should I use @throws when I do not handle errors with execpetion? -


i have class handling errors, , not using try-throw-catch mechanism.

when commenting code uses class, should use the @throws tag though not throwing anything?

edit (try make question more clear):

my question if @throws tags means error occure when using code , handling in way, or means error occure , handling using throw keyword specifically?

after reading the documentation, realize not spelled out.

the documentation on @throws suggests if throw keyword present @ inside block of code, should documented each type of exception thrown regardless of whether or not you're handling or not.

so if have

try {     throw new exception(); } catch (exception $e) {     // handled! } 

put @throws entry in docblock.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -