It is common practice to use exclamation marks to indicate special conditions on parameters.

This should be permitted without giving the error:

Parameter comment must end with a full stop.

Simple case:

  /**
   * Supplies a basic menu item product.
   *
   * @param string $title
   *   Required !
   * @param string $path
   *   Required !
   *
   * @return \Drupal\ooe\Menu\IMenuItem
   *   A new menu item.
   */
  public function newMenuItem($title, $path);

More complex case:

  /**
   * Add a validation handler to a form.
   *
   * @param array $form
   *   A Drupal form array.
   * @param string $validatorMethodName
   *   The name of a _static_ validator method (only) with signature
   *   ($form, &$form_state); DO NOT include the class name !
   */
  protected function addValidateHandler(array &$form, $validatorMethodName) {

Comments

webel’s picture

Another example of using '!' exclamation mark as caution in a parameter comment:

   * @param array $attributes
   *   Optional. A Drupal-style attributes array
   *   for the wrapping tag (if present). Will
   *   overwrite any existing attributes in the tag !

  • klausi committed 748150d on 8.x-2.x
    Issue #2463425: Permit exclamation mark ! punctuation at end of comment...
klausi’s picture

Version: 8.x-2.1 » 8.x-2.x-dev
Status: Active » Fixed

Committed a fix to allow "!" and "?", thanks for reporting!

webel’s picture

@klausi Confirmed with latest 8.x-2.x-dev, works, thanks this is a very useful improvement.

Status: Fixed » Closed (fixed)

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