PHPCSStandards / phpcs-docs

1 stars 0 forks source link

Fix @link matcher #13

Open afilina opened 3 years ago

afilina commented 3 years ago

Currently, the @link matcher fails on any value that includes newlines or anything after the URL. Make it more permissive.

afilina commented 3 years ago

There are two possible solutions:

  1. If there is anything after the URL, we treat it as the name of the link. So @link https://www.php.net/language.constants.predefined PHP Manual on magic constants will become [PHP Manual on magic constants](https://www.php.net/language.constants.predefined).
  2. We ignore everything after the URL, so @link https://www.php.net/language.constants.predefined PHP Manual on magic constants will become [https://www.php.net/language.constants.predefined](https://www.php.net/language.constants.predefined).

I have a working implementation for option number 1, if we decide to go that route. We'd need to fix two @link tags in PHPCompatibility, which use parentheses. Example: @link https://wiki.php.net/rfc/horizontalreuse (traits)

jrfnl commented 3 years ago

Based on the (un)official docs, the first solution would be the correct one. Fixing up those links in PHPCompatibility should be easy enough to do.

Syntax

@link [URI] [description]

Refs: