]> khamidou — GitHub mirrors - arcanist.git/commit
Add a linter rule for modifier ordering
authorJoshua Spence <josh@joshuaspence.com>
Tue, 19 May 2015 21:23:34 +0000 (07:23 +1000)
committerJoshua Spence <josh@joshuaspence.com>
Tue, 19 May 2015 21:26:16 +0000 (07:26 +1000)
commit80691e0a66464aa280ba45121811b08015e41d8a
tree597be12601a9301f9009d2146bad635ce4f29f13
parent993166fa497e6c19d15acb8c84f4c37749e589c1
Add a linter rule for modifier ordering

Summary: Fixes T7417. Adds `ArcanistXHPASTLinter::LINT_MODIFIER_ORDERING` for ensuring that method/property modifiers (`public`, `protected`, `private`, `static`, `abstract` and `final`) are consistently ordered. The modifier ordering that is enforced is consistent with [[http://www.php-fig.org/psr/psr-2 | PSR-2]].

Test Plan: Added unit tests.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T7417

Differential Revision: https://secure.phabricator.com/D12421
src/lint/linter/ArcanistXHPASTLinter.php
src/lint/linter/__tests__/xhpast/array-comma.lint-test
src/lint/linter/__tests__/xhpast/modifier-ordering.lint-test [new file with mode: 0644]
src/lint/linter/__tests__/xhpast/unnecessary-final-modifier.lint-test