>
> 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 <
[email protected]>:

> 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 -- [email protected]
> To unsubscribe send an email to [email protected]
> https://lists.wikimedia.org/postorius/lists/wikitech-l.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
https://wikimedia.de

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

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.
_______________________________________________
Wikitech-l mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/

Reply via email to