I was trying to create an automatic fix for Drupal.Commenting.FunctionComment.ParamCommentFullStop #2721239: Fixing the Drupal.Commenting.FunctionComment.ParamCommentFullStop error automatically. I see a few different cases where the sniff is reporting an error where there may not be an error.

1) When the comment ends in a list

File /core/modules/system/src/Controller/DbUpdateController.php line 135

  /**
   * Returns a database update page.
   *
   * @param string $op
   *   The update operation to perform. Can be any of the below:
   *    - info
   *    - selection
   *    - run
   *    - results
   * @param \Symfony\Component\HttpFoundation\Request $request
   *   The current request object.
   *
   * @return \Symfony\Component\HttpFoundation\Response
   *   A response object object.
   */
  public function handle($op, Request $request) {

Should "- results" end with a full stop?

2) When there is a @code section inside the param comment

File core/modules/simpletest/src/WebTestBase.php line 974

    /**
   * Queues custom translations to be written to settings.php.
   *
   * Use WebTestBase::writeCustomTranslations() to apply and write the queued
   * translations.
   *
   * @param string $langcode
   *   The langcode to add translations for.
   * @param array $values
   *   Array of values containing the untranslated string and its translation.
   *   For example:
   *   @code
   *   array(
   *     '' => array('Sunday' => 'domingo'),
   *     'Long month name' => array('March' => 'marzo'),
   *   );
   *   @endcode
   *   Pass an empty array to remove all existing custom translations for the
   *   given $langcode.
   */
  protected function addCustomTranslations($langcode, array $values) {

3) When the comment line ends in a closing bracket

Looks like there is already an issue for this - #2683691: Allow comment to end in a closing parenthesis

Not sure if this is a comprehensive list. Will update as I try to get the auto fix working.

4) When there are @link tags inside the param comment

File core/lib/Drupal/Core/Mail/MailInterface.php 44

  /**
   * Sends a message composed by \Drupal\Core\Mail\MailManagerInterface->mail().
   *
   * @param array $message
   *   Message array with at least the following elements:
   *   - id: A unique identifier of the email type. Examples: 'contact_user_copy',
   *     'user_password_reset'.
   *   - to: The mail address or addresses where the message will be sent to.
   *     The formatting of this string will be validated with the.
   *     @link http://php.net/manual/filter.filters.validate.php PHP email validation filter. @endlink
   *     Some examples:
   *     - user@example.com
   *     - user@example.com, anotheruser@example.com
   *     - User <user@example.com>
   *     - User <user@example.com>, Another User <anotheruser@example.com>
   *   - subject: Subject of the email to be sent. This must not contain any
   *     newline characters, or the mail may not be sent properly. The subject
   *     is converted to plain text by the mail plugin manager.
   *   - body: Message to be sent. Accepts both CRLF and LF line-endings.
   *     Email bodies must be wrapped. For smart plain text wrapping you can use
   *     \Drupal\Core\Mail\MailFormatHelper::wrapMail() .
   *   - headers: Associative array containing all additional mail headers not
   *     defined by one of the other parameters.  PHP's mail() looks for Cc and
   *     Bcc headers and sends the mail to addresses in these headers too.
   *
   * @return bool
   *   TRUE if the mail was successfully accepted for delivery, otherwise FALSE.
   */
   public function mail(array $message);

Comments

anoopjohn created an issue. See original summary.

anoopjohn’s picture

Issue summary: View changes
Spokje’s picture

Status: Active » Closed (outdated)

The problems mentioned in the Issue Summary have either been fixed in the sniff itself, or are not seen as a problem any more.

Putting this issue on Closed (outdated).