Open josemv92 opened 1 year ago
We are facing the same behaviour in PhpStorm 2022.2.3 on macOS Monterey 12.6 and also in the automated phpcs test pipelines on azure cloud.
Any updates on this?
Any updates on this issue?
@celorodovalho As far as I can see, nobody has submitted a PR to fix this, so no.
Describe the bug Using the
Squiz.Commenting.FunctionCommentThrowTag.Missing
to warn when a method is throwing an exception not mentioned in the PHPdoc is requiring users to add the @throw tag even when the exception is caught in the same scope of the method.Code sample
Custom ruleset
To reproduce Steps to reproduce the behavior:
test.php
with the code sample above.phpcs test.php
Expected behavior The rule shouldn't trigger for users to set the @throws tag on the method PHPdoc since in the end the method won't be throwing this exception outside of its scope.
Versions (please complete the following information):
Additional context This is conflicting with other inspections applied by some IDEs (like PHPStorm) which indicates the @throws tag is not necessary.