1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-31 08:58:20 +01:00

Linter fixes

Summary: Apply various minor linter fixes.

Test Plan: `arc lint`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D13109
This commit is contained in:
Joshua Spence 2015-06-02 22:14:01 +10:00
parent 2d15c3c062
commit bf81fda036
16 changed files with 53 additions and 53 deletions

View file

@ -86,7 +86,7 @@ abstract class PhabricatorAphlictManagementWorkflow
exit(1); exit(1);
} }
protected final function setDebug($debug) { final protected function setDebug($debug) {
$this->debug = $debug; $this->debug = $debug;
} }

View file

@ -29,7 +29,7 @@ abstract class PhabricatorApplication implements PhabricatorPolicyInterface {
/* -( Application Information )-------------------------------------------- */ /* -( Application Information )-------------------------------------------- */
public abstract function getName(); abstract public function getName();
public function getShortDescription() { public function getShortDescription() {
return pht('%s Application', $this->getName()); return pht('%s Application', $this->getName());

View file

@ -90,7 +90,7 @@ abstract class ConduitAPIMethod
return $this->execute($request); return $this->execute($request);
} }
public abstract function getAPIMethodName(); abstract public function getAPIMethodName();
/** /**
* Return a key which sorts methods by application name, then method status, * Return a key which sorts methods by application name, then method status,

View file

@ -5,7 +5,7 @@ abstract class PhabricatorDaemonManagementWorkflow
private $runDaemonsAsUser = null; private $runDaemonsAsUser = null;
protected final function loadAvailableDaemonClasses() { final protected function loadAvailableDaemonClasses() {
$loader = new PhutilSymbolLoader(); $loader = new PhutilSymbolLoader();
return $loader return $loader
->setAncestorClass('PhutilDaemon') ->setAncestorClass('PhutilDaemon')
@ -13,12 +13,12 @@ abstract class PhabricatorDaemonManagementWorkflow
->selectSymbolsWithoutLoading(); ->selectSymbolsWithoutLoading();
} }
protected final function getPIDDirectory() { final protected function getPIDDirectory() {
$path = PhabricatorEnv::getEnvConfig('phd.pid-directory'); $path = PhabricatorEnv::getEnvConfig('phd.pid-directory');
return $this->getControlDirectory($path); return $this->getControlDirectory($path);
} }
protected final function getLogDirectory() { final protected function getLogDirectory() {
$path = PhabricatorEnv::getEnvConfig('phd.log-directory'); $path = PhabricatorEnv::getEnvConfig('phd.log-directory');
return $this->getControlDirectory($path); return $this->getControlDirectory($path);
} }
@ -42,7 +42,7 @@ abstract class PhabricatorDaemonManagementWorkflow
return $path; return $path;
} }
protected final function loadRunningDaemons() { final protected function loadRunningDaemons() {
$daemons = array(); $daemons = array();
$pid_dir = $this->getPIDDirectory(); $pid_dir = $this->getPIDDirectory();
@ -56,7 +56,7 @@ abstract class PhabricatorDaemonManagementWorkflow
return array_mergev($daemons); return array_mergev($daemons);
} }
protected final function loadAllRunningDaemons() { final protected function loadAllRunningDaemons() {
$local_daemons = $this->loadRunningDaemons(); $local_daemons = $this->loadRunningDaemons();
$local_ids = array(); $local_ids = array();
@ -114,7 +114,7 @@ abstract class PhabricatorDaemonManagementWorkflow
return head($match); return head($match);
} }
protected final function launchDaemons( final protected function launchDaemons(
array $daemons, array $daemons,
$debug, $debug,
$run_as_current_user = false) { $run_as_current_user = false) {
@ -307,7 +307,7 @@ abstract class PhabricatorDaemonManagementWorkflow
/* -( Commands )----------------------------------------------------------- */ /* -( Commands )----------------------------------------------------------- */
protected final function executeStartCommand(array $options) { final protected function executeStartCommand(array $options) {
PhutilTypeSpec::checkMap( PhutilTypeSpec::checkMap(
$options, $options,
array( array(
@ -377,7 +377,7 @@ abstract class PhabricatorDaemonManagementWorkflow
return 0; return 0;
} }
protected final function executeStopCommand( final protected function executeStopCommand(
array $pids, array $pids,
array $options) { array $options) {
@ -454,7 +454,7 @@ abstract class PhabricatorDaemonManagementWorkflow
return 0; return 0;
} }
protected final function executeReloadCommand(array $pids) { final protected function executeReloadCommand(array $pids) {
$console = PhutilConsole::getConsole(); $console = PhutilConsole::getConsole();
$daemons = $this->loadRunningDaemons(); $daemons = $this->loadRunningDaemons();

View file

@ -2,7 +2,7 @@
abstract class DifferentialLandingStrategy { abstract class DifferentialLandingStrategy {
public abstract function processLandRequest( abstract public function processLandRequest(
AphrontRequest $request, AphrontRequest $request,
DifferentialRevision $revision, DifferentialRevision $revision,
PhabricatorRepository $repository); PhabricatorRepository $repository);
@ -10,7 +10,7 @@ abstract class DifferentialLandingStrategy {
/** /**
* @return PhabricatorActionView or null. * @return PhabricatorActionView or null.
*/ */
public abstract function createMenuItem( abstract public function createMenuItem(
PhabricatorUser $viewer, PhabricatorUser $viewer,
DifferentialRevision $revision, DifferentialRevision $revision,
PhabricatorRepository $repository); PhabricatorRepository $repository);

View file

@ -10,42 +10,42 @@ abstract class DivinerPublisher {
private $symbolReverseMap; private $symbolReverseMap;
private $dropCaches; private $dropCaches;
public final function setDropCaches($drop_caches) { final public function setDropCaches($drop_caches) {
$this->dropCaches = $drop_caches; $this->dropCaches = $drop_caches;
return $this; return $this;
} }
public final function setRenderer(DivinerRenderer $renderer) { final public function setRenderer(DivinerRenderer $renderer) {
$renderer->setPublisher($this); $renderer->setPublisher($this);
$this->renderer = $renderer; $this->renderer = $renderer;
return $this; return $this;
} }
public final function getRenderer() { final public function getRenderer() {
return $this->renderer; return $this->renderer;
} }
public final function setConfig(array $config) { final public function setConfig(array $config) {
$this->config = $config; $this->config = $config;
return $this; return $this;
} }
public final function getConfig($key, $default = null) { final public function getConfig($key, $default = null) {
return idx($this->config, $key, $default); return idx($this->config, $key, $default);
} }
public final function getConfigurationData() { final public function getConfigurationData() {
return $this->config; return $this->config;
} }
public final function setAtomCache(DivinerAtomCache $cache) { final public function setAtomCache(DivinerAtomCache $cache) {
$this->atomCache = $cache; $this->atomCache = $cache;
$graph_map = $this->atomCache->getGraphMap(); $graph_map = $this->atomCache->getGraphMap();
$this->atomGraphHashToNodeHashMap = array_flip($graph_map); $this->atomGraphHashToNodeHashMap = array_flip($graph_map);
return $this; return $this;
} }
protected final function getAtomFromGraphHash($graph_hash) { final protected function getAtomFromGraphHash($graph_hash) {
if (empty($this->atomGraphHashToNodeHashMap[$graph_hash])) { if (empty($this->atomGraphHashToNodeHashMap[$graph_hash])) {
throw new Exception(pht("No such atom '%s'!", $graph_hash)); throw new Exception(pht("No such atom '%s'!", $graph_hash));
} }
@ -54,7 +54,7 @@ abstract class DivinerPublisher {
$this->atomGraphHashToNodeHashMap[$graph_hash]); $this->atomGraphHashToNodeHashMap[$graph_hash]);
} }
protected final function getAtomFromNodeHash($node_hash) { final protected function getAtomFromNodeHash($node_hash) {
if (empty($this->atomMap[$node_hash])) { if (empty($this->atomMap[$node_hash])) {
$dict = $this->atomCache->getAtom($node_hash); $dict = $this->atomCache->getAtom($node_hash);
$this->atomMap[$node_hash] = DivinerAtom::newFromDictionary($dict); $this->atomMap[$node_hash] = DivinerAtom::newFromDictionary($dict);
@ -62,7 +62,7 @@ abstract class DivinerPublisher {
return $this->atomMap[$node_hash]; return $this->atomMap[$node_hash];
} }
protected final function getSimilarAtoms(DivinerAtom $atom) { final protected function getSimilarAtoms(DivinerAtom $atom) {
if ($this->symbolReverseMap === null) { if ($this->symbolReverseMap === null) {
$rmap = array(); $rmap = array();
$smap = $this->atomCache->getSymbolMap(); $smap = $this->atomCache->getSymbolMap();
@ -94,7 +94,7 @@ abstract class DivinerPublisher {
* `f()`, we assign them an arbitrary (but fairly stable) order and publish * `f()`, we assign them an arbitrary (but fairly stable) order and publish
* them as `function/f/1/`, `function/f/2/`, etc., or similar. * them as `function/f/1/`, `function/f/2/`, etc., or similar.
*/ */
protected final function getAtomSimilarIndex(DivinerAtom $atom) { final protected function getAtomSimilarIndex(DivinerAtom $atom) {
$atoms = $this->getSimilarAtoms($atom); $atoms = $this->getSimilarAtoms($atom);
if (count($atoms) == 1) { if (count($atoms) == 1) {
return 0; return 0;
@ -116,7 +116,7 @@ abstract class DivinerPublisher {
abstract protected function createDocumentsByHash(array $hashes); abstract protected function createDocumentsByHash(array $hashes);
abstract public function findAtomByRef(DivinerAtomRef $ref); abstract public function findAtomByRef(DivinerAtomRef $ref);
public final function publishAtoms(array $hashes) { final public function publishAtoms(array $hashes) {
$existing = $this->loadAllPublishedHashes(); $existing = $this->loadAllPublishedHashes();
if ($this->dropCaches) { if ($this->dropCaches) {
@ -140,7 +140,7 @@ abstract class DivinerPublisher {
$this->createDocumentsByHash($created); $this->createDocumentsByHash($created);
} }
protected final function shouldGenerateDocumentForAtom(DivinerAtom $atom) { final protected function shouldGenerateDocumentForAtom(DivinerAtom $atom) {
switch ($atom->getType()) { switch ($atom->getType()) {
case DivinerAtom::TYPE_METHOD: case DivinerAtom::TYPE_METHOD:
case DivinerAtom::TYPE_FILE: case DivinerAtom::TYPE_FILE:

View file

@ -2,7 +2,7 @@
abstract class DrydockController extends PhabricatorController { abstract class DrydockController extends PhabricatorController {
public abstract function buildSideNavView(); abstract public function buildSideNavView();
public function buildApplicationMenu() { public function buildApplicationMenu() {
return $this->buildSideNavView()->getMenu(); return $this->buildSideNavView()->getMenu();

View file

@ -72,7 +72,7 @@ abstract class HarbormasterBuildStepImplementation {
* Loads the settings for this build step implementation from a build * Loads the settings for this build step implementation from a build
* step or target. * step or target.
*/ */
public final function loadSettings($build_object) { final public function loadSettings($build_object) {
$this->settings = $build_object->getDetails(); $this->settings = $build_object->getDetails();
return $this; return $this;
} }

View file

@ -2,17 +2,17 @@
abstract class HeraldCustomAction { abstract class HeraldCustomAction {
public abstract function appliesToAdapter(HeraldAdapter $adapter); abstract public function appliesToAdapter(HeraldAdapter $adapter);
public abstract function appliesToRuleType($rule_type); abstract public function appliesToRuleType($rule_type);
public abstract function getActionKey(); abstract public function getActionKey();
public abstract function getActionName(); abstract public function getActionName();
public abstract function getActionType(); abstract public function getActionType();
public abstract function applyEffect( abstract public function applyEffect(
HeraldAdapter $adapter, HeraldAdapter $adapter,
$object, $object,
HeraldEffect $effect); HeraldEffect $effect);

View file

@ -18,8 +18,8 @@ abstract class ManiphestExcelFormat {
return $objects; return $objects;
} }
public abstract function getName(); abstract public function getName();
public abstract function getFileName(); abstract public function getFileName();
public function getOrder() { public function getOrder() {
return 0; return 0;
@ -35,7 +35,7 @@ abstract class ManiphestExcelFormat {
/** /**
* @phutil-external-symbol class PHPExcel * @phutil-external-symbol class PHPExcel
*/ */
public abstract function buildWorkbook( abstract public function buildWorkbook(
PHPExcel $workbook, PHPExcel $workbook,
array $tasks, array $tasks,
array $handles, array $handles,

View file

@ -29,7 +29,7 @@ final class PhabricatorFeedStoryNotification extends PhabricatorFeedDAO {
) + parent::getConfiguration(); ) + parent::getConfiguration();
} }
static public function updateObjectNotificationViews( public static function updateObjectNotificationViews(
PhabricatorUser $user, PhabricatorUser $user,
$object_phid) { $object_phid) {

View file

@ -11,18 +11,18 @@ final class PhabricatorOAuthServerScope {
* used to simplify code for data that is not currently accessible * used to simplify code for data that is not currently accessible
* via OAuth. * via OAuth.
*/ */
static public function getScopesDict() { public static function getScopesDict() {
return array( return array(
self::SCOPE_OFFLINE_ACCESS => 1, self::SCOPE_OFFLINE_ACCESS => 1,
self::SCOPE_WHOAMI => 1, self::SCOPE_WHOAMI => 1,
); );
} }
static public function getDefaultScope() { public static function getDefaultScope() {
return self::SCOPE_WHOAMI; return self::SCOPE_WHOAMI;
} }
static public function getCheckboxControl( public static function getCheckboxControl(
array $current_scopes) { array $current_scopes) {
$have_options = false; $have_options = false;
@ -56,7 +56,7 @@ final class PhabricatorOAuthServerScope {
return null; return null;
} }
static private function getCheckboxLabel($scope) { private static function getCheckboxLabel($scope) {
$label = null; $label = null;
switch ($scope) { switch ($scope) {
case self::SCOPE_OFFLINE_ACCESS: case self::SCOPE_OFFLINE_ACCESS:
@ -70,7 +70,7 @@ final class PhabricatorOAuthServerScope {
return $label; return $label;
} }
static public function getScopesFromRequest(AphrontRequest $request) { public static function getScopesFromRequest(AphrontRequest $request) {
$scopes = self::getScopesDict(); $scopes = self::getScopesDict();
$requested_scopes = array(); $requested_scopes = array();
foreach ($scopes as $scope => $bit) { foreach ($scopes as $scope => $bit) {
@ -86,7 +86,7 @@ final class PhabricatorOAuthServerScope {
* A scopes list is considered valid if each scope is a known scope * A scopes list is considered valid if each scope is a known scope
* and each scope is seen only once. Otherwise, the list is invalid. * and each scope is seen only once. Otherwise, the list is invalid.
*/ */
static public function validateScopesList($scope_list) { public static function validateScopesList($scope_list) {
$scopes = explode(' ', $scope_list); $scopes = explode(' ', $scope_list);
$known_scopes = self::getScopesDict(); $known_scopes = self::getScopesDict();
$seen_scopes = array(); $seen_scopes = array();
@ -107,7 +107,7 @@ final class PhabricatorOAuthServerScope {
* A scopes dictionary is considered valid if each key is a known scope. * A scopes dictionary is considered valid if each key is a known scope.
* Otherwise, the dictionary is invalid. * Otherwise, the dictionary is invalid.
*/ */
static public function validateScopesDict($scope_dict) { public static function validateScopesDict($scope_dict) {
$known_scopes = self::getScopesDict(); $known_scopes = self::getScopesDict();
$unknown_scopes = array_diff_key($scope_dict, $unknown_scopes = array_diff_key($scope_dict,
$known_scopes); $known_scopes);
@ -119,7 +119,7 @@ final class PhabricatorOAuthServerScope {
* should be validated by @{method:validateScopesList} before * should be validated by @{method:validateScopesList} before
* transformation. * transformation.
*/ */
static public function scopesListToDict($scope_list) { public static function scopesListToDict($scope_list) {
$scopes = explode(' ', $scope_list); $scopes = explode(' ', $scope_list);
return array_fill_keys($scopes, 1); return array_fill_keys($scopes, 1);
} }

View file

@ -16,7 +16,7 @@ final class PhameBlog extends PhameDAO
protected $editPolicy; protected $editPolicy;
protected $joinPolicy; protected $joinPolicy;
static private $requestBlog; private static $requestBlog;
protected function getConfiguration() { protected function getConfiguration() {
return array( return array(
@ -175,7 +175,7 @@ final class PhameBlog extends PhameDAO
return $this->setConfigData($config); return $this->setConfigData($config);
} }
static public function getSkinOptionsForSelect() { public static function getSkinOptionsForSelect() {
$classes = id(new PhutilSymbolLoader()) $classes = id(new PhutilSymbolLoader())
->setAncestorClass('PhameBlogSkin') ->setAncestorClass('PhameBlogSkin')
->setType('class') ->setType('class')

View file

@ -34,7 +34,7 @@ final class ReleephSummaryFieldSpecification
public function renderHelpForArcanist() { public function renderHelpForArcanist() {
$text = pht( $text = pht(
"A one-line title summarizing this request. ". 'A one-line title summarizing this request. '.
'Leave blank to use the original commit title.')."\n"; 'Leave blank to use the original commit title.')."\n";
return phutil_console_wrap($text, 8); return phutil_console_wrap($text, 8);
} }

View file

@ -665,7 +665,7 @@ abstract class PhabricatorStorageManagementWorkflow
return 2; return 2;
} }
protected final function getBareHostAndPort($host) { final protected function getBareHostAndPort($host) {
// Split out port information, since the command-line client requires a // Split out port information, since the command-line client requires a
// separate flag for the port. // separate flag for the port.
$uri = new PhutilURI('mysql://'.$host); $uri = new PhutilURI('mysql://'.$host);

View file

@ -2,8 +2,8 @@
abstract class PhabricatorSQLPatchList { abstract class PhabricatorSQLPatchList {
public abstract function getNamespace(); abstract public function getNamespace();
public abstract function getPatches(); abstract public function getPatches();
/** /**
* Examine a directory for `.php` and `.sql` files and build patch * Examine a directory for `.php` and `.sql` files and build patch