]> khamidou — GitHub mirrors - arcanist.git/commit
Add a linter rule to detect implict method visibility
authorJoshua Spence <josh@joshuaspence.com>
Tue, 6 Jan 2015 20:42:41 +0000 (07:42 +1100)
committerJoshua Spence <josh@joshuaspence.com>
Tue, 6 Jan 2015 20:42:41 +0000 (07:42 +1100)
commit4f5203375e0b7cfad53e2ad75c80164aff2d9baa
tree2b27df1131aee9679c89391a94480882570ca615
parentfbefe61fb9c59a95c7b3802c35d812edd99ea3c6
Add a linter rule to detect implict method visibility

Summary: I'm not sure whether this is in any coding standards, but it seems to be an unspoken rule that methods should have a visiblity modifier (`public`, `protected` or `private`) explicitly specified. According to the [[http://php.net/manual/en/language.oop5.visibility.php#language.oop5.visiblity-methods | PHP documentation]], methods declared without any explicit visibility keyword are defined as public.

Test Plan: Added a test case.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D10687
src/lint/linter/ArcanistXHPASTLinter.php
src/lint/linter/__tests__/xhpast/decl-parens-hug-closing.lint-test
src/lint/linter/__tests__/xhpast/implicit-visibility.lint-test [new file with mode: 0644]