We have already disabled some of these rules for new code in the Translate extension (ref https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Translate/+/refs/heads/master/.phpcs.xml#27 )
Interesting – we do something similar in some Wikibase codebases (ref https://gerrit.wikimedia.org/g/mediawiki/extensions/Wikibase/+/0a3b07a195/.phpcs.xml#8), 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 https://gerrit.wikimedia.org/g/mediawiki/core/+/de752f45af/.phpcs.xml#8), 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;
…with:
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 https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/