Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15376350
D13573.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D13573.id.diff
View Options
diff --git a/src/configuration/ArcanistConfiguration.php b/src/configuration/ArcanistConfiguration.php
--- a/src/configuration/ArcanistConfiguration.php
+++ b/src/configuration/ArcanistConfiguration.php
@@ -35,28 +35,10 @@
}
public function buildAllWorkflows() {
- $workflows_by_name = array();
-
- $workflows_by_class_name = id(new PhutilSymbolLoader())
+ return id(new PhutilClassMapQuery())
->setAncestorClass('ArcanistWorkflow')
- ->loadObjects();
- foreach ($workflows_by_class_name as $class => $workflow) {
- $name = $workflow->getWorkflowName();
-
- if (isset($workflows_by_name[$name])) {
- $other = get_class($workflows_by_name[$name]);
- throw new Exception(
- pht(
- 'Workflows %s and %s both implement workflows named %s.',
- $class,
- $other,
- $name));
- }
-
- $workflows_by_name[$name] = $workflow;
- }
-
- return $workflows_by_name;
+ ->setUniqueMethod('getWorkflowName')
+ ->execute();
}
final public function isValidWorkflow($workflow) {
diff --git a/src/lint/engine/ArcanistConfigurationDrivenLintEngine.php b/src/lint/engine/ArcanistConfigurationDrivenLintEngine.php
--- a/src/lint/engine/ArcanistConfigurationDrivenLintEngine.php
+++ b/src/lint/engine/ArcanistConfigurationDrivenLintEngine.php
@@ -137,36 +137,10 @@
}
private function loadAvailableLinters() {
- $linters = id(new PhutilSymbolLoader())
+ return id(new PhutilClassMapQuery())
->setAncestorClass('ArcanistLinter')
- ->loadObjects();
-
- $map = array();
- foreach ($linters as $linter) {
- $name = $linter->getLinterConfigurationName();
-
- // This linter isn't selectable through configuration.
- if ($name === null) {
- continue;
- }
-
- if (empty($map[$name])) {
- $map[$name] = $linter;
- continue;
- }
-
- $orig_class = get_class($map[$name]);
- $this_class = get_class($linter);
- throw new Exception(
- pht(
- "Two linters (`%s`, `%s`) both have the same configuration ".
- "name ('%s'). Linters must have unique configuration names.",
- $orig_class,
- $this_class,
- $name));
- }
-
- return $map;
+ ->setUniqueMethod('getLinterConfigurationName', true)
+ ->execute();
}
private function matchPaths(
diff --git a/src/unit/engine/PhutilUnitTestEngine.php b/src/unit/engine/PhutilUnitTestEngine.php
--- a/src/unit/engine/PhutilUnitTestEngine.php
+++ b/src/unit/engine/PhutilUnitTestEngine.php
@@ -76,11 +76,9 @@
private function getAllTests() {
$project_root = $this->getWorkingCopy()->getProjectRoot();
- $symbols = id(new PhutilSymbolLoader())
- ->setType('class')
+ $symbols = id(new PhutilClassMapQuery())
->setAncestorClass('PhutilTestCase')
- ->setConcreteOnly(true)
- ->selectSymbolsWithoutLoading();
+ ->execute();
$in_working_copy = array();
diff --git a/src/workflow/ArcanistLintersWorkflow.php b/src/workflow/ArcanistLintersWorkflow.php
--- a/src/workflow/ArcanistLintersWorkflow.php
+++ b/src/workflow/ArcanistLintersWorkflow.php
@@ -36,9 +36,9 @@
public function run() {
$console = PhutilConsole::getConsole();
- $linters = id(new PhutilSymbolLoader())
+ $linters = id(new PhutilClassMapQuery())
->setAncestorClass('ArcanistLinter')
- ->loadObjects();
+ ->execute();
try {
$built = $this->newLintEngine()->buildLinters();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 14, 2:56 AM (5 d, 4 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7642278
Default Alt Text
D13573.id.diff (3 KB)
Attached To
Mode
D13573: Use PhutilClassMapQuery instead of PhutilSymbolLoader
Attached
Detach File
Event Timeline
Log In to Comment