1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 16:22:42 +01:00

Extend from Phobject

Summary: All base classes should extend from `Phobject` or some other classes. See D13275 for some explanation.

Test Plan: `arc unit`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D13281
This commit is contained in:
Joshua Spence 2015-06-15 15:45:13 +10:00
parent ac8367a884
commit 956bfa701c
36 changed files with 71 additions and 35 deletions

View file

@ -288,6 +288,7 @@ phutil_register_library_map(array(
'ArcanistArrayIndexSpacingXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
'ArcanistArraySeparatorXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
'ArcanistBackoutWorkflow' => 'ArcanistWorkflow',
'ArcanistBaseCommitParser' => 'Phobject',
'ArcanistBaseCommitParserTestCase' => 'PhutilTestCase',
'ArcanistBaseXHPASTLinter' => 'ArcanistFutureLinter',
'ArcanistBinaryExpressionSpacingXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
@ -297,6 +298,7 @@ phutil_register_library_map(array(
'ArcanistBranchWorkflow' => 'ArcanistFeatureWorkflow',
'ArcanistBritishTestCase' => 'PhutilTestCase',
'ArcanistBrowseWorkflow' => 'ArcanistWorkflow',
'ArcanistBundle' => 'Phobject',
'ArcanistBundleTestCase' => 'PhutilTestCase',
'ArcanistCSSLintLinter' => 'ArcanistExternalLinter',
'ArcanistCSSLintLinterTestCase' => 'ArcanistExternalLinterTestCase',
@ -318,6 +320,7 @@ phutil_register_library_map(array(
'ArcanistClosureLinterTestCase' => 'ArcanistExternalLinterTestCase',
'ArcanistCoffeeLintLinter' => 'ArcanistExternalLinter',
'ArcanistCoffeeLintLinterTestCase' => 'ArcanistExternalLinterTestCase',
'ArcanistCommentRemover' => 'Phobject',
'ArcanistCommentRemoverTestCase' => 'PhutilTestCase',
'ArcanistCommentSpacingXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
'ArcanistCommentStyleXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
@ -325,7 +328,9 @@ phutil_register_library_map(array(
'ArcanistCompilerLintRenderer' => 'ArcanistLintRenderer',
'ArcanistComprehensiveLintEngine' => 'ArcanistLintEngine',
'ArcanistConcatenationOperatorXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
'ArcanistConfiguration' => 'Phobject',
'ArcanistConfigurationDrivenLintEngine' => 'ArcanistLintEngine',
'ArcanistConfigurationManager' => 'Phobject',
'ArcanistConsoleLintRenderer' => 'ArcanistLintRenderer',
'ArcanistConstructorParenthesesXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
'ArcanistControlStatementSpacingXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
@ -335,11 +340,19 @@ phutil_register_library_map(array(
'ArcanistCpplintLinter' => 'ArcanistExternalLinter',
'ArcanistCpplintLinterTestCase' => 'ArcanistExternalLinterTestCase',
'ArcanistDefaultParametersXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
'ArcanistDiffChange' => 'Phobject',
'ArcanistDiffChangeType' => 'Phobject',
'ArcanistDiffHunk' => 'Phobject',
'ArcanistDiffParser' => 'Phobject',
'ArcanistDiffParserTestCase' => 'PhutilTestCase',
'ArcanistDiffUtils' => 'Phobject',
'ArcanistDiffUtilsTestCase' => 'PhutilTestCase',
'ArcanistDiffWorkflow' => 'ArcanistWorkflow',
'ArcanistDifferentialCommitMessage' => 'Phobject',
'ArcanistDifferentialCommitMessageParserException' => 'Exception',
'ArcanistDifferentialDependencyGraph' => 'AbstractDirectedGraph',
'ArcanistDifferentialRevisionHash' => 'Phobject',
'ArcanistDifferentialRevisionStatus' => 'Phobject',
'ArcanistDoubleQuoteXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
'ArcanistDownloadWorkflow' => 'ArcanistWorkflow',
'ArcanistDuplicateKeysInArrayXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
@ -375,6 +388,8 @@ phutil_register_library_map(array(
'ArcanistHLintLinterTestCase' => 'ArcanistExternalLinterTestCase',
'ArcanistHelpWorkflow' => 'ArcanistWorkflow',
'ArcanistHgClientChannel' => 'PhutilProtocolChannel',
'ArcanistHgProxyClient' => 'Phobject',
'ArcanistHgProxyServer' => 'Phobject',
'ArcanistHgServerChannel' => 'PhutilProtocolChannel',
'ArcanistImplicitConstructorXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
'ArcanistImplicitFallthroughXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
@ -401,13 +416,21 @@ phutil_register_library_map(array(
'ArcanistLesscLinterTestCase' => 'ArcanistExternalLinterTestCase',
'ArcanistLiberateWorkflow' => 'ArcanistWorkflow',
'ArcanistLibraryTestCase' => 'PhutilLibraryTestCase',
'ArcanistLintEngine' => 'Phobject',
'ArcanistLintMessage' => 'Phobject',
'ArcanistLintPatcher' => 'Phobject',
'ArcanistLintRenderer' => 'Phobject',
'ArcanistLintResult' => 'Phobject',
'ArcanistLintSeverity' => 'Phobject',
'ArcanistLintWorkflow' => 'ArcanistWorkflow',
'ArcanistLinter' => 'Phobject',
'ArcanistLinterTestCase' => 'PhutilTestCase',
'ArcanistLintersWorkflow' => 'ArcanistWorkflow',
'ArcanistListWorkflow' => 'ArcanistWorkflow',
'ArcanistLogicalOperatorsXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
'ArcanistLowercaseFunctionsXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
'ArcanistMercurialAPI' => 'ArcanistRepositoryAPI',
'ArcanistMercurialParser' => 'Phobject',
'ArcanistMercurialParserTestCase' => 'PhutilTestCase',
'ArcanistMergeConflictLinter' => 'ArcanistLinter',
'ArcanistMergeConflictLinterTestCase' => 'ArcanistLinterTestCase',
@ -447,6 +470,7 @@ phutil_register_library_map(array(
'ArcanistPyFlakesLinterTestCase' => 'ArcanistExternalLinterTestCase',
'ArcanistPyLintLinter' => 'ArcanistExternalLinter',
'ArcanistPyLintLinterTestCase' => 'ArcanistExternalLinterTestCase',
'ArcanistRepositoryAPI' => 'Phobject',
'ArcanistRepositoryAPIMiscTestCase' => 'PhutilTestCase',
'ArcanistRepositoryAPIStateTestCase' => 'PhutilTestCase',
'ArcanistReusedAsIteratorXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
@ -461,6 +485,7 @@ phutil_register_library_map(array(
'ArcanistSelfMemberReferenceXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
'ArcanistSemicolonSpacingXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
'ArcanistSetConfigWorkflow' => 'ArcanistWorkflow',
'ArcanistSettings' => 'Phobject',
'ArcanistShellCompleteWorkflow' => 'ArcanistWorkflow',
'ArcanistSingleLintEngine' => 'ArcanistLintEngine',
'ArcanistSlownessXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
@ -474,6 +499,7 @@ phutil_register_library_map(array(
'ArcanistSyntaxErrorXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
'ArcanistTasksWorkflow' => 'ArcanistWorkflow',
'ArcanistTautologicalExpressionXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
'ArcanistTestResultParser' => 'Phobject',
'ArcanistTestXHPASTLintSwitchHook' => 'ArcanistXHPASTLintSwitchHook',
'ArcanistTextLinter' => 'ArcanistLinter',
'ArcanistTextLinterTestCase' => 'ArcanistLinterTestCase',
@ -485,6 +511,9 @@ phutil_register_library_map(array(
'ArcanistUnableToParseXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
'ArcanistUndeclaredVariableXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
'ArcanistUnitConsoleRenderer' => 'ArcanistUnitRenderer',
'ArcanistUnitRenderer' => 'Phobject',
'ArcanistUnitTestEngine' => 'Phobject',
'ArcanistUnitTestResult' => 'Phobject',
'ArcanistUnitTestableLintEngine' => 'ArcanistLintEngine',
'ArcanistUnitWorkflow' => 'ArcanistWorkflow',
'ArcanistUnnecessaryFinalModifierXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
@ -498,15 +527,21 @@ phutil_register_library_map(array(
'ArcanistVersionWorkflow' => 'ArcanistWorkflow',
'ArcanistWhichWorkflow' => 'ArcanistWorkflow',
'ArcanistWorkflow' => 'Phobject',
'ArcanistWorkingCopyIdentity' => 'Phobject',
'ArcanistXHPASTLintNamingHook' => 'Phobject',
'ArcanistXHPASTLintNamingHookTestCase' => 'PhutilTestCase',
'ArcanistXHPASTLintSwitchHook' => 'Phobject',
'ArcanistXHPASTLinter' => 'ArcanistBaseXHPASTLinter',
'ArcanistXHPASTLinterRule' => 'Phobject',
'ArcanistXHPASTLinterTestCase' => 'ArcanistLinterTestCase',
'ArcanistXMLLinter' => 'ArcanistLinter',
'ArcanistXMLLinterTestCase' => 'ArcanistLinterTestCase',
'ArcanistXUnitTestResultParser' => 'Phobject',
'CSharpToolsTestEngine' => 'XUnitTestEngine',
'NoseTestEngine' => 'ArcanistUnitTestEngine',
'PhpunitTestEngine' => 'ArcanistUnitTestEngine',
'PhpunitTestEngineTestCase' => 'PhutilTestCase',
'PhutilTestCase' => 'Phobject',
'PhutilTestCaseTestCase' => 'PhutilTestCase',
'PhutilTestSkippedException' => 'Exception',
'PhutilTestTerminatedException' => 'Exception',

View file

@ -19,7 +19,7 @@
*
* @concrete-extensible
*/
class ArcanistConfiguration {
class ArcanistConfiguration extends Phobject {
public function buildWorkflow($command) {
if ($command == '--help') {

View file

@ -3,7 +3,7 @@
/**
* This class holds everything related to configuration and configuration files.
*/
final class ArcanistConfigurationManager {
final class ArcanistConfigurationManager extends Phobject {
private $runtimeConfig = array();
private $workingCopy = null;

View file

@ -1,6 +1,6 @@
<?php
final class ArcanistSettings {
final class ArcanistSettings extends Phobject {
private function getOptions() {
return array(

View file

@ -3,7 +3,7 @@
/**
* Dumping ground for diff- and diff-algorithm-related miscellany.
*/
final class ArcanistDiffUtils {
final class ArcanistDiffUtils extends Phobject {
/**
* Make a best-effort attempt to determine if a file is definitely binary.

View file

@ -3,7 +3,7 @@
/**
* Represents a parsed commit message.
*/
final class ArcanistDifferentialCommitMessage {
final class ArcanistDifferentialCommitMessage extends Phobject {
private $rawCorpus;
private $revisionID;

View file

@ -1,6 +1,6 @@
<?php
final class ArcanistDifferentialRevisionHash {
final class ArcanistDifferentialRevisionHash extends Phobject {
const TABLE_NAME = 'differential_revisionhash';

View file

@ -1,6 +1,6 @@
<?php
final class ArcanistDifferentialRevisionStatus {
final class ArcanistDifferentialRevisionStatus extends Phobject {
const NEEDS_REVIEW = 0;
const NEEDS_REVISION = 1;

View file

@ -26,7 +26,7 @@
* @task exec Executing Mercurial Commands
* @task internal Internals
*/
final class ArcanistHgProxyClient {
final class ArcanistHgProxyClient extends Phobject {
private $workingCopy;
private $server;

View file

@ -26,7 +26,7 @@
* @task hg Managing Mercurial
* @task internal Internals
*/
final class ArcanistHgProxyServer {
final class ArcanistHgProxyServer extends Phobject {
private $workingCopy;
private $socket;

View file

@ -3,7 +3,7 @@
/**
* Message emitted by a linter, like an error or warning.
*/
final class ArcanistLintMessage {
final class ArcanistLintMessage extends Phobject {
protected $path;
protected $line;

View file

@ -3,7 +3,7 @@
/**
* Applies lint patches to the working copy.
*/
final class ArcanistLintPatcher {
final class ArcanistLintPatcher extends Phobject {
private $dirtyUntil = 0;
private $characterDelta = 0;

View file

@ -3,7 +3,7 @@
/**
* A group of @{class:ArcanistLintMessage}s that apply to a file.
*/
final class ArcanistLintResult {
final class ArcanistLintResult extends Phobject {
protected $path;
protected $data;

View file

@ -3,7 +3,7 @@
/**
* Describes the severity of an @{class:ArcanistLintMessage}.
*/
final class ArcanistLintSeverity {
final class ArcanistLintSeverity extends Phobject {
const SEVERITY_ADVICE = 'advice';
const SEVERITY_AUTOFIX = 'autofix';

View file

@ -39,7 +39,7 @@
* See @{article@phabricator:Arcanist User Guide: Customizing Lint, Unit Tests
* and Workflows} for more information about configuring lint engines.
*/
abstract class ArcanistLintEngine {
abstract class ArcanistLintEngine extends Phobject {
protected $workingCopy;
protected $paths = array();

View file

@ -7,7 +7,7 @@
* @task state Runtime State
* @task exec Executing Linters
*/
abstract class ArcanistLinter {
abstract class ArcanistLinter extends Phobject {
const GRANULARITY_FILE = 1;
const GRANULARITY_DIRECTORY = 2;

View file

@ -8,7 +8,7 @@
* @task util Name Utilities
* @task internal Internals
*/
abstract class ArcanistXHPASTLintNamingHook {
abstract class ArcanistXHPASTLintNamingHook extends Phobject {
/* -( Internals )---------------------------------------------------------- */

View file

@ -4,7 +4,7 @@
* You can extend this class and set `xhpast.switchhook` in your `.arclint`
* to have an opportunity to override results for linting `switch` statements.
*/
abstract class ArcanistXHPASTLintSwitchHook {
abstract class ArcanistXHPASTLintSwitchHook extends Phobject {
/**
* @return bool True if token safely ends the block.

View file

@ -1,6 +1,6 @@
<?php
abstract class ArcanistXHPASTLinterRule {
abstract class ArcanistXHPASTLinterRule extends Phobject {
private $linter = null;

View file

@ -3,7 +3,7 @@
/**
* Shows lint messages to the user.
*/
abstract class ArcanistLintRenderer {
abstract class ArcanistLintRenderer extends Phobject {
public function renderPreamble() {
return '';

View file

@ -1,6 +1,6 @@
<?php
final class ArcanistBaseCommitParser {
final class ArcanistBaseCommitParser extends Phobject {
private $api;
private $try;

View file

@ -3,7 +3,7 @@
/**
* Converts changesets between different formats.
*/
final class ArcanistBundle {
final class ArcanistBundle extends Phobject {
private $changes;
private $conduit;

View file

@ -1,6 +1,6 @@
<?php
final class ArcanistCommentRemover {
final class ArcanistCommentRemover extends Phobject {
/**
* Remove comment lines from a commit message. Strips trailing lines only,

View file

@ -3,7 +3,7 @@
/**
* Parses diffs from a working copy.
*/
final class ArcanistDiffParser {
final class ArcanistDiffParser extends Phobject {
protected $repositoryAPI;
protected $text;

View file

@ -3,7 +3,7 @@
/**
* Represents a change to an individual path.
*/
final class ArcanistDiffChange {
final class ArcanistDiffChange extends Phobject {
protected $metadata = array();

View file

@ -3,7 +3,7 @@
/**
* Defines constants for file types and operations in changesets.
*/
final class ArcanistDiffChangeType {
final class ArcanistDiffChangeType extends Phobject {
const TYPE_ADD = 1;
const TYPE_CHANGE = 2;

View file

@ -3,7 +3,7 @@
/**
* Represents a contiguous set of added and removed lines in a diff.
*/
final class ArcanistDiffHunk {
final class ArcanistDiffHunk extends Phobject {
protected $oldOffset;
protected $oldLength;

View file

@ -5,7 +5,7 @@
*
* @task status Path Status
*/
abstract class ArcanistRepositoryAPI {
abstract class ArcanistRepositoryAPI extends Phobject {
const FLAG_MODIFIED = 1;
const FLAG_ADDED = 2;

View file

@ -6,7 +6,7 @@
*
* @task parse Parsing "hg" Output
*/
final class ArcanistMercurialParser {
final class ArcanistMercurialParser extends Phobject {
/* -( Parsing "hg" Output )------------------------------------------------ */

View file

@ -3,7 +3,7 @@
/**
* Represents the outcome of running a unit test.
*/
final class ArcanistUnitTestResult {
final class ArcanistUnitTestResult extends Phobject {
const RESULT_PASS = 'pass';
const RESULT_FAIL = 'fail';

View file

@ -3,7 +3,7 @@
/**
* Manages unit test execution.
*/
abstract class ArcanistUnitTestEngine {
abstract class ArcanistUnitTestEngine extends Phobject {
private $workingCopy;
private $paths;
@ -11,6 +11,7 @@ abstract class ArcanistUnitTestEngine {
private $enableAsyncTests;
private $enableCoverage;
private $runAllTests;
private $configurationManager;
protected $renderer;
final public function __construct() {}

View file

@ -8,7 +8,7 @@
* @task hook Hooks for Setup and Teardown
* @task internal Internals
*/
abstract class PhutilTestCase {
abstract class PhutilTestCase extends Phobject {
private $assertions = 0;
private $runningTest;

View file

@ -3,7 +3,7 @@
/**
* Abstract base class for test result parsers.
*/
abstract class ArcanistTestResultParser {
abstract class ArcanistTestResultParser extends Phobject {
protected $enableCoverage;
protected $projectRoot;

View file

@ -3,7 +3,7 @@
/**
* Parser for JUnit, NUnit, etc results format
*/
final class ArcanistXUnitTestResultParser {
final class ArcanistXUnitTestResultParser extends Phobject {
/**
* Parse test results from provided input and return an array

View file

@ -1,6 +1,6 @@
<?php
abstract class ArcanistUnitRenderer {
abstract class ArcanistUnitRenderer extends Phobject {
abstract public function renderUnitResult(ArcanistUnitTestResult $result);
abstract public function renderPostponedResult($count);
}

View file

@ -5,7 +5,7 @@
*
* @task config
*/
final class ArcanistWorkingCopyIdentity {
final class ArcanistWorkingCopyIdentity extends Phobject {
private $projectConfig;
private $projectRoot;