Page MenuHomePhabricator

Reconsider PHPCS sniffs for private methods and properties
Open, LowPublic

Description

The two sniffs MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate and MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPrivate are already disabled for GrowthExperiments (or to be more precise: were never enabled, see the blame for
https://github.com/wikimedia/mediawiki-extensions-GrowthExperiments/blob/master/.phpcs.xml).

Should we also disable them for CommunityConfiguration?

  • It might be nice to have a somewhat consistent code style across the team's code bases
  • requiring a php-doc on private methods incentivizes doc-blocks that just repeat the method signature without adding addition information
  • we can now add type-hints to properties, so requiring php-doc on the private ones should no longer be necessary