This is a part of the attempt to fix #2572645: [Meta] Fix 'Drupal.Commenting.FunctionComment' coding standard. This issue is created to tackle issues related to @throws in Function Comment.

The following sub-sniffs are being fixed in this issue

Drupal.Commenting.FunctionComment.ThrowsComment
Drupal.Commenting.FunctionComment.ThrowsNoFullStop
Drupal.Commenting.FunctionComment.ThrowsNotCapital

Comments

anoopjohn created an issue. See original summary.

anoopjohn’s picture

Status: Active » Needs review
StatusFileSize
new7.15 KB

Status: Needs review » Needs work
anoopjohn’s picture

The patch is failing because the patch is to be applied after #2708185: Fix 'Drupal.Commenting.FunctionComment' coding standard - Issues related to spacing and styling. I hope this approach is fine.

There was however a spacing issue in the patch and that has been fixed and the patch re-attached here. However do note that the patch will still fail to apply until the aforementioned patch is applied.

Status: Needs review » Needs work
anoopjohn’s picture

Status: Needs work » Needs review

Do note that there are two errors related to ThrowsComment that coder will still report after applying this fix. This is because of a bug in coder module which falsely identifies a class name with '_' as a having multiple words (and therefore as a comment) and expects the comment to be in a new line. The bug has been reported in coder and a patch for the fix submitted as well - #2707989: The rule Drupal.Commenting.FunctionComment.ThrowsComment incorrectly triggers error for error classes with underscores

anoopjohn’s picture

I have verified that this patch works with the latest head.

klausi’s picture

Status: Needs review » Needs work

I think we also need to change the phpcs.xml.dist file to include the sniff now?

anoopjohn’s picture

Status: Needs work » Needs review
StatusFileSize
new7.89 KB
new697 bytes

Sorry, missed that. I have updated the patch with the change in phpcs.xml.dist.

alexpott’s picture

Status: Needs review » Reviewed & tested by the community

Looks good - I don't think it is in scope to fix the language used in each @throws.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 8789530 and pushed to 8.1.x and 8.2.x. Thanks!

  • alexpott committed f324b3e on 8.2.x
    Issue #2708179 by anoopjohn: Fix 'Drupal.Commenting.FunctionComment'...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.