From 956bfa701c3606155a6f2b2374b75d4a1f4380a0 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Mon, 15 Jun 2015 15:45:13 +1000 Subject: [PATCH] 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 --- src/__phutil_library_map__.php | 35 +++++++++++++++++++ src/configuration/ArcanistConfiguration.php | 2 +- .../ArcanistConfigurationManager.php | 2 +- src/configuration/ArcanistSettings.php | 2 +- src/difference/ArcanistDiffUtils.php | 2 +- .../ArcanistDifferentialCommitMessage.php | 2 +- .../ArcanistDifferentialRevisionHash.php | 2 +- .../ArcanistDifferentialRevisionStatus.php | 2 +- src/hgdaemon/ArcanistHgProxyClient.php | 2 +- src/hgdaemon/ArcanistHgProxyServer.php | 2 +- src/lint/ArcanistLintMessage.php | 2 +- src/lint/ArcanistLintPatcher.php | 2 +- src/lint/ArcanistLintResult.php | 2 +- src/lint/ArcanistLintSeverity.php | 2 +- src/lint/engine/ArcanistLintEngine.php | 2 +- src/lint/linter/ArcanistLinter.php | 2 +- .../xhpast/ArcanistXHPASTLintNamingHook.php | 2 +- .../xhpast/ArcanistXHPASTLintSwitchHook.php | 2 +- .../xhpast/ArcanistXHPASTLinterRule.php | 2 +- src/lint/renderer/ArcanistLintRenderer.php | 2 +- src/parser/ArcanistBaseCommitParser.php | 2 +- src/parser/ArcanistBundle.php | 2 +- src/parser/ArcanistCommentRemover.php | 2 +- src/parser/ArcanistDiffParser.php | 2 +- src/parser/diff/ArcanistDiffChange.php | 2 +- src/parser/diff/ArcanistDiffChangeType.php | 2 +- src/parser/diff/ArcanistDiffHunk.php | 2 +- src/repository/api/ArcanistRepositoryAPI.php | 2 +- .../parser/ArcanistMercurialParser.php | 2 +- src/unit/ArcanistUnitTestResult.php | 2 +- src/unit/engine/ArcanistUnitTestEngine.php | 3 +- src/unit/engine/phutil/PhutilTestCase.php | 2 +- src/unit/parser/ArcanistTestResultParser.php | 2 +- .../parser/ArcanistXUnitTestResultParser.php | 2 +- src/unit/renderer/ArcanistUnitRenderer.php | 2 +- .../ArcanistWorkingCopyIdentity.php | 2 +- 36 files changed, 71 insertions(+), 35 deletions(-) diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index a1bd6920..6c4fe32c 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -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', diff --git a/src/configuration/ArcanistConfiguration.php b/src/configuration/ArcanistConfiguration.php index 5755cc5e..71152587 100644 --- a/src/configuration/ArcanistConfiguration.php +++ b/src/configuration/ArcanistConfiguration.php @@ -19,7 +19,7 @@ * * @concrete-extensible */ -class ArcanistConfiguration { +class ArcanistConfiguration extends Phobject { public function buildWorkflow($command) { if ($command == '--help') { diff --git a/src/configuration/ArcanistConfigurationManager.php b/src/configuration/ArcanistConfigurationManager.php index 6195a1ec..d2284742 100644 --- a/src/configuration/ArcanistConfigurationManager.php +++ b/src/configuration/ArcanistConfigurationManager.php @@ -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; diff --git a/src/configuration/ArcanistSettings.php b/src/configuration/ArcanistSettings.php index cd5f8f01..d7314c1d 100644 --- a/src/configuration/ArcanistSettings.php +++ b/src/configuration/ArcanistSettings.php @@ -1,6 +1,6 @@