Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/query/PhabricatorConduitMethodQuery.php
| Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | final class PhabricatorConduitMethodQuery | ||||
| protected function loadPage() { | protected function loadPage() { | ||||
| $methods = $this->getAllMethods(); | $methods = $this->getAllMethods(); | ||||
| $methods = $this->filterMethods($methods); | $methods = $this->filterMethods($methods); | ||||
| return $methods; | return $methods; | ||||
| } | } | ||||
| private function getAllMethods() { | private function getAllMethods() { | ||||
| static $methods; | return id(new PhutilClassMapQuery()) | ||||
| if ($methods === null) { | |||||
| $methods = id(new PhutilSymbolLoader()) | |||||
| ->setAncestorClass('ConduitAPIMethod') | ->setAncestorClass('ConduitAPIMethod') | ||||
| ->loadObjects(); | ->setSortMethod('getSortOrder') | ||||
| $methods = msort($methods, 'getSortOrder'); | ->execute(); | ||||
| } | |||||
| return $methods; | |||||
| } | } | ||||
| private function filterMethods(array $methods) { | private function filterMethods(array $methods) { | ||||
| foreach ($methods as $key => $method) { | foreach ($methods as $key => $method) { | ||||
| $application = $method->getApplication(); | $application = $method->getApplication(); | ||||
| if (!$application) { | if (!$application) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines | |||||