We have already disabled some of these rules for new code in the Translate extension (ref)

Interesting – we do something similar in some Wikibase codebases (ref), but I didn’t know there were other extensions doing the same thing.

Note that doc comments for properties are actually not required, as far as I can tell

I think that’s specific to MediaWiki core (ref), and possibly other extensions that disable the MediaWiki.Commenting.PropertyDocumentation.MissingDocumentation(Public|Protected|Private) sniff – out of the box, I believe mediawiki-codesniffer requires property documentation at the moment.

Am Fr., 28. Okt. 2022 um 17:51 Uhr schrieb Bartosz Dziewoński <matma.rex@gmail.com>:
I agree, a lot of the doc comments become redundant when types are
specified in type hints.

Note that doc comments for properties are actually not required, as far
as I can tell – you could replace:

   /** @var LinkRenderer */
   private $linkRenderer;


   private LinkRenderer $linkRenderer;

…today!, and no lint checks are going to stop you. I've been suggesting
this for new code since we moved to PHP 7.4, which allows these type
hints on properties.

Bartosz Dziewoński
Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org
To unsubscribe send an email to wikitech-l-leave@lists.wikimedia.org

Lucas Werkmeister (he/er)
Software Engineer

Wikimedia Deutschland e. V. | Tempelhofer Ufer 23-24 | 10963 Berlin
Phone: +49 (0)30-577 11 62-0

Imagine a world in which every single human being can freely share in the sum of all knowledge. Help us to achieve our vision!

Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e. V. Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg unter der Nummer 23855 B. Als gemeinnützig anerkannt durch das Finanzamt für Körperschaften I Berlin, Steuernummer 27/029/42207.