This docblock which has multiple @throws tags generates false positives and notices during code sniffing:

/**
 * Verifies that the given field is of the given type.
 *
 * @param string $field
 *   Field ID, name or label.
 * @param string $type
 *   The expected field type.
 *
 * @throws \Behat\Mink\Exception\ElementNotFoundException
 *   Thrown when the field is not found on the page.
 * @throws \Exception
 *   Thrown when the field is not of the expected type.
 *
 * @Then (I should see )(that )the :field field is a :type( field)
 */
Notice: Undefined index: comment_closer in vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Commenting/FunctionCommentSniff.php on line 310
FILE: features/bootstrap/FeatureContext.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 18 | ERROR | Comment missing or not on the next line for @throws tag
    |       | in function comment
----------------------------------------------------------------------
CommentFileSizeAuthor
#4 2461909-4.patch3.49 KBpfrenssen
#1 2461909-1.patch3.35 KBpfrenssen
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pfrenssen’s picture

Status: Active » Needs review
FileSize
3.35 KB
pfrenssen’s picture

Component: Code » Coder Sniffer
klausi’s picture

Status: Needs review » Needs work

Patch does not apply, please reroll against 8.x-2.x HEAD.

pfrenssen’s picture

Status: Needs work » Needs review
FileSize
3.49 KB

Rerolled.

klausi’s picture

Status: Needs review » Fixed

Rerolled one more time and committed that, thanks!

  • klausi committed b4f4657 on 8.x-2.x authored by pfrenssen
    Issue #2461909 by pfrenssen: Notices and false positives when docblock...

Status: Fixed » Closed (fixed)

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