Page MenuHomePhabricator

Add a linter rule for modifier ordering
ClosedPublic

Authored by joshuaspence on Apr 15 2015, 12:36 PM.
Tags
None
Referenced Files
F19825194: D12421.id.diff
Sun, Mar 8, 8:40 AM
F19680963: D12421.id31087.diff
Sun, Feb 8, 8:34 PM
F19511410: D12421.id.diff
Jan 12 2026, 1:57 AM
F19148061: D12421.id31151.diff
Dec 10 2025, 5:13 PM
F19112836: D12421.id.diff
Dec 9 2025, 5:24 PM
F19041137: D12421.id31156.diff
Nov 26 2025, 2:51 PM
F19004561: D12421.id.diff
Nov 21 2025, 12:04 PM
F18088407: D12421.id31156.diff
Aug 6 2025, 7:48 AM
Subscribers

Details

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 PSR-2.

Test Plan

Added unit tests.

Diff Detail

Repository
rARC Arcanist
Branch
master
Lint
Lint Passed
SeverityLocationCodeMessage
Auto-Fixsrc/lint/linter/__tests__/xhpast/array-comma.lint-test:73TXT6Trailing Whitespace
Auto-Fixsrc/lint/linter/__tests__/xhpast/array-comma.lint-test:78TXT6Trailing Whitespace
Unit
Tests Passed
Build Status
Buildable 6136
Build 6157: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

joshuaspence retitled this revision from to Add a linter rule for modifier ordering.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.

The order we use everywhere is:

final/abstract
public/protected/private
static

Is there a strong argument for changing that order?

Rebase, change ordering to be PSR-2 compliant

epriestley edited edge metadata.
This revision is now accepted and ready to land.May 19 2015, 12:58 PM
This revision was automatically updated to reflect the committed changes.