civicrm / coder

Code sniffer configuration for CiviCRM. (Relaxed variant of Drupal CS)
5 stars 11 forks source link

Single line docblocks broken? #18

Closed artfulrobot closed 7 months ago

artfulrobot commented 7 months ago

if my original code is already correct (right?):

class Fred {

  /** @var array */
  public $a;
}

Then using this standard, the code becomes:

class Fred {

  /**
   * @var array*/
  public $a;
}

Noting:

  1. It's no longer a single line docblock nor a nice multiline docblock
  2. there's not even a space after the type declaration.
artfulrobot commented 7 months ago

Possibly this https://www.drupal.org/project/coder/issues/3367776

I guess we just have to not do inline docblocks.

colemanw commented 7 months ago

I believe they are allowed within functions, just not in class property declarations.

artfulrobot commented 7 months ago

@colemanw ah ok. Them's the rules, eh. Clear enough. Thanks.