Page MenuHomePhabricator

Should we require documentation for constructors?
Closed, ResolvedPublic

Description

In testing 0.8.0-alpha.1, I'm being prompted via MediaWiki.Commenting.FunctionComment.Missing to write function comments for __construct which feels a little unnecessary.

Event Timeline

You can just document the constructor parameters, and it'll pass.

I think it's worth documenting parameters for every method, including constructors. But no need, as you say, to write something like "Creates a new Blah" as the method description.

Change 353618 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/tools/codesniffer@master] Don't require documentation for constructors without parameters

https://gerrit.wikimedia.org/r/353618

Change 353618 merged by jenkins-bot:
[mediawiki/tools/codesniffer@master] Don't require documentation for constructors without parameters

https://gerrit.wikimedia.org/r/353618