Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14762359
D13428.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D13428.diff
View Options
diff --git a/src/lint/linter/xhpast/ArcanistXHPASTLinterRule.php b/src/lint/linter/xhpast/ArcanistXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/ArcanistXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/ArcanistXHPASTLinterRule.php
@@ -6,29 +6,10 @@
private $lintID = null;
final public static function loadAllRules() {
- $rules = array();
-
- $symbols = id(new PhutilSymbolLoader())
+ return id(new PhutilClassMapQuery())
->setAncestorClass(__CLASS__)
- ->loadObjects();
-
- foreach ($symbols as $class => $rule) {
- $id = $rule->getLintID();
-
- if (isset($rules[$id])) {
- throw new Exception(
- pht(
- 'Two linter rules (`%s`, `%s`) share the same lint ID (%d). '.
- 'Each linter rule must have a unique ID.',
- $class,
- get_class($rules[$id]),
- $id));
- }
-
- $rules[$id] = $rule;
- }
-
- return $rules;
+ ->setUniqueMethod('getLintID')
+ ->execute();
}
final public function getLintID() {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 24, 5:49 AM (12 h, 58 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7039223
Default Alt Text
D13428.diff (1 KB)
Attached To
Mode
D13428: Use PhutilClassMapQuery
Attached
Detach File
Event Timeline
Log In to Comment