From 0a62f13464b843e3fd966689874c7aec878c7efb Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Mon, 9 Jun 2014 11:36:49 -0700 Subject: [PATCH] Change double quotes to single quotes. Summary: Ran `arc lint --apply-patches --everything` over rP, mainly to change double quotes to single quotes where appropriate. These changes also validate that the `ArcanistXHPASTLinter::LINT_DOUBLE_QUOTE` rule is working as expected. Test Plan: Eyeballed it. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, Korvin, hach-que Differential Revision: https://secure.phabricator.com/D9431 --- resources/sql/patches/059.engines.php | 2 +- resources/sql/patches/079.nametokenindex.php | 4 +- .../patches/090.forceuniqueprojectnames.php | 6 +- resources/sql/patches/102.heraldcleanup.php | 4 +- .../sql/patches/117.repositorydescription.php | 2 +- .../sql/patches/131.migraterevisionquery.php | 4 +- .../sql/patches/20121209.xmacromigrate.php | 4 +- .../patches/20130201.revisionunsubscribed.php | 2 +- resources/sql/patches/20130409.commitdrev.php | 4 +- .../sql/patches/20130502.countdownrevamp2.php | 4 +- .../patches/20130703.legalpaddocdenorm.php | 2 +- .../patches/20130711.pholioimageobsolete.php | 4 +- .../patches/20131205.buildstepordermig.php | 12 +-- scripts/calendar/import_us_holidays.php | 64 +++++++------- scripts/mail/mail_handler.php | 6 +- scripts/repository/rebuild_summaries.php | 4 +- scripts/repository/reparse.php | 12 +-- scripts/repository/save_lint.php | 12 +-- scripts/ssh/ssh-auth.php | 2 +- scripts/ssh/ssh-exec.php | 14 +-- scripts/symbols/generate_ctags_symbols.php | 10 +-- scripts/user/account_admin.php | 14 +-- scripts/user/add_user.php | 4 +- src/aphront/AphrontRequest.php | 2 +- .../AphrontApplicationConfiguration.php | 4 +- src/aphront/response/AphrontProxyResponse.php | 2 +- src/aphront/sink/AphrontHTTPSink.php | 2 +- .../__tests__/AphrontHTTPSinkTestCase.php | 4 +- ...ConduitAPI_arcanist_projectinfo_Method.php | 2 +- .../conduit/ConduitAPI_audit_query_Method.php | 2 +- .../editor/PhabricatorAuditCommentEditor.php | 4 +- .../mail/PhabricatorAuditReplyHandler.php | 4 +- ...abricatorAuditManagementDeleteWorkflow.php | 8 +- .../PhabricatorAuthConfirmLinkController.php | 4 +- .../PhabricatorAuthLoginController.php | 4 +- .../PhabricatorAuthRegisterController.php | 6 +- .../PhabricatorAuthStartController.php | 16 ++-- .../PhabricatorAuthUnlinkController.php | 14 +-- .../PhabricatorAuthValidateController.php | 4 +- .../PhabricatorEmailLoginController.php | 8 +- .../config/PhabricatorAuthEditController.php | 4 +- .../PhabricatorAuthManagementLDAPWorkflow.php | 12 +-- ...abricatorAuthManagementRefreshWorkflow.php | 20 ++--- ...PhabricatorAuthManagementStripWorkflow.php | 2 +- .../auth/provider/PhabricatorAuthProvider.php | 8 +- .../provider/PhabricatorAuthProviderLDAP.php | 26 +++--- .../PhabricatorAuthProviderOAuth2.php | 2 +- .../PhabricatorAuthProviderPersona.php | 4 +- ...abricatorAuthProviderConfigTransaction.php | 2 +- .../base/controller/PhabricatorController.php | 4 +- .../PhabricatorAccessControlTestCase.php | 20 ++--- .../PhabricatorKeyValueDatabaseCache.php | 4 +- ...habricatorCacheManagementPurgeWorkflow.php | 6 +- .../view/AphrontCalendarEventView.php | 2 +- .../ConduitAPI_chatlog_query_Method.php | 2 +- .../ConduitAPI_chatlog_record_Method.php | 2 +- ...PhabricatorChatLogChannelLogController.php | 8 +- src/applications/conduit/call/ConduitCall.php | 10 +-- .../call/__tests__/ConduitCallTestCase.php | 2 +- .../PhabricatorConduitConfigOptions.php | 8 +- .../PhabricatorConduitAPIController.php | 2 +- .../ConduitAPI_conduit_connect_Method.php | 42 ++++----- ...nduitAPI_conduit_getcertificate_Method.php | 12 +-- .../method/ConduitAPI_conduit_ping_Method.php | 2 +- .../ConduitAPI_conduit_query_Method.php | 6 +- .../conduit/protocol/ConduitAPIRequest.php | 6 +- .../conduit/ssh/ConduitSSHWorkflow.php | 6 +- .../config/check/PhabricatorSetupCheckAPC.php | 2 +- .../check/PhabricatorSetupCheckBaseURI.php | 2 +- .../PhabricatorSetupCheckExtraConfig.php | 6 +- .../check/PhabricatorSetupCheckMail.php | 6 +- .../check/PhabricatorSetupCheckMySQL.php | 6 +- .../check/PhabricatorSetupCheckPath.php | 4 +- .../PhabricatorSetupCheckRepositories.php | 4 +- .../check/PhabricatorSetupCheckTimezone.php | 4 +- .../PhabricatorConfigEditController.php | 12 +-- .../PhabricatorConfigIgnoreController.php | 4 +- .../PhabricatorConfigIssueListController.php | 2 +- ...bricatorConfigManagementDeleteWorkflow.php | 4 +- ...PhabricatorConfigManagementGetWorkflow.php | 4 +- ...PhabricatorConfigManagementSetWorkflow.php | 4 +- .../option/PhabricatorAWSConfigOptions.php | 4 +- .../PhabricatorAccessLogConfigOptions.php | 54 ++++++------ ...PhabricatorAuthenticationConfigOptions.php | 46 +++++----- .../config/option/PhabricatorConfigOption.php | 2 +- .../option/PhabricatorCoreConfigOptions.php | 50 +++++------ .../PhabricatorDeveloperConfigOptions.php | 66 +++++++------- .../option/PhabricatorDisqusConfigOptions.php | 6 +- ...catorExtendingPhabricatorConfigOptions.php | 18 ++-- ...abricatorGarbageCollectorConfigOptions.php | 4 +- .../PhabricatorMailgunConfigOptions.php | 4 +- .../PhabricatorMetaMTAConfigOptions.php | 24 ++--- .../option/PhabricatorMySQLConfigOptions.php | 30 +++---- .../PhabricatorNotificationConfigOptions.php | 16 ++-- .../option/PhabricatorPHDConfigOptions.php | 28 +++--- .../PhabricatorPHPMailerConfigOptions.php | 6 +- .../PhabricatorRecaptchaConfigOptions.php | 14 +-- .../PhabricatorSecurityConfigOptions.php | 66 +++++++------- .../PhabricatorSendGridConfigOptions.php | 4 +- ...ricatorSyntaxHighlightingConfigOptions.php | 44 +++++----- .../PhabricatorTranslationsConfigOptions.php | 12 +-- .../option/PhabricatorUIConfigOptions.php | 4 +- .../response/PhabricatorConfigResponse.php | 4 +- .../config/view/PhabricatorSetupIssueView.php | 36 ++++---- .../mail/ConpherenceReplyHandler.php | 2 +- .../conpherence/storage/ConpherenceThread.php | 2 +- .../view/PhabricatorCountdownView.php | 2 +- .../PhabricatorWorkerTaskDetailController.php | 2 +- ...habricatorDaemonManagementListWorkflow.php | 2 +- ...bricatorDaemonManagementStatusWorkflow.php | 2 +- .../PhabricatorDaemonManagementWorkflow.php | 6 +- .../view/PhabricatorDaemonLogEventsView.php | 6 +- .../view/PhabricatorDaemonLogListView.php | 4 +- .../ConduitAPI_differential_close_Method.php | 2 +- ...tAPI_differential_createcomment_Method.php | 2 +- ...duitAPI_differential_creatediff_Method.php | 2 +- ...itAPI_differential_createinline_Method.php | 2 +- ...tAPI_differential_createrawdiff_Method.php | 2 +- ...API_differential_createrevision_Method.php | 2 +- .../ConduitAPI_differential_find_Method.php | 2 +- ...erential_finishpostponedlinters_Method.php | 4 +- ...uitAPI_differential_getalldiffs_Method.php | 2 +- ...I_differential_getcommitmessage_Method.php | 4 +- ...API_differential_getcommitpaths_Method.php | 4 +- ...duitAPI_differential_getrawdiff_Method.php | 2 +- ...uitAPI_differential_getrevision_Method.php | 2 +- ...ifferential_getrevisioncomments_Method.php | 2 +- ...differential_parsecommitmessage_Method.php | 2 +- .../ConduitAPI_differential_query_Method.php | 2 +- ...PI_differential_setdiffproperty_Method.php | 2 +- ...API_differential_updaterevision_Method.php | 2 +- ..._differential_updateunitresults_Method.php | 2 +- .../PhabricatorDifferentialConfigOptions.php | 88 +++++++++---------- .../DifferentialDiffCreateController.php | 6 +- ...ifferentialInlineCommentEditController.php | 6 +- .../DifferentialRevisionEditController.php | 2 +- .../DifferentialRevisionLandController.php | 14 +-- .../DifferentialRevisionViewController.php | 2 +- .../DifferentialJIRAIssuesField.php | 4 +- .../customfield/DifferentialLintField.php | 6 +- .../customfield/DifferentialTitleField.php | 4 +- .../customfield/DifferentialUnitField.php | 2 +- .../editor/DifferentialTransactionEditor.php | 60 ++++++------- .../landing/DifferentialLandingStrategy.php | 4 +- .../landing/DifferentialLandingToGitHub.php | 4 +- .../DifferentialLandingToHostedGit.php | 4 +- .../DifferentialLandingToHostedMercurial.php | 2 +- .../mail/DifferentialReplyHandler.php | 4 +- .../parser/DifferentialChangesetParser.php | 4 +- .../parser/DifferentialHunkParser.php | 54 ++++++------ ...entialCustomFieldRevertsParserTestCase.php | 6 +- .../DifferentialHunkParserTestCase.php | 8 +- .../query/DifferentialRevisionQuery.php | 2 +- .../DifferentialChangesetOneUpRenderer.php | 2 +- .../DifferentialChangesetTestRenderer.php | 2 +- .../DifferentialChangesetTwoUpRenderer.php | 4 +- .../storage/DifferentialReviewer.php | 2 +- .../__tests__/DifferentialHunkTestCase.php | 4 +- .../DifferentialDiffTableOfContentsView.php | 3 +- .../DifferentialInlineCommentEditView.php | 4 +- .../view/DifferentialLocalCommitsView.php | 2 +- .../view/DifferentialRevisionListView.php | 2 +- .../view/DifferentialTransactionView.php | 8 +- ...onduitAPI_diffusion_existsquery_Method.php | 2 +- ...onduitAPI_diffusion_findsymbols_Method.php | 2 +- ...itAPI_diffusion_getlintmessages_Method.php | 2 +- ...iffusion_getrecentcommitsbypath_Method.php | 2 +- ...nduitAPI_diffusion_historyquery_Method.php | 2 +- .../PhabricatorDiffusionConfigOptions.php | 8 +- .../DiffusionBrowseFileController.php | 14 +-- .../controller/DiffusionCommitController.php | 6 +- .../controller/DiffusionController.php | 4 +- .../DiffusionExternalController.php | 6 +- .../DiffusionInlineCommentController.php | 6 +- .../DiffusionRepositoryController.php | 4 +- .../DiffusionRepositoryCreateController.php | 12 +-- .../controller/DiffusionServeController.php | 8 +- .../controller/DiffusionSymbolController.php | 2 +- .../diffusion/data/DiffusionRepositoryTag.php | 2 +- .../engine/DiffusionCommitHookEngine.php | 4 +- .../diffusion/query/DiffusionCommitQuery.php | 2 +- .../query/DiffusionLintCountQuery.php | 4 +- .../diffusion/query/DiffusionQuery.php | 2 +- .../diffusion/query/DiffusionSymbolQuery.php | 4 +- .../filecontent/DiffusionFileContentQuery.php | 2 +- .../DiffusionSvnFileContentQuery.php | 6 +- .../lowlevel/DiffusionLowLevelGitRefQuery.php | 6 +- .../query/lowlevel/DiffusionLowLevelQuery.php | 2 +- .../DiffusionLowLevelResolveRefsQuery.php | 4 +- .../rawdiff/DiffusionGitRawDiffQuery.php | 2 +- .../diffusion/request/DiffusionGitRequest.php | 2 +- .../request/DiffusionMercurialRequest.php | 2 +- .../diffusion/request/DiffusionRequest.php | 4 +- .../DiffusionSSHMercurialServeWorkflow.php | 4 +- .../DiffusionSSHSubversionServeWorkflow.php | 2 +- .../diffusion/ssh/DiffusionSSHWorkflow.php | 4 +- .../diffusion/view/DiffusionCommentView.php | 6 +- .../view/DiffusionEmptyResultView.php | 6 +- src/applications/diviner/atom/DivinerAtom.php | 10 +-- .../atomizer/DivinerArticleAtomizer.php | 2 +- .../diviner/publisher/DivinerPublisher.php | 4 +- .../workflow/DivinerAtomizeWorkflow.php | 6 +- .../workflow/DivinerGenerateWorkflow.php | 6 +- .../diviner/workflow/DivinerWorkflow.php | 2 +- .../doorkeeper/engine/DoorkeeperObjectRef.php | 2 +- .../option/PhabricatorAsanaConfigOptions.php | 12 +-- .../worker/DoorkeeperFeedWorkerAsana.php | 2 +- .../DrydockBlueprintImplementation.php | 6 +- ...rydockLocalHostBlueprintImplementation.php | 4 +- ...dockWorkingCopyBlueprintImplementation.php | 2 +- .../command/DrydockSSHCommandInterface.php | 2 +- .../DrydockSFTPFilesystemInterface.php | 6 +- .../DrydockManagementCloseWorkflow.php | 2 +- ...rydockManagementCreateResourceWorkflow.php | 6 +- .../DrydockManagementLeaseWorkflow.php | 2 +- .../DrydockManagementReleaseWorkflow.php | 2 +- .../drydock/storage/DrydockLease.php | 14 +-- .../drydock/worker/DrydockAllocatorWorker.php | 4 +- .../PhabricatorFactChartController.php | 2 +- .../fact/daemon/PhabricatorFactDaemon.php | 4 +- ...abricatorFactManagementCursorsWorkflow.php | 6 +- .../feed/PhabricatorFeedStoryPublisher.php | 4 +- .../ConduitAPI_feed_publish_Method.php | 2 +- .../conduit/ConduitAPI_feed_query_Method.php | 2 +- ...ricatorFeedManagementRepublishWorkflow.php | 8 +- .../feed/story/PhabricatorFeedStory.php | 2 +- .../story/PhabricatorFeedStoryAggregate.php | 2 +- .../feed/story/PhabricatorFeedStoryCommit.php | 4 +- .../files/PhabricatorImageTransformer.php | 10 +-- .../ConduitAPI_file_download_Method.php | 2 +- .../conduit/ConduitAPI_file_info_Method.php | 2 +- .../conduit/ConduitAPI_file_upload_Method.php | 2 +- .../ConduitAPI_file_uploadhash_Method.php | 2 +- .../config/PhabricatorFilesConfigOptions.php | 22 ++--- .../PhabricatorFileInfoController.php | 2 +- .../PhabricatorFileTransformController.php | 2 +- ...icatorDefaultFileStorageEngineSelector.php | 8 +- .../PhabricatorFileUploadException.php | 14 +-- ...bricatorFilesManagementEnginesWorkflow.php | 2 +- ...bricatorFilesManagementMigrateWorkflow.php | 8 +- ...habricatorFilesManagementPurgeWorkflow.php | 4 +- ...bricatorFilesManagementRebuildWorkflow.php | 6 +- .../PhabricatorFilesManagementWorkflow.php | 2 +- .../files/storage/PhabricatorFile.php | 24 ++--- .../conduit/ConduitAPI_flag_delete_Method.php | 4 +- .../conduit/ConduitAPI_flag_edit_Method.php | 2 +- .../conduit/ConduitAPI_flag_query_Method.php | 2 +- .../PhabricatorFlagEditController.php | 6 +- .../HarbormasterBuildViewController.php | 2 +- .../HarbormasterBuildableViewController.php | 2 +- .../HarbormasterPlanEditController.php | 2 +- .../HarbormasterPlanViewController.php | 12 +-- .../HarbormasterStepDeleteController.php | 2 +- ...ormasterCommandBuildStepImplementation.php | 4 +- ...PublishFragmentBuildStepImplementation.php | 2 +- ...WaitForPreviousBuildStepImplementation.php | 4 +- .../storage/build/HarbormasterBuild.php | 2 +- .../build/HarbormasterBuildArtifact.php | 16 ++-- .../storage/build/HarbormasterBuildLog.php | 16 ++-- .../herald/adapter/HeraldAdapter.php | 22 ++--- .../herald/adapter/HeraldCommitAdapter.php | 2 +- .../controller/HeraldRuleController.php | 18 ++-- .../HeraldTestConsoleController.php | 2 +- .../controller/HeraldTranscriptController.php | 4 +- .../herald/engine/HeraldEngine.php | 30 +++---- .../herald/storage/HeraldRule.php | 4 +- .../legalpad/mail/LegalpadReplyHandler.php | 2 +- .../PhabricatorTestDataGenerator.php | 8 +- .../PhabricatorLipsumGenerateWorkflow.php | 8 +- .../conduit/ConduitAPI_macro_query_Method.php | 2 +- .../config/PhabricatorMacroConfigOptions.php | 4 +- .../PhabricatorMacroMemeController.php | 4 +- .../mail/PhabricatorMacroReplyHandler.php | 4 +- .../query/PhabricatorMacroSearchEngine.php | 2 +- ...ConduitAPI_maniphest_createtask_Method.php | 2 +- .../ConduitAPI_maniphest_find_Method.php | 2 +- ...I_maniphest_gettasktransactions_Method.php | 2 +- .../ConduitAPI_maniphest_info_Method.php | 2 +- .../ConduitAPI_maniphest_query_Method.php | 2 +- ...duitAPI_maniphest_querystatuses_Method.php | 2 +- .../ConduitAPI_maniphest_update_Method.php | 2 +- .../PhabricatorManiphestConfigOptions.php | 12 +-- .../controller/ManiphestExportController.php | 4 +- .../controller/ManiphestReportController.php | 16 ++-- ...bricatorManiphestTaskTestDataGenerator.php | 2 +- .../maniphest/mail/ManiphestReplyHandler.php | 6 +- ...catorMailImplementationSendGridAdapter.php | 2 +- .../PhabricatorContentSourceView.php | 2 +- ...catorMailManagementListInboundWorkflow.php | 6 +- ...atorMailManagementListOutboundWorkflow.php | 6 +- ...catorMailManagementReceiveTestWorkflow.php | 4 +- ...habricatorMailManagementResendWorkflow.php | 4 +- ...bricatorMailManagementSendTestWorkflow.php | 4 +- ...catorMailManagementShowInboundWorkflow.php | 4 +- ...atorMailManagementShowOutboundWorkflow.php | 4 +- ...bricatorMetaMTAEmailBodyParserTestCase.php | 4 +- .../storage/PhabricatorMetaMTAMail.php | 16 ++-- .../PhabricatorMetaMTAMailTestCase.php | 4 +- .../PhabricatorMetaMTAMailBodyTestCase.php | 8 +- .../PhabricatorNotificationQuery.php | 6 +- ...PhabricatorNotificationClearController.php | 4 +- ...habricatorNotificationStatusController.php | 4 +- .../PhabricatorFeedStoryNotification.php | 4 +- .../config/PhabricatorOwnersConfigOptions.php | 4 +- .../PhabricatorOwnersDetailController.php | 2 +- .../owners/mail/OwnersPackageReplyHandler.php | 2 +- .../owners/mail/PackageDeleteMail.php | 2 +- .../passphrase/keys/PassphraseAbstractKey.php | 2 +- .../view/PassphraseCredentialControl.php | 2 +- .../conduit/ConduitAPI_paste_info_Method.php | 2 +- .../conduit/ConduitAPI_paste_query_Method.php | 2 +- .../PhabricatorPasteTestDataGenerator.php | 14 +-- .../paste/view/PasteEmbedView.php | 2 +- .../ConduitAPI_user_addstatus_Method.php | 2 +- .../ConduitAPI_user_disable_Method.php | 2 +- .../conduit/ConduitAPI_user_enable_Method.php | 2 +- .../conduit/ConduitAPI_user_info_Method.php | 2 +- .../conduit/ConduitAPI_user_query_Method.php | 2 +- .../ConduitAPI_user_removestatus_Method.php | 2 +- .../conduit/ConduitAPI_user_whoami_Method.php | 2 +- .../config/PhabricatorUserConfigOptions.php | 10 +-- .../PhabricatorPeopleLdapController.php | 8 +- .../PhabricatorPeopleNewController.php | 2 +- .../people/editor/PhabricatorUserEditor.php | 38 ++++---- .../PhabricatorPeopleTestDataGenerator.php | 20 ++--- .../people/storage/PhabricatorUser.php | 8 +- .../conduit/ConduitAPI_phame_query_Method.php | 2 +- .../ConduitAPI_phame_queryposts_Method.php | 2 +- .../config/PhabricatorPhameConfigOptions.php | 4 +- .../phame/skins/PhameSkinSpecification.php | 2 +- src/applications/phame/storage/PhameBlog.php | 4 +- .../conduit/ConduitAPI_phid_info_Method.php | 2 +- .../conduit/ConduitAPI_phid_lookup_Method.php | 2 +- .../conduit/ConduitAPI_phid_query_Method.php | 2 +- .../phid/query/PhabricatorObjectQuery.php | 2 +- .../PhabricatorObjectListQueryTestCase.php | 6 +- .../phid/storage/PhabricatorPHID.php | 2 +- .../phid/type/PhabricatorPHIDType.php | 2 +- .../config/PhabricatorPholioConfigOptions.php | 4 +- .../controller/PholioInlineSaveController.php | 2 +- ...PhabricatorPholioMockTestDataGenerator.php | 4 +- .../pholio/mail/PholioReplyHandler.php | 4 +- .../view/PholioInlineCommentEditView.php | 4 +- .../view/PholioInlineCommentSaveView.php | 4 +- .../pholio/view/PholioInlineCommentView.php | 10 +-- .../pholio/view/PholioMockEmbedView.php | 2 +- .../pholio/view/PholioMockImagesView.php | 2 +- .../pholio/view/PholioTransactionView.php | 2 +- .../PhortuneAccountBuyController.php | 2 +- .../controller/PhortuneController.php | 2 +- .../PhortunePaymentMethodEditController.php | 4 +- .../controller/PhortuneProviderController.php | 2 +- .../phortune/currency/PhortuneCurrency.php | 4 +- .../PhabricatorPhortuneConfigOptions.php | 4 +- .../PhortunePaypalPaymentProvider.php | 4 +- .../PhortuneStripePaymentProvider.php | 2 +- .../provider/PhortuneWePayPaymentProvider.php | 4 +- .../PhabricatorXHPASTViewPanelController.php | 2 +- .../ConduitAPI_phragment_getpatch_Method.php | 8 +- ...uitAPI_phragment_queryfragments_Method.php | 2 +- .../controller/PhragmentBrowseController.php | 2 +- .../controller/PhragmentController.php | 20 ++--- .../controller/PhragmentCreateController.php | 2 +- .../controller/PhragmentHistoryController.php | 8 +- .../controller/PhragmentPatchController.php | 8 +- .../controller/PhragmentPolicyController.php | 2 +- .../controller/PhragmentRevertController.php | 6 +- .../PhragmentSnapshotCreateController.php | 10 +-- .../PhragmentSnapshotDeleteController.php | 4 +- .../PhragmentSnapshotPromoteController.php | 4 +- .../PhragmentSnapshotViewController.php | 10 +-- .../controller/PhragmentUpdateController.php | 4 +- .../controller/PhragmentVersionController.php | 8 +- .../controller/PhragmentZIPController.php | 6 +- .../phid/PhragmentPHIDTypeFragment.php | 2 +- .../phid/PhragmentPHIDTypeFragmentVersion.php | 2 +- .../phragment/storage/PhragmentFragment.php | 8 +- .../phragment/util/PhragmentPatchUtil.php | 10 +-- .../PhabricatorPhrequentConfigOptions.php | 4 +- .../controller/PhrequentTrackController.php | 2 +- .../phrequent/query/PhrequentSearchEngine.php | 2 +- .../ConduitAPI_phriction_edit_Method.php | 2 +- .../PhabricatorPhrictionConfigOptions.php | 6 +- .../controller/PhrictionDiffController.php | 2 +- .../PhrictionDocumentController.php | 2 +- .../controller/PhrictionHistoryController.php | 2 +- .../controller/PhrictionMoveController.php | 2 +- .../editor/PhrictionDocumentEditor.php | 10 +-- .../__tests__/PhabricatorPolicyTestCase.php | 4 +- .../config/PhabricatorPolicyConfigOptions.php | 6 +- .../PhabricatorPolicyEditController.php | 4 +- ...habricatorPolicyManagementShowWorkflow.php | 8 +- ...bricatorPolicyManagementUnlockWorkflow.php | 6 +- .../policy/query/PhabricatorPolicyQuery.php | 4 +- .../PonderQuestionViewController.php | 2 +- .../ponder/editor/PonderVoteEditor.php | 2 +- .../mail/PonderQuestionReplyHandler.php | 2 +- .../ponder/storage/PonderAnswer.php | 4 +- .../ponder/storage/PonderQuestion.php | 2 +- .../ConduitAPI_project_query_Method.php | 2 +- .../PhabricatorProjectConfigOptions.php | 8 +- .../project/storage/PhabricatorProject.php | 4 +- .../commitfinder/ReleephCommitFinder.php | 2 +- .../ConduitAPI_releeph_getbranches_Method.php | 2 +- .../ConduitAPI_releeph_projectinfo_Method.php | 8 +- ...onduitAPI_releeph_queryrequests_Method.php | 2 +- .../ConduitAPI_releeph_request_Method.php | 8 +- .../ConduitAPI_releephwork_canpush_Method.php | 2 +- ...itAPI_releephwork_getauthorinfo_Method.php | 2 +- ...onduitAPI_releephwork_getbranch_Method.php | 2 +- ...eephwork_getbranchcommitmessage_Method.php | 8 +- ...PI_releephwork_getcommitmessage_Method.php | 4 +- ...duitAPI_releephwork_nextrequest_Method.php | 6 +- .../ConduitAPI_releephwork_record_Method.php | 4 +- ...PI_releephwork_recordpickstatus_Method.php | 2 +- ...ricatorApplicationReleephConfigOptions.php | 28 +++--- .../product/ReleephProductEditController.php | 6 +- ...ephRequestDifferentialCreateController.php | 10 +-- .../request/ReleephRequestEditController.php | 4 +- .../request/ReleephRequestViewController.php | 2 +- ...entialReleephRequestFieldSpecification.php | 10 +-- .../ReleephRequestTransactionalEditor.php | 2 +- .../ReleephDiffSizeFieldSpecification.php | 2 +- .../ReleephIntentFieldSpecification.php | 4 +- .../ReleephLevelFieldSpecification.php | 2 +- .../ReleephReasonFieldSpecification.php | 2 +- .../ReleephRequestorFieldSpecification.php | 2 +- .../mail/ReleephRequestReplyHandler.php | 2 +- .../releeph/storage/ReleephRequest.php | 4 +- .../storage/ReleephRequestTransaction.php | 2 +- .../view/branch/ReleephBranchTemplate.php | 6 +- .../PhabricatorRepositoryConfigOptions.php | 10 +-- .../PhabricatorApplicationRepositories.php | 2 +- .../ConduitAPI_repository_create_Method.php | 4 +- .../ConduitAPI_repository_query_Method.php | 4 +- .../PhabricatorRepositoryController.php | 2 +- .../daemon/PhabricatorGitGraphStream.php | 2 +- .../PhabricatorRepositoryDiscoveryEngine.php | 14 +-- .../engine/PhabricatorRepositoryEngine.php | 2 +- .../PhabricatorRepositoryGraphCache.php | 2 +- ...catorRepositoryManagementCacheWorkflow.php | 2 +- ...orRepositoryManagementDiscoverWorkflow.php | 2 +- ...icatorRepositoryManagementEditWorkflow.php | 6 +- ...rRepositoryManagementImportingWorkflow.php | 8 +- ...epositoryManagementLookupUsersWorkflow.php | 4 +- ...positoryManagementMarkImportedWorkflow.php | 2 +- ...atorRepositoryManagementMirrorWorkflow.php | 4 +- ...icatorRepositoryManagementPullWorkflow.php | 2 +- ...icatorRepositoryManagementRefsWorkflow.php | 4 +- .../PhabricatorRepositoryPHIDTypeMirror.php | 2 +- ...abricatorRepositoryCommitSearchIndexer.php | 4 +- .../storage/PhabricatorRepository.php | 14 +-- .../PhabricatorRepositoryVCSPassword.php | 2 +- .../PhabricatorRepositoryTestCase.php | 4 +- ...habricatorRepositoryCommitHeraldWorker.php | 2 +- ...habricatorRepositoryCommitOwnersWorker.php | 12 +-- .../PhabricatorOwnersPackagePathValidator.php | 8 +- ...atorRepositoryCommitChangeParserWorker.php | 2 +- ...rRepositorySvnCommitChangeParserWorker.php | 6 +- .../config/PhabricatorSearchConfigOptions.php | 22 ++--- ...PhabricatorApplicationSearchController.php | 12 +-- .../PhabricatorSearchAttachController.php | 14 +-- .../PhabricatorApplicationSearchEngine.php | 2 +- .../engine/PhabricatorSearchEngineElastic.php | 2 +- .../engine/PhabricatorSearchEngineMySQL.php | 2 +- .../search/storage/PhabricatorSavedQuery.php | 2 +- .../panel/PhabricatorSettingsPanelAccount.php | 4 +- ...habricatorSettingsPanelDiffPreferences.php | 6 +- ...PhabricatorSettingsPanelEmailAddresses.php | 4 +- ...abricatorSettingsPanelEmailPreferences.php | 14 +-- .../panel/PhabricatorSettingsPanelSSHKeys.php | 2 +- .../ConduitAPI_slowvote_info_Method.php | 2 +- .../PhabricatorSlowvoteEditController.php | 2 +- .../slowvote/view/SlowvoteEmbedView.php | 2 +- ...torApplicationTransactionCommentEditor.php | 6 +- ...habricatorApplicationTransactionEditor.php | 18 ++-- .../PhabricatorApplicationTransaction.php | 4 +- ...catorApplicationTransactionCommentView.php | 2 +- .../PhabricatorApplicationTransactionView.php | 2 +- ...torTypeaheadCommonDatasourceController.php | 2 +- .../examples/PHUITimelineExample.php | 2 +- .../examples/PhabricatorAphrontBarExample.php | 6 +- .../examples/PhabricatorBusyExample.php | 2 +- .../examples/PhabricatorHovercardExample.php | 16 ++-- .../PhabricatorXHProfProfileController.php | 2 +- .../celerity/CelerityResourceController.php | 4 +- .../celerity/CelerityResourceGraph.php | 2 +- .../CelerityManagementMapWorkflow.php | 4 +- .../daemon/bot/PhabricatorBot.php | 4 +- .../daemon/bot/PhabricatorIRCBot.php | 2 +- ...ricatorBotBaseStreamingProtocolAdapter.php | 8 +- .../PhabricatorBotFlowdockProtocolAdapter.php | 4 +- .../PhabricatorCampfireProtocolAdapter.php | 2 +- .../adapter/PhabricatorIRCProtocolAdapter.php | 22 ++--- .../bot/handler/PhabricatorBotHandler.php | 2 +- .../PhabricatorBotObjectNameHandler.php | 2 +- .../handler/PhabricatorIRCProtocolHandler.php | 2 +- .../daemon/workers/PhabricatorWorker.php | 2 +- .../__tests__/PhabricatorTestWorker.php | 4 +- .../query/PhabricatorWorkerLeaseQuery.php | 2 +- .../storage/PhabricatorWorkerActiveTask.php | 4 +- .../storage/PhabricatorWorkerArchiveTask.php | 2 +- .../edges/query/PhabricatorEdgeQuery.php | 4 +- .../edges/util/PhabricatorEdgeGraph.php | 2 +- .../env/PhabricatorConfigProxySource.php | 2 +- .../env/PhabricatorConfigSource.php | 4 +- .../env/PhabricatorConfigStackSource.php | 2 +- src/infrastructure/env/PhabricatorEnv.php | 12 +-- .../env/__tests__/PhabricatorEnvTestCase.php | 8 +- .../events/PhabricatorEventListener.php | 2 +- .../PhabricatorBaseEnglishTranslation.php | 6 +- .../lint/linter/PhabricatorJavelinLinter.php | 2 +- .../markup/PhabricatorMarkupEngine.php | 2 +- .../policy/PhabricatorPolicyAwareQuery.php | 4 +- ...catorSMSManagementListOutboundWorkflow.php | 6 +- ...catorSMSManagementShowOutboundWorkflow.php | 4 +- .../ssh/PhabricatorSSHPassthruCommand.php | 6 +- .../__tests__/QueryFormattingTestCase.php | 2 +- src/infrastructure/storage/lisk/LiskDAO.php | 18 ++-- .../storage/lisk/PhabricatorLiskDAO.php | 4 +- .../lisk/__tests__/LiskFixtureTestCase.php | 4 +- .../lisk/__tests__/LiskIsolationTestCase.php | 4 +- .../lisk/__tests__/LiskIsolationTestDAO.php | 4 +- ...icatorStorageManagementDestroyWorkflow.php | 10 +-- ...bricatorStorageManagementProbeWorkflow.php | 10 +-- ...ricatorStorageManagementStatusWorkflow.php | 2 +- ...icatorStorageManagementUpgradeWorkflow.php | 14 +-- .../testing/PhabricatorTestCase.php | 8 +- src/infrastructure/time/PhabricatorTime.php | 2 +- src/infrastructure/util/PhabricatorHash.php | 16 ++-- .../__tests__/PhabricatorSlugTestCase.php | 2 +- .../PhabricatorBcryptPasswordHasher.php | 2 +- .../PhabricatorIteratedMD5PasswordHasher.php | 2 +- src/view/AphrontDialogView.php | 2 +- .../PhabricatorAphrontViewTestCase.php | 2 +- src/view/control/AphrontCursorPagerView.php | 14 +-- src/view/control/AphrontPagerView.php | 2 +- src/view/form/PHUIFormLayoutView.php | 2 +- src/view/form/PHUIFormPageView.php | 4 +- src/view/form/PHUIPagedFormView.php | 4 +- src/view/form/control/AphrontFormControl.php | 4 +- .../form/control/AphrontFormDateControl.php | 2 +- .../form/control/AphrontFormPolicyControl.php | 4 +- src/view/layout/AphrontMultiColumnView.php | 2 +- src/view/layout/AphrontPanelView.php | 2 +- src/view/layout/AphrontSideNavFilterView.php | 4 +- src/view/layout/PhabricatorActionListView.php | 2 +- src/view/layout/PhabricatorSourceCodeView.php | 2 +- .../layout/PhabricatorTransactionView.php | 2 +- src/view/page/PhabricatorStandardPageView.php | 2 +- src/view/phui/PHUIButtonBarView.php | 4 +- src/view/phui/PHUIFeedStoryView.php | 4 +- src/view/phui/PHUIIconView.php | 2 +- src/view/phui/PHUIObjectItemView.php | 4 +- src/view/phui/PHUIRemarkupPreviewPanel.php | 4 +- src/view/phui/PHUITagView.php | 2 +- .../phui/calendar/PHUICalendarMonthView.php | 2 +- .../hovercard/PhabricatorHovercardView.php | 6 +- support/PhabricatorStartup.php | 2 +- webroot/index.php | 2 +- 560 files changed, 1721 insertions(+), 1722 deletions(-) diff --git a/resources/sql/patches/059.engines.php b/resources/sql/patches/059.engines.php index 5fdb3ea2ec..8c1c7bc8e3 100644 --- a/resources/sql/patches/059.engines.php +++ b/resources/sql/patches/059.engines.php @@ -24,7 +24,7 @@ foreach ($tables as $table) { echo "Converting {$name}...\n"; queryfx( $conn, - "ALTER TABLE %T.%T ENGINE=InnoDB", + 'ALTER TABLE %T.%T ENGINE=InnoDB', $table['db'], $table['tbl']); } diff --git a/resources/sql/patches/079.nametokenindex.php b/resources/sql/patches/079.nametokenindex.php index f8b74ee39d..931a850bf0 100644 --- a/resources/sql/patches/079.nametokenindex.php +++ b/resources/sql/patches/079.nametokenindex.php @@ -7,10 +7,10 @@ $table->openTransaction(); $table->beginReadLocking(); $users = $table->loadAll(); -echo count($users)." users to index"; +echo count($users).' users to index'; foreach ($users as $user) { $user->updateNameTokens(); - echo "."; + echo '.'; } $table->endReadLocking(); diff --git a/resources/sql/patches/090.forceuniqueprojectnames.php b/resources/sql/patches/090.forceuniqueprojectnames.php index 1bd5255886..f8a7508d99 100644 --- a/resources/sql/patches/090.forceuniqueprojectnames.php +++ b/resources/sql/patches/090.forceuniqueprojectnames.php @@ -64,9 +64,9 @@ while ($update) { } if (count($update) == $size) { throw new Exception( - "Failed to make any progress while updating projects. Schema upgrade ". - "has failed. Go manually fix your project names to be unique (they are ". - "probably ridiculous?) and then try again."); + 'Failed to make any progress while updating projects. Schema upgrade '. + 'has failed. Go manually fix your project names to be unique (they are '. + 'probably ridiculous?) and then try again.'); } } diff --git a/resources/sql/patches/102.heraldcleanup.php b/resources/sql/patches/102.heraldcleanup.php index 22f198df86..24bf382c09 100644 --- a/resources/sql/patches/102.heraldcleanup.php +++ b/resources/sql/patches/102.heraldcleanup.php @@ -24,14 +24,14 @@ if ($rules) { mpull($rules, 'getID')); } -echo "This may take a moment"; +echo 'This may take a moment'; do { queryfx( $conn_w, 'DELETE FROM %T %Q LIMIT 1000', HeraldRule::TABLE_RULE_APPLIED, $clause); - echo "."; + echo '.'; } while ($conn_w->getAffectedRows()); $table->endReadLocking(); diff --git a/resources/sql/patches/117.repositorydescription.php b/resources/sql/patches/117.repositorydescription.php index 18ee4a463f..692a783358 100644 --- a/resources/sql/patches/117.repositorydescription.php +++ b/resources/sql/patches/117.repositorydescription.php @@ -2,5 +2,5 @@ $conn = id(new PhabricatorRepository())->establishConnection('w'); if (queryfx_one($conn, "SHOW COLUMNS FROM `repository` LIKE 'description'")) { - queryfx($conn, "ALTER TABLE `repository` DROP `description`"); + queryfx($conn, 'ALTER TABLE `repository` DROP `description`'); } diff --git a/resources/sql/patches/131.migraterevisionquery.php b/resources/sql/patches/131.migraterevisionquery.php index 027edbaeb3..cf505b6295 100644 --- a/resources/sql/patches/131.migraterevisionquery.php +++ b/resources/sql/patches/131.migraterevisionquery.php @@ -5,12 +5,12 @@ $table->openTransaction(); $table->beginReadLocking(); $conn_w = $table->establishConnection('w'); -echo "Migrating revisions"; +echo 'Migrating revisions'; do { $revisions = $table->loadAllWhere('branchName IS NULL LIMIT 1000'); foreach ($revisions as $revision) { - echo "."; + echo '.'; $diff = $revision->loadActiveDiff(); if (!$diff) { diff --git a/resources/sql/patches/20121209.xmacromigrate.php b/resources/sql/patches/20121209.xmacromigrate.php index 0372faafa7..df52cb317c 100644 --- a/resources/sql/patches/20121209.xmacromigrate.php +++ b/resources/sql/patches/20121209.xmacromigrate.php @@ -1,6 +1,6 @@ openTransaction(); @@ -9,7 +9,7 @@ foreach (new LiskMigrationIterator($table) as $macro) { continue; } - echo "."; + echo '.'; queryfx( $macro->establishConnection('w'), diff --git a/resources/sql/patches/20130201.revisionunsubscribed.php b/resources/sql/patches/20130201.revisionunsubscribed.php index b15379893b..38f1e5207e 100644 --- a/resources/sql/patches/20130201.revisionunsubscribed.php +++ b/resources/sql/patches/20130201.revisionunsubscribed.php @@ -11,7 +11,7 @@ $revs = queryfx_all( 'SELECT id, phid, unsubscribed FROM differential_revision'); foreach ($revs as $rev) { - echo "."; + echo '.'; $unsubscribed = json_decode($rev['unsubscribed']); if (!$unsubscribed) { diff --git a/resources/sql/patches/20130409.commitdrev.php b/resources/sql/patches/20130409.commitdrev.php index 300b282380..86d00ac219 100644 --- a/resources/sql/patches/20130409.commitdrev.php +++ b/resources/sql/patches/20130409.commitdrev.php @@ -22,12 +22,12 @@ foreach (new LiskMigrationIterator($commit_table) as $commit) { $editor->addEdge($commit->getPHID(), $commit_drev, $revision_phid); $edges++; if ($edges % 256 == 0) { - echo "."; + echo '.'; $editor->save(); $editor = id(new PhabricatorEdgeEditor())->setSuppressEvents(true); } } -echo "."; +echo '.'; $editor->save(); echo "\nDone.\n"; diff --git a/resources/sql/patches/20130502.countdownrevamp2.php b/resources/sql/patches/20130502.countdownrevamp2.php index f4fc96413d..6f7e41e1d2 100644 --- a/resources/sql/patches/20130502.countdownrevamp2.php +++ b/resources/sql/patches/20130502.countdownrevamp2.php @@ -1,6 +1,6 @@ openTransaction(); @@ -9,7 +9,7 @@ foreach (new LiskMigrationIterator($table) as $countdown) { continue; } - echo "."; + echo '.'; queryfx( $countdown->establishConnection('w'), diff --git a/resources/sql/patches/20130703.legalpaddocdenorm.php b/resources/sql/patches/20130703.legalpaddocdenorm.php index 9492e26bc8..da31e906f5 100644 --- a/resources/sql/patches/20130703.legalpaddocdenorm.php +++ b/resources/sql/patches/20130703.legalpaddocdenorm.php @@ -1,6 +1,6 @@ openTransaction(); diff --git a/resources/sql/patches/20130711.pholioimageobsolete.php b/resources/sql/patches/20130711.pholioimageobsolete.php index 738f82085e..eae9a479d8 100644 --- a/resources/sql/patches/20130711.pholioimageobsolete.php +++ b/resources/sql/patches/20130711.pholioimageobsolete.php @@ -1,6 +1,6 @@ openTransaction(); @@ -9,7 +9,7 @@ foreach (new LiskMigrationIterator($table) as $image) { continue; } - echo "."; + echo '.'; queryfx( $image->establishConnection('w'), diff --git a/resources/sql/patches/20131205.buildstepordermig.php b/resources/sql/patches/20131205.buildstepordermig.php index 9721e15271..b17724252a 100644 --- a/resources/sql/patches/20131205.buildstepordermig.php +++ b/resources/sql/patches/20131205.buildstepordermig.php @@ -13,9 +13,9 @@ foreach (new LiskMigrationIterator($table) as $plan) { $rows = queryfx_all( $conn_w, - "SELECT id, sequence FROM harbormaster_buildstep ". - "WHERE buildPlanPHID = %s ". - "ORDER BY id ASC", + 'SELECT id, sequence FROM harbormaster_buildstep '. + 'WHERE buildPlanPHID = %s '. + 'ORDER BY id ASC', $plan->getPHID()); $sequence = 1; @@ -29,9 +29,9 @@ foreach (new LiskMigrationIterator($table) as $plan) { echo " - {$id} to position {$sequence}...\n"; queryfx( $conn_w, - "UPDATE harbormaster_buildstep ". - "SET sequence = %d ". - "WHERE id = %d", + 'UPDATE harbormaster_buildstep '. + 'SET sequence = %d '. + 'WHERE id = %d', $sequence, $id); $sequence++; diff --git a/scripts/calendar/import_us_holidays.php b/scripts/calendar/import_us_holidays.php index 2ae82a4d58..78d1d50c39 100755 --- a/scripts/calendar/import_us_holidays.php +++ b/scripts/calendar/import_us_holidays.php @@ -7,45 +7,45 @@ require_once $root.'/scripts/__init_script__.php'; // http://www.opm.gov/operating_status_schedules/fedhol/ $holidays = array( '2014-01-01' => "New Year's Day", - '2014-01-20' => "Birthday of Martin Luther King, Jr.", + '2014-01-20' => 'Birthday of Martin Luther King, Jr.', '2014-02-17' => "Washington's Birthday", - '2014-05-26' => "Memorial Day", - '2014-07-04' => "Independence Day", - '2014-09-01' => "Labor Day", - '2014-10-13' => "Columbus Day", - '2014-11-11' => "Veterans Day", - '2014-11-27' => "Thanksgiving Day", - '2014-12-25' => "Christmas Day", + '2014-05-26' => 'Memorial Day', + '2014-07-04' => 'Independence Day', + '2014-09-01' => 'Labor Day', + '2014-10-13' => 'Columbus Day', + '2014-11-11' => 'Veterans Day', + '2014-11-27' => 'Thanksgiving Day', + '2014-12-25' => 'Christmas Day', '2015-01-01' => "New Year's Day", - '2015-01-19' => "Birthday of Martin Luther King, Jr.", + '2015-01-19' => 'Birthday of Martin Luther King, Jr.', '2015-02-16' => "Washington's Birthday", - '2015-05-25' => "Memorial Day", - '2015-07-03' => "Independence Day", - '2015-09-07' => "Labor Day", - '2015-10-12' => "Columbus Day", - '2015-11-11' => "Veterans Day", - '2015-11-26' => "Thanksgiving Day", - '2015-12-25' => "Christmas Day", + '2015-05-25' => 'Memorial Day', + '2015-07-03' => 'Independence Day', + '2015-09-07' => 'Labor Day', + '2015-10-12' => 'Columbus Day', + '2015-11-11' => 'Veterans Day', + '2015-11-26' => 'Thanksgiving Day', + '2015-12-25' => 'Christmas Day', '2016-01-01' => "New Year's Day", - '2016-01-18' => "Birthday of Martin Luther King, Jr.", + '2016-01-18' => 'Birthday of Martin Luther King, Jr.', '2016-02-15' => "Washington's Birthday", - '2016-05-30' => "Memorial Day", - '2016-07-04' => "Independence Day", - '2016-09-05' => "Labor Day", - '2016-10-10' => "Columbus Day", - '2016-11-11' => "Veterans Day", - '2016-11-24' => "Thanksgiving Day", - '2016-12-26' => "Christmas Day", + '2016-05-30' => 'Memorial Day', + '2016-07-04' => 'Independence Day', + '2016-09-05' => 'Labor Day', + '2016-10-10' => 'Columbus Day', + '2016-11-11' => 'Veterans Day', + '2016-11-24' => 'Thanksgiving Day', + '2016-12-26' => 'Christmas Day', '2017-01-02' => "New Year's Day", - '2017-01-16' => "Birthday of Martin Luther King, Jr.", + '2017-01-16' => 'Birthday of Martin Luther King, Jr.', '2017-02-10' => "Washington's Birthday", - '2017-05-29' => "Memorial Day", - '2017-07-04' => "Independence Day", - '2017-09-04' => "Labor Day", - '2017-10-09' => "Columbus Day", - '2017-11-10' => "Veterans Day", - '2017-11-23' => "Thanksgiving Day", - '2017-12-25' => "Christmas Day", + '2017-05-29' => 'Memorial Day', + '2017-07-04' => 'Independence Day', + '2017-09-04' => 'Labor Day', + '2017-10-09' => 'Columbus Day', + '2017-11-10' => 'Veterans Day', + '2017-11-23' => 'Thanksgiving Day', + '2017-12-25' => 'Christmas Day', ); $table = new PhabricatorCalendarHoliday(); diff --git a/scripts/mail/mail_handler.php b/scripts/mail/mail_handler.php index 63d6688a5c..214b51ee1a 100755 --- a/scripts/mail/mail_handler.php +++ b/scripts/mail/mail_handler.php @@ -44,12 +44,12 @@ if ( (preg_match('/charset="(.*?)"/', $content_type, $matches) || preg_match('/charset=(\S+)/', $content_type, $matches)) ) { - $text_body = phutil_utf8_convert($text_body, "UTF-8", $matches[1]); + $text_body = phutil_utf8_convert($text_body, 'UTF-8', $matches[1]); } $headers = $parser->getHeaders(); -$headers['subject'] = iconv_mime_decode($headers['subject'], 0, "UTF-8"); -$headers['from'] = iconv_mime_decode($headers['from'], 0, "UTF-8"); +$headers['subject'] = iconv_mime_decode($headers['subject'], 0, 'UTF-8'); +$headers['from'] = iconv_mime_decode($headers['from'], 0, 'UTF-8'); if ($args->getArg('process-duplicates')) { $headers['message-id'] = Filesystem::readRandomCharacters(64); diff --git a/scripts/repository/rebuild_summaries.php b/scripts/repository/rebuild_summaries.php index d0bb215c3c..a98a6f01b4 100755 --- a/scripts/repository/rebuild_summaries.php +++ b/scripts/repository/rebuild_summaries.php @@ -22,7 +22,7 @@ $maxes = ipull($maxes, 'maxEpoch', 'repositoryID'); $repository_ids = array_keys($sizes + $maxes); -echo "Updating ".count($repository_ids)." repositories"; +echo 'Updating '.count($repository_ids).' repositories'; foreach ($repository_ids as $repository_id) { $last_commit = queryfx_one( @@ -48,6 +48,6 @@ foreach ($repository_ids as $repository_id) { $last_commit, idx($sizes, $repository_id, 0), idx($maxes, $repository_id, 0)); - echo "."; + echo '.'; } echo "\ndone.\n"; diff --git a/scripts/repository/reparse.php b/scripts/repository/reparse.php index 37730a7b03..9e4e86e9ea 100755 --- a/scripts/repository/reparse.php +++ b/scripts/repository/reparse.php @@ -103,7 +103,7 @@ $force_local = $args->getArg('force-local'); $min_date = $args->getArg('min-date'); if (!$all_from_repo && !$reparse_what) { - usage("Specify a commit or repository to reparse."); + usage('Specify a commit or repository to reparse.'); } if ($all_from_repo && $reparse_what) { @@ -116,8 +116,8 @@ if ($all_from_repo && $reparse_what) { if (!$reparse_message && !$reparse_change && !$reparse_herald && !$reparse_owners && !$reparse_harbormaster) { - usage("Specify what information to reparse with --message, --change, ". - "--herald, --harbormaster, and/or --owners"); + usage('Specify what information to reparse with --message, --change, '. + '--herald, --harbormaster, and/or --owners'); } $min_timestamp = false; @@ -142,9 +142,9 @@ if ($min_date) { if ($reparse_owners && !$force) { echo phutil_console_wrap( - "You are about to recreate the relationship entries between the commits ". - "and the packages they touch. This might delete some existing ". - "relationship entries for some old commits."); + 'You are about to recreate the relationship entries between the commits '. + 'and the packages they touch. This might delete some existing '. + 'relationship entries for some old commits.'); if (!phutil_console_confirm('Are you ready to continue?')) { echo "Cancelled.\n"; diff --git a/scripts/repository/save_lint.php b/scripts/repository/save_lint.php index 0a23adb49c..6cd0664133 100755 --- a/scripts/repository/save_lint.php +++ b/scripts/repository/save_lint.php @@ -18,30 +18,30 @@ $args = id(new PhutilArgumentParser($argv)) array( 'name' => 'all', 'help' => - "Discover problems in the whole repository instead of just changes ". - "since the last run.", + 'Discover problems in the whole repository instead of just changes '. + 'since the last run.', ), array( 'name' => 'arc', 'param' => 'path', 'default' => 'arc', - 'help' => "Path to Arcanist executable.", + 'help' => 'Path to Arcanist executable.', ), array( 'name' => 'severity', 'param' => 'string', 'default' => ArcanistLintSeverity::SEVERITY_ADVICE, - 'help' => "Minimum severity, one of ArcanistLintSeverity constants.", + 'help' => 'Minimum severity, one of ArcanistLintSeverity constants.', ), array( 'name' => 'chunk-size', 'param' => 'number', 'default' => 256, - 'help' => "Number of paths passed to `arc` at once.", + 'help' => 'Number of paths passed to `arc` at once.', ), array( 'name' => 'blame', - 'help' => "Assign lint errors to authors who last modified the line.", + 'help' => 'Assign lint errors to authors who last modified the line.', ), )); diff --git a/scripts/ssh/ssh-auth.php b/scripts/ssh/ssh-auth.php index aba2b20f01..eeebfecd1a 100755 --- a/scripts/ssh/ssh-auth.php +++ b/scripts/ssh/ssh-auth.php @@ -16,7 +16,7 @@ $rows = queryfx_all( $ssh_dao->getTableName()); if (!$rows) { - echo pht("No keys found.")."\n"; + echo pht('No keys found.')."\n"; exit(1); } diff --git a/scripts/ssh/ssh-exec.php b/scripts/ssh/ssh-exec.php index 6dba54b1ea..395ae4bd9a 100755 --- a/scripts/ssh/ssh-exec.php +++ b/scripts/ssh/ssh-exec.php @@ -32,14 +32,14 @@ $args->parse( try { $user_name = $args->getArg('phabricator-ssh-user'); if (!strlen($user_name)) { - throw new Exception("No username."); + throw new Exception('No username.'); } $user = id(new PhabricatorUser())->loadOneWhere( 'userName = %s', $user_name); if (!$user) { - throw new Exception("Invalid username."); + throw new Exception('Invalid username.'); } $ssh_log->setData( @@ -49,7 +49,7 @@ try { )); if (!$user->isUserActivated()) { - throw new Exception(pht("Your account is not activated.")); + throw new Exception(pht('Your account is not activated.')); } if ($args->getArg('ssh-command')) { @@ -96,7 +96,7 @@ try { $original_args = new PhutilArgumentParser($original_argv); if (empty($workflow_names[$command])) { - throw new Exception("Invalid command."); + throw new Exception('Invalid command.'); } $workflow = $original_args->parseWorkflows($workflows); @@ -104,17 +104,17 @@ try { $sock_stdin = fopen('php://stdin', 'r'); if (!$sock_stdin) { - throw new Exception("Unable to open stdin."); + throw new Exception('Unable to open stdin.'); } $sock_stdout = fopen('php://stdout', 'w'); if (!$sock_stdout) { - throw new Exception("Unable to open stdout."); + throw new Exception('Unable to open stdout.'); } $sock_stderr = fopen('php://stderr', 'w'); if (!$sock_stderr) { - throw new Exception("Unable to open stderr."); + throw new Exception('Unable to open stderr.'); } $socket_channel = new PhutilSocketChannel( diff --git a/scripts/symbols/generate_ctags_symbols.php b/scripts/symbols/generate_ctags_symbols.php index 9a8ee30604..42d3dbf25f 100755 --- a/scripts/symbols/generate_ctags_symbols.php +++ b/scripts/symbols/generate_ctags_symbols.php @@ -35,7 +35,7 @@ foreach (Futures($futures)->limit(8) as $file => $future) { $tags = explode("\n", $tags[1]); foreach ($tags as $tag) { - $parts = explode(";", $tag); + $parts = explode(';', $tag); // skip lines that we can not parse if (count($parts) < 2) { continue; @@ -67,11 +67,11 @@ foreach (Futures($futures)->limit(8) as $file => $future) { // To keep consistent with "Separate with commas, for example: php, py" // in Arcanist Project edit form. - $language = str_ireplace("python", "py", $language); + $language = str_ireplace('python', 'py', $language); // also, "normalize" c++ and c# - $language = str_ireplace("c++", "cpp", $language); - $language = str_ireplace("c#", "cs", $language); + $language = str_ireplace('c++', 'cpp', $language); + $language = str_ireplace('c#', 'cs', $language); // Ruby has "singleton method", for example $type = substr(str_replace(' ', '_', $type), 0, 12); @@ -107,7 +107,7 @@ function ctags_check_executable() { function print_symbol($file, $line_num, $type, $token, $context, $language) { // get rid of relative path $file = explode('/', $file); - if ($file[0] == '.' || $file[0] == "..") { + if ($file[0] == '.' || $file[0] == '..') { array_shift($file); } $file = '/' . implode('/', $file); diff --git a/scripts/user/account_admin.php b/scripts/user/account_admin.php index e980b5cefe..3d18c16ac7 100755 --- a/scripts/user/account_admin.php +++ b/scripts/user/account_admin.php @@ -21,15 +21,15 @@ if ($is_first_user) { "which gives you more help setting up your install. If you create an ". "account with this script instead, you will skip the setup help and you ". "will not be able to access it later."); - if (!phutil_console_confirm(pht("Skip easy setup and create account?"))) { - echo pht("Cancelled.")."\n"; + if (!phutil_console_confirm(pht('Skip easy setup and create account?'))) { + echo pht('Cancelled.')."\n"; exit(1); } } -echo "Enter a username to create a new account or edit an existing account."; +echo 'Enter a username to create a new account or edit an existing account.'; -$username = phutil_console_prompt("Enter a username:"); +$username = phutil_console_prompt('Enter a username:'); if (!strlen($username)) { echo "Cancelled.\n"; exit(1); @@ -95,7 +95,7 @@ $user->setRealName($realname); $create_email = null; if ($is_new) { do { - $email = phutil_console_prompt("Enter user email address:"); + $email = phutil_console_prompt('Enter user email address:'); $duplicate = id(new PhabricatorUserEmail())->loadOneWhere( 'address = %s', $email); @@ -115,7 +115,7 @@ $changed_pass = false; // it. phutil_passthru('stty -echo'); $password = phutil_console_prompt( - "Enter a password for this user [blank to leave unchanged]:"); + 'Enter a password for this user [blank to leave unchanged]:'); phutil_passthru('stty echo'); if (strlen($password)) { $changed_pass = $password; @@ -183,7 +183,7 @@ printf( echo "\n"; -if (!phutil_console_confirm("Save these changes?", $default_no = false)) { +if (!phutil_console_confirm('Save these changes?', $default_no = false)) { echo "Cancelled.\n"; exit(1); } diff --git a/scripts/user/add_user.php b/scripts/user/add_user.php index 958ff4b893..f2cdac396b 100755 --- a/scripts/user/add_user.php +++ b/scripts/user/add_user.php @@ -19,8 +19,8 @@ $admin = id(new PhabricatorUser())->loadOneWhere( $argv[4]); if (!$admin) { throw new Exception( - "Admin user must be the username of a valid Phabricator account, used ". - "to send the new user a welcome email."); + 'Admin user must be the username of a valid Phabricator account, used '. + 'to send the new user a welcome email.'); } $existing_user = id(new PhabricatorUser())->loadOneWhere( diff --git a/src/aphront/AphrontRequest.php b/src/aphront/AphrontRequest.php index c83746c5e5..cf609011bb 100644 --- a/src/aphront/AphrontRequest.php +++ b/src/aphront/AphrontRequest.php @@ -483,7 +483,7 @@ final class AphrontRequest { if (empty($_SERVER['HTTPS'])) { return false; } - if (!strcasecmp($_SERVER["HTTPS"], "off")) { + if (!strcasecmp($_SERVER['HTTPS'], 'off')) { return false; } return true; diff --git a/src/aphront/configuration/AphrontApplicationConfiguration.php b/src/aphront/configuration/AphrontApplicationConfiguration.php index b3abbb1036..b15908c2f1 100644 --- a/src/aphront/configuration/AphrontApplicationConfiguration.php +++ b/src/aphront/configuration/AphrontApplicationConfiguration.php @@ -138,8 +138,8 @@ abstract class AphrontApplicationConfiguration { ->executeOne(); } catch (PhabricatorPolicyException $ex) { throw new Exception( - "This blog is not visible to logged out users, so it can not be ". - "visited from a custom domain."); + 'This blog is not visible to logged out users, so it can not be '. + 'visited from a custom domain.'); } if (!$blog) { diff --git a/src/aphront/response/AphrontProxyResponse.php b/src/aphront/response/AphrontProxyResponse.php index 8e031a977c..36f2830e29 100644 --- a/src/aphront/response/AphrontProxyResponse.php +++ b/src/aphront/response/AphrontProxyResponse.php @@ -67,7 +67,7 @@ abstract class AphrontProxyResponse extends AphrontResponse { final public function buildResponseString() { throw new Exception( - "AphrontProxyResponse must implement reduceProxyResponse()."); + 'AphrontProxyResponse must implement reduceProxyResponse().'); } diff --git a/src/aphront/sink/AphrontHTTPSink.php b/src/aphront/sink/AphrontHTTPSink.php index 15822051e4..cddca7b658 100644 --- a/src/aphront/sink/AphrontHTTPSink.php +++ b/src/aphront/sink/AphrontHTTPSink.php @@ -50,7 +50,7 @@ abstract class AphrontHTTPSink { if (strpos($name, ':') !== false) { throw new Exception( - "Declining to emit response with malformed HTTP header name: ". + 'Declining to emit response with malformed HTTP header name: '. $name); } diff --git a/src/aphront/sink/__tests__/AphrontHTTPSinkTestCase.php b/src/aphront/sink/__tests__/AphrontHTTPSinkTestCase.php index 4892de96c6..05235a77ba 100644 --- a/src/aphront/sink/__tests__/AphrontHTTPSinkTestCase.php +++ b/src/aphront/sink/__tests__/AphrontHTTPSinkTestCase.php @@ -36,7 +36,7 @@ final class AphrontHTTPSinkTestCase extends PhabricatorTestCase { public function testHTTPSinkResponseSplitting() { $input = $this->tryTestCaseMap( array( - "test" => true, + 'test' => true, "test\nx" => false, "test\rx" => false, "test\0x" => false, @@ -75,7 +75,7 @@ final class AphrontHTTPSinkTestCase extends PhabricatorTestCase { $this->assertEqual( 'for (;;);{"x":"\u003ciframe\u003e"}', $sink->getEmittedData(), - "JSONResponse should prevent content-sniffing attacks."); + 'JSONResponse should prevent content-sniffing attacks.'); } diff --git a/src/applications/arcanist/conduit/ConduitAPI_arcanist_projectinfo_Method.php b/src/applications/arcanist/conduit/ConduitAPI_arcanist_projectinfo_Method.php index d4b86e73c2..c1c815521d 100644 --- a/src/applications/arcanist/conduit/ConduitAPI_arcanist_projectinfo_Method.php +++ b/src/applications/arcanist/conduit/ConduitAPI_arcanist_projectinfo_Method.php @@ -7,7 +7,7 @@ final class ConduitAPI_arcanist_projectinfo_Method extends ConduitAPI_arcanist_Method { public function getMethodDescription() { - return "Get information about Arcanist projects."; + return 'Get information about Arcanist projects.'; } public function defineParamTypes() { diff --git a/src/applications/audit/conduit/ConduitAPI_audit_query_Method.php b/src/applications/audit/conduit/ConduitAPI_audit_query_Method.php index 796e744ef4..782da6deb7 100644 --- a/src/applications/audit/conduit/ConduitAPI_audit_query_Method.php +++ b/src/applications/audit/conduit/ConduitAPI_audit_query_Method.php @@ -6,7 +6,7 @@ final class ConduitAPI_audit_query_Method extends ConduitAPI_audit_Method { public function getMethodDescription() { - return "Query audit requests."; + return 'Query audit requests.'; } public function defineParamTypes() { diff --git a/src/applications/audit/editor/PhabricatorAuditCommentEditor.php b/src/applications/audit/editor/PhabricatorAuditCommentEditor.php index 25ef287a2b..b157b4d2fe 100644 --- a/src/applications/audit/editor/PhabricatorAuditCommentEditor.php +++ b/src/applications/audit/editor/PhabricatorAuditCommentEditor.php @@ -145,7 +145,7 @@ final class PhabricatorAuditCommentEditor extends PhabricatorEditor { $actor_request = id(new PhabricatorRepositoryAuditRequest()) ->setCommitPHID($commit->getPHID()) ->setAuditorPHID($actor->getPHID()) - ->setAuditReasons(array("Resigned")); + ->setAuditReasons(array('Resigned')); } $actor_request @@ -220,7 +220,7 @@ final class PhabricatorAuditCommentEditor extends PhabricatorEditor { ->setCommitPHID($commit->getPHID()) ->setAuditorPHID($actor->getPHID()) ->setAuditStatus($new_status) - ->setAuditReasons(array("Voluntary Participant")) + ->setAuditReasons(array('Voluntary Participant')) ->save(); $requests[] = $request; } diff --git a/src/applications/audit/mail/PhabricatorAuditReplyHandler.php b/src/applications/audit/mail/PhabricatorAuditReplyHandler.php index 2b09771af8..82df0c4941 100644 --- a/src/applications/audit/mail/PhabricatorAuditReplyHandler.php +++ b/src/applications/audit/mail/PhabricatorAuditReplyHandler.php @@ -4,7 +4,7 @@ final class PhabricatorAuditReplyHandler extends PhabricatorMailReplyHandler { public function validateMailReceiver($mail_receiver) { if (!($mail_receiver instanceof PhabricatorRepositoryCommit)) { - throw new Exception("Mail receiver is not a commit!"); + throw new Exception('Mail receiver is not a commit!'); } } @@ -24,7 +24,7 @@ final class PhabricatorAuditReplyHandler extends PhabricatorMailReplyHandler { public function getReplyHandlerInstructions() { if ($this->supportsReplies()) { - return pht("Reply to comment."); + return pht('Reply to comment.'); } else { return null; } diff --git a/src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php b/src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php index 5bfbf0e5cf..af951c754f 100644 --- a/src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php +++ b/src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php @@ -72,7 +72,7 @@ final class PhabricatorAuditManagementDeleteWorkflow $max_date = $this->loadDate($args->getArg('max-commit-date')); if ($min_date && $max_date && ($min_date > $max_date)) { throw new PhutilArgumentUsageException( - "Specified max date must come after specified min date."); + 'Specified max date must come after specified min date.'); } $is_dry_run = $args->getArg('dry-run'); @@ -124,7 +124,7 @@ final class PhabricatorAuditManagementDeleteWorkflow $console = PhutilConsole::getConsole(); if (!$audits) { - $console->writeErr("%s\n", pht("No audits match the query.")); + $console->writeErr("%s\n", pht('No audits match the query.')); return 0; } @@ -140,7 +140,7 @@ final class PhabricatorAuditManagementDeleteWorkflow $console->writeOut( "%s\n", sprintf( - "%10d %-16s %-16s %s: %s", + '%10d %-16s %-16s %s: %s', $audit->getID(), $handles[$audit->getAuditorPHID()]->getName(), PhabricatorAuditStatusConstants::getStatusName( @@ -158,7 +158,7 @@ final class PhabricatorAuditManagementDeleteWorkflow if ($console->confirm($message)) { foreach ($audits as $audit) { $id = $audit->getID(); - $console->writeOut("%s\n", pht("Deleting audit %d...", $id)); + $console->writeOut("%s\n", pht('Deleting audit %d...', $id)); $audit->delete(); } } diff --git a/src/applications/auth/controller/PhabricatorAuthConfirmLinkController.php b/src/applications/auth/controller/PhabricatorAuthConfirmLinkController.php index 5834984a65..fb0dea8a48 100644 --- a/src/applications/auth/controller/PhabricatorAuthConfirmLinkController.php +++ b/src/applications/auth/controller/PhabricatorAuthConfirmLinkController.php @@ -58,8 +58,8 @@ final class PhabricatorAuthConfirmLinkController 'class' => 'aphront-form-instructions', ), pht( - "Confirm the link with this %s account. This account will be ". - "able to log in to your Phabricator account.", + 'Confirm the link with this %s account. This account will be '. + 'able to log in to your Phabricator account.', $provider->getProviderName()))) ->appendChild( id(new PhabricatorAuthAccountView()) diff --git a/src/applications/auth/controller/PhabricatorAuthLoginController.php b/src/applications/auth/controller/PhabricatorAuthLoginController.php index 804a2731d2..77941207ec 100644 --- a/src/applications/auth/controller/PhabricatorAuthLoginController.php +++ b/src/applications/auth/controller/PhabricatorAuthLoginController.php @@ -68,7 +68,7 @@ final class PhabricatorAuthLoginController if (!$account) { throw new Exception( - "Auth provider failed to load an account from processLoginRequest()!"); + 'Auth provider failed to load an account from processLoginRequest()!'); } if ($account->getUserPHID()) { @@ -164,7 +164,7 @@ final class PhabricatorAuthLoginController $next_uri) { if ($account->getUserPHID()) { - throw new Exception("Account is already registered or linked."); + throw new Exception('Account is already registered or linked.'); } // Regenerate the registration secret key, set it on the external account, diff --git a/src/applications/auth/controller/PhabricatorAuthRegisterController.php b/src/applications/auth/controller/PhabricatorAuthRegisterController.php index ffcb42d642..1bcb1414b0 100644 --- a/src/applications/auth/controller/PhabricatorAuthRegisterController.php +++ b/src/applications/auth/controller/PhabricatorAuthRegisterController.php @@ -163,7 +163,7 @@ final class PhabricatorAuthRegisterController $captcha_ok = AphrontFormRecaptchaControl::processCaptcha($request); if (!$captcha_ok) { - $errors[] = pht("Captcha response is incorrect, try again."); + $errors[] = pht('Captcha response is incorrect, try again.'); $e_captcha = pht('Invalid'); } } @@ -479,12 +479,12 @@ final class PhabricatorAuthRegisterController if (!$providers) { $response = $this->renderError( pht( - "There are no configured default registration providers.")); + 'There are no configured default registration providers.')); return array($account, $provider, $response); } else if (count($providers) > 1) { $response = $this->renderError( pht( - "There are too many configured default registration providers.")); + 'There are too many configured default registration providers.')); return array($account, $provider, $response); } diff --git a/src/applications/auth/controller/PhabricatorAuthStartController.php b/src/applications/auth/controller/PhabricatorAuthStartController.php index bcb0fef83f..b2a559e63f 100644 --- a/src/applications/auth/controller/PhabricatorAuthStartController.php +++ b/src/applications/auth/controller/PhabricatorAuthStartController.php @@ -46,9 +46,9 @@ final class PhabricatorAuthStartController return $this->renderError( pht( - "Your login session is invalid. Try reloading the page and ". - "logging in again. If that does not work, clear your browser ". - "cookies.")); + 'Your login session is invalid. Try reloading the page and '. + 'logging in again. If that does not work, clear your browser '. + 'cookies.')); } } @@ -69,11 +69,11 @@ final class PhabricatorAuthStartController return $this->renderError( pht( - "This Phabricator install is not configured with any enabled ". - "authentication providers which can be used to log in. If you ". - "have accidentally locked yourself out by disabling all providers, ". - "you can use `phabricator/bin/auth recover ` to ". - "recover access to an administrative account.")); + 'This Phabricator install is not configured with any enabled '. + 'authentication providers which can be used to log in. If you '. + 'have accidentally locked yourself out by disabling all providers, '. + 'you can use `phabricator/bin/auth recover ` to '. + 'recover access to an administrative account.')); } $next_uri = $request->getStr('next'); diff --git a/src/applications/auth/controller/PhabricatorAuthUnlinkController.php b/src/applications/auth/controller/PhabricatorAuthUnlinkController.php index a6b1e06f67..822f203bce 100644 --- a/src/applications/auth/controller/PhabricatorAuthUnlinkController.php +++ b/src/applications/auth/controller/PhabricatorAuthUnlinkController.php @@ -73,7 +73,7 @@ final class PhabricatorAuthUnlinkController ->setTitle(pht('No Such Account')) ->appendChild( pht( - "You can not unlink this account because it is not linked.")) + 'You can not unlink this account because it is not linked.')) ->addCancelButton($this->getDoneURI()); return id(new AphrontDialogResponse())->setDialog($dialog); @@ -87,8 +87,8 @@ final class PhabricatorAuthUnlinkController ->setTitle(pht('Permanent Account Link')) ->appendChild( pht( - "You can not unlink this account because the administrator has ". - "configured Phabricator to make links to %s accounts permanent.", + 'You can not unlink this account because the administrator has '. + 'configured Phabricator to make links to %s accounts permanent.', $provider->getProviderName())) ->addCancelButton($this->getDoneURI()); @@ -101,10 +101,10 @@ final class PhabricatorAuthUnlinkController ->setTitle(pht('Last Valid Account')) ->appendChild( pht( - "You can not unlink this account because you have no other ". - "valid login accounts. If you removed it, you would be unable ". - "to login. Add another authentication method before removing ". - "this one.")) + 'You can not unlink this account because you have no other '. + 'valid login accounts. If you removed it, you would be unable '. + 'to login. Add another authentication method before removing '. + 'this one.')) ->addCancelButton($this->getDoneURI()); return id(new AphrontDialogResponse())->setDialog($dialog); diff --git a/src/applications/auth/controller/PhabricatorAuthValidateController.php b/src/applications/auth/controller/PhabricatorAuthValidateController.php index 124984400a..445c466556 100644 --- a/src/applications/auth/controller/PhabricatorAuthValidateController.php +++ b/src/applications/auth/controller/PhabricatorAuthValidateController.php @@ -49,8 +49,8 @@ final class PhabricatorAuthValidateController if (!$failures) { if (!$viewer->getPHID()) { $failures[] = pht( - "Login cookie was set correctly, but your login session is not ". - "valid. Try clearing cookies and logging in again."); + 'Login cookie was set correctly, but your login session is not '. + 'valid. Try clearing cookies and logging in again.'); } } diff --git a/src/applications/auth/controller/PhabricatorEmailLoginController.php b/src/applications/auth/controller/PhabricatorEmailLoginController.php index ba4a829298..857a5dcbc9 100644 --- a/src/applications/auth/controller/PhabricatorEmailLoginController.php +++ b/src/applications/auth/controller/PhabricatorEmailLoginController.php @@ -26,13 +26,13 @@ final class PhabricatorEmailLoginController $captcha_ok = AphrontFormRecaptchaControl::processCaptcha($request); if (!$captcha_ok) { - $errors[] = pht("Captcha response is incorrect, try again."); + $errors[] = pht('Captcha response is incorrect, try again.'); $e_captcha = pht('Invalid'); } $email = $request->getStr('email'); if (!strlen($email)) { - $errors[] = pht("You must provide an email address."); + $errors[] = pht('You must provide an email address.'); $e_email = pht('Required'); } @@ -54,8 +54,8 @@ final class PhabricatorEmailLoginController if (!$target_user) { $errors[] = - pht("There is no account associated with that email address."); - $e_email = pht("Invalid"); + pht('There is no account associated with that email address.'); + $e_email = pht('Invalid'); } if (!$errors) { diff --git a/src/applications/auth/controller/config/PhabricatorAuthEditController.php b/src/applications/auth/controller/config/PhabricatorAuthEditController.php index 846225b8ef..f807c8a922 100644 --- a/src/applications/auth/controller/config/PhabricatorAuthEditController.php +++ b/src/applications/auth/controller/config/PhabricatorAuthEditController.php @@ -177,8 +177,8 @@ final class PhabricatorAuthEditController $email_domains = PhabricatorEnv::getEnvConfig($config_name); if ($email_domains) { $registration_warning = pht( - "Users will only be able to register with a verified email address ". - "at one of the configured [[ %s | %s ]] domains: **%s**", + 'Users will only be able to register with a verified email address '. + 'at one of the configured [[ %s | %s ]] domains: **%s**', $config_href, $config_name, implode(', ', $email_domains)); diff --git a/src/applications/auth/management/PhabricatorAuthManagementLDAPWorkflow.php b/src/applications/auth/management/PhabricatorAuthManagementLDAPWorkflow.php index 795ceeba4a..85ff0b1e0a 100644 --- a/src/applications/auth/management/PhabricatorAuthManagementLDAPWorkflow.php +++ b/src/applications/auth/management/PhabricatorAuthManagementLDAPWorkflow.php @@ -19,33 +19,33 @@ final class PhabricatorAuthManagementLDAPWorkflow if (!$provider) { $console->writeOut( "%s\n", - "The LDAP authentication provider is not enabled."); + 'The LDAP authentication provider is not enabled.'); exit(1); } if (!function_exists('ldap_connect')) { $console->writeOut( "%s\n", - "The LDAP extension is not enabled."); + 'The LDAP extension is not enabled.'); exit(1); } $adapter = $provider->getAdapter(); $console->writeOut("%s\n", pht('Enter LDAP Credentials')); - $username = phutil_console_prompt("LDAP Username: "); + $username = phutil_console_prompt('LDAP Username: '); if (!strlen($username)) { throw new PhutilArgumentUsageException( - pht("You must enter an LDAP username.")); + pht('You must enter an LDAP username.')); } phutil_passthru('stty -echo'); - $password = phutil_console_prompt("LDAP Password: "); + $password = phutil_console_prompt('LDAP Password: '); phutil_passthru('stty echo'); if (!strlen($password)) { throw new PhutilArgumentUsageException( - pht("You must enter an LDAP password.")); + pht('You must enter an LDAP password.')); } $adapter->setLoginUsername($username); diff --git a/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php b/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php index 97e02193cb..fa7bb85360 100644 --- a/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php +++ b/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php @@ -67,12 +67,12 @@ final class PhabricatorAuthManagementRefreshWorkflow if (!$accounts) { throw new PhutilArgumentUsageException( - pht("No accounts match the arguments!")); + pht('No accounts match the arguments!')); } else { $console->writeOut( "%s\n", pht( - "Found %s account(s) to refresh.", + 'Found %s account(s) to refresh.', new PhutilNumber(count($accounts)))); } @@ -82,7 +82,7 @@ final class PhabricatorAuthManagementRefreshWorkflow $console->writeOut( "%s\n", pht( - "Refreshing account #%d (%s/%s).", + 'Refreshing account #%d (%s/%s).', $account->getID(), $account->getAccountType(), $account->getAccountDomain())); @@ -91,7 +91,7 @@ final class PhabricatorAuthManagementRefreshWorkflow if (empty($providers[$key])) { $console->writeOut( "> %s\n", - pht("Skipping, provider is not enabled or does not exist.")); + pht('Skipping, provider is not enabled or does not exist.')); continue; } @@ -99,7 +99,7 @@ final class PhabricatorAuthManagementRefreshWorkflow if (!($provider instanceof PhabricatorAuthProviderOAuth2)) { $console->writeOut( "> %s\n", - pht("Skipping, provider is not an OAuth2 provider.")); + pht('Skipping, provider is not an OAuth2 provider.')); continue; } @@ -107,7 +107,7 @@ final class PhabricatorAuthManagementRefreshWorkflow if (!$adapter->supportsTokenRefresh()) { $console->writeOut( "> %s\n", - pht("Skipping, provider does not support token refresh.")); + pht('Skipping, provider does not support token refresh.')); continue; } @@ -115,14 +115,14 @@ final class PhabricatorAuthManagementRefreshWorkflow if (!$refresh_token) { $console->writeOut( "> %s\n", - pht("Skipping, provider has no stored refresh token.")); + pht('Skipping, provider has no stored refresh token.')); continue; } $console->writeOut( "+ %s\n", pht( - "Refreshing token, current token expires in %s seconds.", + 'Refreshing token, current token expires in %s seconds.', new PhutilNumber( $account->getProperty('oauth.token.access.expires') - time()))); @@ -137,13 +137,13 @@ final class PhabricatorAuthManagementRefreshWorkflow $console->writeOut( "+ %s\n", pht( - "Refreshed token, new token expires in %s seconds.", + 'Refreshed token, new token expires in %s seconds.', new PhutilNumber( $account->getProperty('oauth.token.access.expires') - time()))); } - $console->writeOut("%s\n", pht("Done.")); + $console->writeOut("%s\n", pht('Done.')); return 0; } diff --git a/src/applications/auth/management/PhabricatorAuthManagementStripWorkflow.php b/src/applications/auth/management/PhabricatorAuthManagementStripWorkflow.php index 740ee4f0d2..f6d057b57a 100644 --- a/src/applications/auth/management/PhabricatorAuthManagementStripWorkflow.php +++ b/src/applications/auth/management/PhabricatorAuthManagementStripWorkflow.php @@ -120,7 +120,7 @@ final class PhabricatorAuthManagementStripWorkflow $console = PhutilConsole::getConsole(); - $console->writeOut("%s\n\n", pht("These auth factors will be stripped:")); + $console->writeOut("%s\n\n", pht('These auth factors will be stripped:')); foreach ($factors as $factor) { $impl = $factor->getImplementation(); diff --git a/src/applications/auth/provider/PhabricatorAuthProvider.php b/src/applications/auth/provider/PhabricatorAuthProvider.php index 9b44b294f3..0381f4822a 100644 --- a/src/applications/auth/provider/PhabricatorAuthProvider.php +++ b/src/applications/auth/provider/PhabricatorAuthProvider.php @@ -16,7 +16,7 @@ abstract class PhabricatorAuthProvider { public function getProviderConfig() { if ($this->providerConfig === null) { throw new Exception( - "Call attachProviderConfig() before getProviderConfig()!"); + 'Call attachProviderConfig() before getProviderConfig()!'); } return $this->providerConfig; } @@ -180,7 +180,7 @@ abstract class PhabricatorAuthProvider { protected function renderLoginForm( AphrontRequest $request, $mode) { - throw new Exception("Not implemented!"); + throw new Exception('Not implemented!'); } public function createProviders() { @@ -198,7 +198,7 @@ abstract class PhabricatorAuthProvider { protected function loadOrCreateAccount($account_id) { if (!strlen($account_id)) { throw new Exception( - "loadOrCreateAccount(...): empty account ID!"); + 'loadOrCreateAccount(...): empty account ID!'); } $adapter = $this->getAdapter(); @@ -295,7 +295,7 @@ abstract class PhabricatorAuthProvider { } public function getDefaultExternalAccount() { - throw new Exception("Not implemented!"); + throw new Exception('Not implemented!'); } public function getLoginOrder() { diff --git a/src/applications/auth/provider/PhabricatorAuthProviderLDAP.php b/src/applications/auth/provider/PhabricatorAuthProviderLDAP.php index ecaf171670..77e6351a65 100644 --- a/src/applications/auth/provider/PhabricatorAuthProviderLDAP.php +++ b/src/applications/auth/provider/PhabricatorAuthProviderLDAP.php @@ -167,7 +167,7 @@ final class PhabricatorAuthProviderLDAP $account_id = $adapter->getAccountID(); DarkConsoleErrorLogPluginAPI::disableDiscardMode(); } else { - throw new Exception("Username and password are required!"); + throw new Exception('Username and password are required!'); } } catch (PhutilAuthCredentialException $ex) { $response = $controller->buildProviderPageResponse( @@ -346,20 +346,20 @@ final class PhabricatorAuthProviderLDAP "All of the attribute names used here are just examples: your LDAP ". "server may use different attribute names."), self::KEY_ALWAYS_SEARCH => pht( - "To search for an LDAP record before authenticating, either check ". - "the **Always Search** checkbox or enter an anonymous ". - "username and password to use to perform the search."), + 'To search for an LDAP record before authenticating, either check '. + 'the **Always Search** checkbox or enter an anonymous '. + 'username and password to use to perform the search.'), self::KEY_USERNAME_ATTRIBUTE => pht( - "Optionally, specify a username attribute to use to prefill usernames ". - "when registering a new account. This is purely cosmetic and does not ". - "affect the login process, but you can configure it to make sure ". - "users get the same default username as their LDAP username, so ". - "usernames remain consistent across systems."), + 'Optionally, specify a username attribute to use to prefill usernames '. + 'when registering a new account. This is purely cosmetic and does not '. + 'affect the login process, but you can configure it to make sure '. + 'users get the same default username as their LDAP username, so '. + 'usernames remain consistent across systems.'), self::KEY_REALNAME_ATTRIBUTES => pht( - "Optionally, specify one or more comma-separated attributes to use to ". - "prefill the \"Real Name\" field when registering a new account. This ". - "is purely cosmetic and does not affect the login process, but can ". - "make registration a little easier."), + 'Optionally, specify one or more comma-separated attributes to use to '. + 'prefill the "Real Name" field when registering a new account. This '. + 'is purely cosmetic and does not affect the login process, but can '. + 'make registration a little easier.'), ); foreach ($labels as $key => $label) { diff --git a/src/applications/auth/provider/PhabricatorAuthProviderOAuth2.php b/src/applications/auth/provider/PhabricatorAuthProviderOAuth2.php index ded2ff79e7..0388e475f2 100644 --- a/src/applications/auth/provider/PhabricatorAuthProviderOAuth2.php +++ b/src/applications/auth/provider/PhabricatorAuthProviderOAuth2.php @@ -198,7 +198,7 @@ abstract class PhabricatorAuthProviderOAuth2 $force_refresh = false) { if ($account->getProviderKey() !== $this->getProviderKey()) { - throw new Exception("Account does not match provider!"); + throw new Exception('Account does not match provider!'); } if (!$force_refresh) { diff --git a/src/applications/auth/provider/PhabricatorAuthProviderPersona.php b/src/applications/auth/provider/PhabricatorAuthProviderPersona.php index dca32ed3dd..0e89c2cbcd 100644 --- a/src/applications/auth/provider/PhabricatorAuthProviderPersona.php +++ b/src/applications/auth/provider/PhabricatorAuthProviderPersona.php @@ -55,12 +55,12 @@ final class PhabricatorAuthProviderPersona $response = null; if (!$request->isAjax()) { - throw new Exception("Expected this request to come via Ajax."); + throw new Exception('Expected this request to come via Ajax.'); } $assertion = $request->getStr('assertion'); if (!$assertion) { - throw new Exception("Expected identity assertion."); + throw new Exception('Expected identity assertion.'); } $adapter->setAssertion($assertion); diff --git a/src/applications/auth/storage/PhabricatorAuthProviderConfigTransaction.php b/src/applications/auth/storage/PhabricatorAuthProviderConfigTransaction.php index f9cf6879d4..154116b5ab 100644 --- a/src/applications/auth/storage/PhabricatorAuthProviderConfigTransaction.php +++ b/src/applications/auth/storage/PhabricatorAuthProviderConfigTransaction.php @@ -7,7 +7,7 @@ final class PhabricatorAuthProviderConfigTransaction const TYPE_REGISTRATION = 'config:registration'; const TYPE_LINK = 'config:link'; const TYPE_UNLINK = 'config:unlink'; - const TYPE_TRUST_EMAILS = "config:trustEmails"; + const TYPE_TRUST_EMAILS = 'config:trustEmails'; const TYPE_PROPERTY = 'config:property'; const PROPERTY_KEY = 'auth:property'; diff --git a/src/applications/base/controller/PhabricatorController.php b/src/applications/base/controller/PhabricatorController.php index 8db15f466e..af1ed6ec21 100644 --- a/src/applications/base/controller/PhabricatorController.php +++ b/src/applications/base/controller/PhabricatorController.php @@ -251,7 +251,7 @@ abstract class PhabricatorController extends AphrontController { public function getApplicationURI($path = '') { if (!$this->getCurrentApplication()) { - throw new Exception("No application!"); + throw new Exception('No application!'); } return $this->getCurrentApplication()->getApplicationURI($path); } @@ -324,7 +324,7 @@ abstract class PhabricatorController extends AphrontController { if (isset($seen[$hash])) { $seen[] = get_class($response); throw new Exception( - "Cycle while reducing proxy responses: ". + 'Cycle while reducing proxy responses: '. implode(' -> ', $seen)); } $seen[$hash] = get_class($response); diff --git a/src/applications/base/controller/__tests__/PhabricatorAccessControlTestCase.php b/src/applications/base/controller/__tests__/PhabricatorAccessControlTestCase.php index 5bc9c32eca..dc6b0713dd 100644 --- a/src/applications/base/controller/__tests__/PhabricatorAccessControlTestCase.php +++ b/src/applications/base/controller/__tests__/PhabricatorAccessControlTestCase.php @@ -63,7 +63,7 @@ final class PhabricatorAccessControlTestCase // Test standard defaults. $this->checkAccess( - "Default", + 'Default', id(clone $controller), $request, array( @@ -82,7 +82,7 @@ final class PhabricatorAccessControlTestCase $env->overrideEnvConfig('auth.require-email-verification', true); $this->checkAccess( - "Email Verification Required", + 'Email Verification Required', id(clone $controller), $request, array( @@ -97,7 +97,7 @@ final class PhabricatorAccessControlTestCase )); $this->checkAccess( - "Email Verification Required, With Exception", + 'Email Verification Required, With Exception', id(clone $controller)->setConfig('email', false), $request, array( @@ -116,7 +116,7 @@ final class PhabricatorAccessControlTestCase // Test admin access. $this->checkAccess( - "Admin Required", + 'Admin Required', id(clone $controller)->setConfig('admin', true), $request, array( @@ -134,7 +134,7 @@ final class PhabricatorAccessControlTestCase // Test disabled access. $this->checkAccess( - "Allow Disabled", + 'Allow Disabled', id(clone $controller)->setConfig('enabled', false), $request, array( @@ -152,7 +152,7 @@ final class PhabricatorAccessControlTestCase // Test no login required. $this->checkAccess( - "No Login Required", + 'No Login Required', id(clone $controller)->setConfig('login', false), $request, array( @@ -170,7 +170,7 @@ final class PhabricatorAccessControlTestCase // Test public access. $this->checkAccess( - "No Login Required", + 'No Login Required', id(clone $controller)->setConfig('public', true), $request, array( @@ -185,7 +185,7 @@ final class PhabricatorAccessControlTestCase $env->overrideEnvConfig('policy.allow-public', true); $this->checkAccess( - "Public + configured", + 'Public + configured', id(clone $controller)->setConfig('public', true), $request, array( @@ -210,7 +210,7 @@ final class PhabricatorAccessControlTestCase $app_controller = id(clone $controller)->setCurrentApplication($app); $this->checkAccess( - "Application Controller", + 'Application Controller', $app_controller, $request, array( @@ -225,7 +225,7 @@ final class PhabricatorAccessControlTestCase )); $this->checkAccess( - "Application Controller", + 'Application Controller', id(clone $app_controller)->setConfig('login', false), $request, array( diff --git a/src/applications/cache/PhabricatorKeyValueDatabaseCache.php b/src/applications/cache/PhabricatorKeyValueDatabaseCache.php index aa641ab703..5bdf60f660 100644 --- a/src/applications/cache/PhabricatorKeyValueDatabaseCache.php +++ b/src/applications/cache/PhabricatorKeyValueDatabaseCache.php @@ -136,7 +136,7 @@ final class PhabricatorKeyValueDatabaseCache private function willWriteValue($key, $value) { if (!is_string($value)) { - throw new Exception("Only strings may be written to the DB cache!"); + throw new Exception('Only strings may be written to the DB cache!'); } static $can_deflate; @@ -162,7 +162,7 @@ final class PhabricatorKeyValueDatabaseCache case self::CACHE_FORMAT_DEFLATE: return PhabricatorCaches::inflateData($value); default: - throw new Exception("Unknown cache format."); + throw new Exception('Unknown cache format.'); } } diff --git a/src/applications/cache/management/PhabricatorCacheManagementPurgeWorkflow.php b/src/applications/cache/management/PhabricatorCacheManagementPurgeWorkflow.php index 709c66ba6b..2d6de653bc 100644 --- a/src/applications/cache/management/PhabricatorCacheManagementPurgeWorkflow.php +++ b/src/applications/cache/management/PhabricatorCacheManagementPurgeWorkflow.php @@ -52,19 +52,19 @@ final class PhabricatorCacheManagementPurgeWorkflow } if ($purge['remarkup']) { - $console->writeOut("Purging remarkup cache..."); + $console->writeOut('Purging remarkup cache...'); $this->purgeRemarkupCache(); $console->writeOut("done.\n"); } if ($purge['changeset']) { - $console->writeOut("Purging changeset cache..."); + $console->writeOut('Purging changeset cache...'); $this->purgeChangesetCache(); $console->writeOut("done.\n"); } if ($purge['general']) { - $console->writeOut("Purging general cache..."); + $console->writeOut('Purging general cache...'); $this->purgeGeneralCache(); $console->writeOut("done.\n"); } diff --git a/src/applications/calendar/view/AphrontCalendarEventView.php b/src/applications/calendar/view/AphrontCalendarEventView.php index 6ab2b9d8e1..c34d3c6d5d 100644 --- a/src/applications/calendar/view/AphrontCalendarEventView.php +++ b/src/applications/calendar/view/AphrontCalendarEventView.php @@ -88,7 +88,7 @@ final class AphrontCalendarEventView extends AphrontView { } public function render() { - throw new Exception("Events are only rendered indirectly."); + throw new Exception('Events are only rendered indirectly.'); } } diff --git a/src/applications/chatlog/conduit/ConduitAPI_chatlog_query_Method.php b/src/applications/chatlog/conduit/ConduitAPI_chatlog_query_Method.php index b3c01b0d21..cb5328eaa1 100644 --- a/src/applications/chatlog/conduit/ConduitAPI_chatlog_query_Method.php +++ b/src/applications/chatlog/conduit/ConduitAPI_chatlog_query_Method.php @@ -11,7 +11,7 @@ final class ConduitAPI_chatlog_query_Method } public function getMethodDescription() { - return "Retrieve chatter."; + return 'Retrieve chatter.'; } public function defineParamTypes() { diff --git a/src/applications/chatlog/conduit/ConduitAPI_chatlog_record_Method.php b/src/applications/chatlog/conduit/ConduitAPI_chatlog_record_Method.php index a72b635263..d31f040b5e 100644 --- a/src/applications/chatlog/conduit/ConduitAPI_chatlog_record_Method.php +++ b/src/applications/chatlog/conduit/ConduitAPI_chatlog_record_Method.php @@ -11,7 +11,7 @@ final class ConduitAPI_chatlog_record_Method } public function getMethodDescription() { - return "Record chatter."; + return 'Record chatter.'; } public function defineParamTypes() { diff --git a/src/applications/chatlog/controller/PhabricatorChatLogChannelLogController.php b/src/applications/chatlog/controller/PhabricatorChatLogChannelLogController.php index 1bcdf1bc59..b5e78baf27 100644 --- a/src/applications/chatlog/controller/PhabricatorChatLogChannelLogController.php +++ b/src/applications/chatlog/controller/PhabricatorChatLogChannelLogController.php @@ -152,7 +152,7 @@ final class PhabricatorChatLogChannelLogController array( 'href' => $first_uri, ), - "\xC2\xAB ". pht("Newest")); + "\xC2\xAB ". pht('Newest')); } $prev_uri = $pager->getPrevPageURI(); @@ -162,7 +162,7 @@ final class PhabricatorChatLogChannelLogController array( 'href' => $prev_uri, ), - "\xE2\x80\xB9 " . pht("Newer")); + "\xE2\x80\xB9 " . pht('Newer')); } $next_uri = $pager->getNextPageURI(); @@ -172,7 +172,7 @@ final class PhabricatorChatLogChannelLogController array( 'href' => $next_uri, ), - pht("Older") . " \xE2\x80\xBA"); + pht('Older') . " \xE2\x80\xBA"); } $pager_top = phutil_tag( @@ -224,7 +224,7 @@ final class PhabricatorChatLogChannelLogController array( 'href' => '#latest' ), - pht("Jump to Bottom") . " \xE2\x96\xBE"); + pht('Jump to Bottom') . " \xE2\x96\xBE"); $jump = phutil_tag( 'div', diff --git a/src/applications/conduit/call/ConduitCall.php b/src/applications/conduit/call/ConduitCall.php index 40bab071e2..99f266ff1e 100644 --- a/src/applications/conduit/call/ConduitCall.php +++ b/src/applications/conduit/call/ConduitCall.php @@ -114,7 +114,7 @@ final class ConduitCall { if (!$allow_public) { if (!$user->isLoggedIn() && !$user->isOmnipotent()) { // TODO: As per below, this should get centralized and cleaned up. - throw new ConduitException("ERR-INVALID-AUTH"); + throw new ConduitException('ERR-INVALID-AUTH'); } } @@ -131,8 +131,8 @@ final class ConduitCall { if (!$can_view) { throw new ConduitException( pht( - "You do not have access to the application which provides this ". - "API method.")); + 'You do not have access to the application which provides this '. + 'API method.')); } } } @@ -142,7 +142,7 @@ final class ConduitCall { $client = new ConduitClient($server); $params = $this->request->getAllParameters(); - $params["__conduit__"]["isProxied"] = true; + $params['__conduit__']['isProxied'] = true; if ($this->handler->shouldRequireAuthentication()) { $client->callMethodSynchronous( @@ -152,7 +152,7 @@ final class ConduitCall { 'clientVersion' => '1.0', 'user' => $this->getUser()->getUserName(), 'certificate' => $this->getUser()->getConduitCertificate(), - '__conduit__' => $params["__conduit__"], + '__conduit__' => $params['__conduit__'], )); } diff --git a/src/applications/conduit/call/__tests__/ConduitCallTestCase.php b/src/applications/conduit/call/__tests__/ConduitCallTestCase.php index e33f7866fa..d622e0d008 100644 --- a/src/applications/conduit/call/__tests__/ConduitCallTestCase.php +++ b/src/applications/conduit/call/__tests__/ConduitCallTestCase.php @@ -23,6 +23,6 @@ final class ConduitCallTestCase extends PhabricatorTestCase { $this->assertTrue( ($caught instanceof ConduitException), - "user.whoami should require authentication"); + 'user.whoami should require authentication'); } } diff --git a/src/applications/conduit/config/PhabricatorConduitConfigOptions.php b/src/applications/conduit/config/PhabricatorConduitConfigOptions.php index 11f00d7ec0..3f9fd2d5d5 100644 --- a/src/applications/conduit/config/PhabricatorConduitConfigOptions.php +++ b/src/applications/conduit/config/PhabricatorConduitConfigOptions.php @@ -4,18 +4,18 @@ final class PhabricatorConduitConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Conduit"); + return pht('Conduit'); } public function getDescription() { - return pht("Configure conduit."); + return pht('Configure conduit.'); } public function getOptions() { return array( - $this->newOption("conduit.servers", "list", array()) + $this->newOption('conduit.servers', 'list', array()) ->setLocked(true) - ->setSummary(pht("Servers that conduit can connect to.")) + ->setSummary(pht('Servers that conduit can connect to.')) ->setDescription( pht( "Set an array of servers where conduit can connect to. This is ". diff --git a/src/applications/conduit/controller/PhabricatorConduitAPIController.php b/src/applications/conduit/controller/PhabricatorConduitAPIController.php index 997a2ac857..f2de9736e2 100644 --- a/src/applications/conduit/controller/PhabricatorConduitAPIController.php +++ b/src/applications/conduit/controller/PhabricatorConduitAPIController.php @@ -168,7 +168,7 @@ final class PhabricatorConduitAPIController $user_name) { if (!$api_request->getUser()->getIsAdmin()) { - throw new Exception("Only administrators can use actAsUser"); + throw new Exception('Only administrators can use actAsUser'); } $user = id(new PhabricatorUser())->loadOneWhere( diff --git a/src/applications/conduit/method/ConduitAPI_conduit_connect_Method.php b/src/applications/conduit/method/ConduitAPI_conduit_connect_Method.php index bbe5376506..5547ee37c6 100644 --- a/src/applications/conduit/method/ConduitAPI_conduit_connect_Method.php +++ b/src/applications/conduit/method/ConduitAPI_conduit_connect_Method.php @@ -14,7 +14,7 @@ final class ConduitAPI_conduit_connect_Method extends ConduitAPIMethod { } public function getMethodDescription() { - return "Connect a session-based client."; + return 'Connect a session-based client.'; } public function defineParamTypes() { @@ -35,22 +35,22 @@ final class ConduitAPI_conduit_connect_Method extends ConduitAPIMethod { public function defineErrorTypes() { return array( - "ERR-BAD-VERSION" => - "Client/server version mismatch. Upgrade your server or downgrade ". - "your client.", - "NEW-ARC-VERSION" => - "Client/server version mismatch. Upgrade your client.", - "ERR-UNKNOWN-CLIENT" => - "Client is unknown.", - "ERR-INVALID-USER" => - "The username you are attempting to authenticate with is not valid.", - "ERR-INVALID-CERTIFICATE" => - "Your authentication certificate for this server is invalid.", - "ERR-INVALID-TOKEN" => + 'ERR-BAD-VERSION' => + 'Client/server version mismatch. Upgrade your server or downgrade '. + 'your client.', + 'NEW-ARC-VERSION' => + 'Client/server version mismatch. Upgrade your client.', + 'ERR-UNKNOWN-CLIENT' => + 'Client is unknown.', + 'ERR-INVALID-USER' => + 'The username you are attempting to authenticate with is not valid.', + 'ERR-INVALID-CERTIFICATE' => + 'Your authentication certificate for this server is invalid.', + 'ERR-INVALID-TOKEN' => "The challenge token you are authenticating with is outside of the ". "allowed time range. Either your system clock is out of whack or ". "you're executing a replay attack.", - "ERR-NO-CERTIFICATE" => "This server requires authentication.", + 'ERR-NO-CERTIFICATE' => 'This server requires authentication.', ); } @@ -126,13 +126,13 @@ final class ConduitAPI_conduit_connect_Method extends ConduitAPIMethod { throw id(new ConduitException('ERR-INVALID-TOKEN')) ->setErrorDescription( pht( - "The request you submitted is signed with a timestamp, but that ". - "timestamp is not within %s of the current time. The ". - "signed timestamp is %s (%s), and the current server time is ". - "%s (%s). This is a difference of %s seconds, but the ". - "timestamp must differ from the server time by no more than ". - "%s seconds. Your client or server clock may not be set ". - "correctly.", + 'The request you submitted is signed with a timestamp, but that '. + 'timestamp is not within %s of the current time. The '. + 'signed timestamp is %s (%s), and the current server time is '. + '%s (%s). This is a difference of %s seconds, but the '. + 'timestamp must differ from the server time by no more than '. + '%s seconds. Your client or server clock may not be set '. + 'correctly.', phabricator_format_relative_time($threshold), $token, date('r', $token), diff --git a/src/applications/conduit/method/ConduitAPI_conduit_getcertificate_Method.php b/src/applications/conduit/method/ConduitAPI_conduit_getcertificate_Method.php index 45115795cd..c4ffcf1895 100644 --- a/src/applications/conduit/method/ConduitAPI_conduit_getcertificate_Method.php +++ b/src/applications/conduit/method/ConduitAPI_conduit_getcertificate_Method.php @@ -15,7 +15,7 @@ final class ConduitAPI_conduit_getcertificate_Method extends ConduitAPIMethod { } public function getMethodDescription() { - return "Retrieve certificate information for a user."; + return 'Retrieve certificate information for a user.'; } public function defineParamTypes() { @@ -31,10 +31,10 @@ final class ConduitAPI_conduit_getcertificate_Method extends ConduitAPIMethod { public function defineErrorTypes() { return array( - "ERR-BAD-TOKEN" => "Token does not exist or has expired.", - "ERR-RATE-LIMIT" => - "You have made too many invalid token requests recently. Wait before ". - "making more.", + 'ERR-BAD-TOKEN' => 'Token does not exist or has expired.', + 'ERR-RATE-LIMIT' => + 'You have made too many invalid token requests recently. Wait before '. + 'making more.', ); } @@ -70,7 +70,7 @@ final class ConduitAPI_conduit_getcertificate_Method extends ConduitAPIMethod { 'phid = %s', $info->getUserPHID()); if (!$user) { - throw new Exception("Certificate token points to an invalid user!"); + throw new Exception('Certificate token points to an invalid user!'); } return array( diff --git a/src/applications/conduit/method/ConduitAPI_conduit_ping_Method.php b/src/applications/conduit/method/ConduitAPI_conduit_ping_Method.php index 35c95ada30..d05b3cd1a8 100644 --- a/src/applications/conduit/method/ConduitAPI_conduit_ping_Method.php +++ b/src/applications/conduit/method/ConduitAPI_conduit_ping_Method.php @@ -10,7 +10,7 @@ final class ConduitAPI_conduit_ping_Method extends ConduitAPIMethod { } public function getMethodDescription() { - return "Basic ping for monitoring or a health-check."; + return 'Basic ping for monitoring or a health-check.'; } public function defineParamTypes() { diff --git a/src/applications/conduit/method/ConduitAPI_conduit_query_Method.php b/src/applications/conduit/method/ConduitAPI_conduit_query_Method.php index 4c64884f1b..b8f0f45335 100644 --- a/src/applications/conduit/method/ConduitAPI_conduit_query_Method.php +++ b/src/applications/conduit/method/ConduitAPI_conduit_query_Method.php @@ -6,7 +6,7 @@ final class ConduitAPI_conduit_query_Method extends ConduitAPIMethod { public function getMethodDescription() { - return "Returns the parameters of the Conduit methods."; + return 'Returns the parameters of the Conduit methods.'; } public function defineParamTypes() { @@ -30,10 +30,10 @@ final class ConduitAPI_conduit_query_Method extends ConduitAPIMethod { $names_to_params = array(); foreach ($classes as $class) { - $method_name = $class["name"]; + $method_name = $class['name']; $obj = newv($method_name, array()); $names_to_params[$this->getAPIMethodNameFromClassName($method_name)] = - array("params" => $obj->defineParamTypes()); + array('params' => $obj->defineParamTypes()); } return $names_to_params; } diff --git a/src/applications/conduit/protocol/ConduitAPIRequest.php b/src/applications/conduit/protocol/ConduitAPIRequest.php index 64752a85bc..1a3fad4853 100644 --- a/src/applications/conduit/protocol/ConduitAPIRequest.php +++ b/src/applications/conduit/protocol/ConduitAPIRequest.php @@ -38,9 +38,9 @@ final class ConduitAPIRequest { public function getUser() { if (!$this->user) { throw new Exception( - "You can not access the user inside the implementation of a Conduit ". - "method which does not require authentication (as per ". - "shouldRequireAuthentication())."); + 'You can not access the user inside the implementation of a Conduit '. + 'method which does not require authentication (as per '. + 'shouldRequireAuthentication()).'); } return $this->user; } diff --git a/src/applications/conduit/ssh/ConduitSSHWorkflow.php b/src/applications/conduit/ssh/ConduitSSHWorkflow.php index 74221b51dc..17da348e12 100644 --- a/src/applications/conduit/ssh/ConduitSSHWorkflow.php +++ b/src/applications/conduit/ssh/ConduitSSHWorkflow.php @@ -18,9 +18,9 @@ final class ConduitSSHWorkflow extends PhabricatorSSHWorkflow { $methodv = $args->getArg('method'); if (!$methodv) { - throw new Exception("No Conduit method provided."); + throw new Exception('No Conduit method provided.'); } else if (count($methodv) > 1) { - throw new Exception("Too many Conduit methods provided."); + throw new Exception('Too many Conduit methods provided.'); } $method = head($methodv); @@ -28,7 +28,7 @@ final class ConduitSSHWorkflow extends PhabricatorSSHWorkflow { $json = $this->readAllInput(); $raw_params = json_decode($json, true); if (!is_array($raw_params)) { - throw new Exception("Invalid JSON input."); + throw new Exception('Invalid JSON input.'); } $params = idx($raw_params, 'params', '[]'); diff --git a/src/applications/config/check/PhabricatorSetupCheckAPC.php b/src/applications/config/check/PhabricatorSetupCheckAPC.php index 0db31540b2..943baf5d79 100644 --- a/src/applications/config/check/PhabricatorSetupCheckAPC.php +++ b/src/applications/config/check/PhabricatorSetupCheckAPC.php @@ -19,7 +19,7 @@ final class PhabricatorSetupCheckAPC extends PhabricatorSetupCheck { } if (!ini_get('apc.enabled')) { - $summary = pht("Enabling APC will dramatically improve performance."); + $summary = pht('Enabling APC will dramatically improve performance.'); $message = pht( "The PHP extension 'APC' is installed, but not enabled in your PHP ". "configuration. Enabling it will dramatically improve Phabricator ". diff --git a/src/applications/config/check/PhabricatorSetupCheckBaseURI.php b/src/applications/config/check/PhabricatorSetupCheckBaseURI.php index 1ad78a6172..8863a4af39 100644 --- a/src/applications/config/check/PhabricatorSetupCheckBaseURI.php +++ b/src/applications/config/check/PhabricatorSetupCheckBaseURI.php @@ -55,7 +55,7 @@ final class PhabricatorSetupCheckBaseURI extends PhabricatorSetupCheck { $this ->newIssue('config.phabricator.base-uri') ->setShortName(pht('No Base URI')) - ->setName(pht("Base URI Not Configured")) + ->setName(pht('Base URI Not Configured')) ->setSummary($summary) ->setMessage($message) ->addCommand( diff --git a/src/applications/config/check/PhabricatorSetupCheckExtraConfig.php b/src/applications/config/check/PhabricatorSetupCheckExtraConfig.php index 88ef4a4da0..e7d295c9c2 100644 --- a/src/applications/config/check/PhabricatorSetupCheckExtraConfig.php +++ b/src/applications/config/check/PhabricatorSetupCheckExtraConfig.php @@ -29,7 +29,7 @@ final class PhabricatorSetupCheckExtraConfig extends PhabricatorSetupCheck { $short = pht('Obsolete Config'); $name = pht('Obsolete Configuration Option "%s"', $key); } else { - $summary = pht("This option is not recognized. It may be misspelled."); + $summary = pht('This option is not recognized. It may be misspelled.'); $message = pht( "The configuration option '%s' is not recognized. It may be ". "misspelled, or it might have existed in an older version of ". @@ -65,8 +65,8 @@ final class PhabricatorSetupCheckExtraConfig extends PhabricatorSetupCheck { } $message = $message."\n\n".pht( - "This configuration value is defined in these %d ". - "configuration source(s): %s.", + 'This configuration value is defined in these %d '. + 'configuration source(s): %s.', count($found), implode(', ', $found)); $issue->setMessage($message); diff --git a/src/applications/config/check/PhabricatorSetupCheckMail.php b/src/applications/config/check/PhabricatorSetupCheckMail.php index a3347a03b4..cc878ca9b8 100644 --- a/src/applications/config/check/PhabricatorSetupCheckMail.php +++ b/src/applications/config/check/PhabricatorSetupCheckMail.php @@ -41,7 +41,7 @@ final class PhabricatorSetupCheckMail extends PhabricatorSetupCheck { 'different mail adapter.'); $this->newIssue('config.amazon-ses.access-key') - ->setName(pht("Amazon SES Access Key Not Set")) + ->setName(pht('Amazon SES Access Key Not Set')) ->setMessage($message) ->addRelatedPhabricatorConfig('metamta.mail-adapter') ->addPhabricatorConfig('amazon-ses.access-key'); @@ -54,7 +54,7 @@ final class PhabricatorSetupCheckMail extends PhabricatorSetupCheck { 'different mail adapter.'); $this->newIssue('config.amazon-ses.secret-key') - ->setName(pht("Amazon SES Secret Key Not Set")) + ->setName(pht('Amazon SES Secret Key Not Set')) ->setMessage($message) ->addRelatedPhabricatorConfig('metamta.mail-adapter') ->addPhabricatorConfig('amazon-ses.secret-key'); @@ -71,7 +71,7 @@ final class PhabricatorSetupCheckMail extends PhabricatorSetupCheck { 'a "From" address, or choose a different mail adapter.'); $this->newIssue('config.metamta.default-address') - ->setName(pht("No SES From Address Configured")) + ->setName(pht('No SES From Address Configured')) ->setMessage($message) ->addRelatedPhabricatorConfig('metamta.mail-adapter') ->addPhabricatorConfig('metamta.default-address'); diff --git a/src/applications/config/check/PhabricatorSetupCheckMySQL.php b/src/applications/config/check/PhabricatorSetupCheckMySQL.php index b01212a6d3..117cc2558e 100644 --- a/src/applications/config/check/PhabricatorSetupCheckMySQL.php +++ b/src/applications/config/check/PhabricatorSetupCheckMySQL.php @@ -25,12 +25,12 @@ final class PhabricatorSetupCheckMySQL extends PhabricatorSetupCheck { ->setMessage($message); } - $mode_string = queryfx_one($conn_raw, "SELECT @@sql_mode"); + $mode_string = queryfx_one($conn_raw, 'SELECT @@sql_mode'); $modes = explode(',', $mode_string['@@sql_mode']); if (!in_array('STRICT_ALL_TABLES', $modes)) { $summary = pht( - "MySQL is not in strict mode, but using strict mode is strongly ". - "encouraged."); + 'MySQL is not in strict mode, but using strict mode is strongly '. + 'encouraged.'); $message = pht( "On your MySQL instance, the global %s is not set to %s. ". diff --git a/src/applications/config/check/PhabricatorSetupCheckPath.php b/src/applications/config/check/PhabricatorSetupCheckPath.php index 6b3c1bfb68..f4c173d157 100644 --- a/src/applications/config/check/PhabricatorSetupCheckPath.php +++ b/src/applications/config/check/PhabricatorSetupCheckPath.php @@ -103,8 +103,8 @@ final class PhabricatorSetupCheckPath extends PhabricatorSetupCheck { ->setName(pht('$PATH Component Unusable')) ->setSummary( pht( - "A component of the configured PATH can not be used by ". - "the webserver: %s", + 'A component of the configured PATH can not be used by '. + 'the webserver: %s', $path_part)) ->setMessage( pht( diff --git a/src/applications/config/check/PhabricatorSetupCheckRepositories.php b/src/applications/config/check/PhabricatorSetupCheckRepositories.php index 724b538eb9..a938132479 100644 --- a/src/applications/config/check/PhabricatorSetupCheckRepositories.php +++ b/src/applications/config/check/PhabricatorSetupCheckRepositories.php @@ -18,8 +18,8 @@ final class PhabricatorSetupCheckRepositories extends PhabricatorSetupCheck { if (!Filesystem::pathExists($repo_path)) { $summary = pht( - "The path for local repositories does not exist, or is not ". - "readable by the webserver."); + 'The path for local repositories does not exist, or is not '. + 'readable by the webserver.'); $message = pht( "The directory for local repositories (%s) does not exist, or is not ". "readable by the webserver. Phabricator uses this directory to store ". diff --git a/src/applications/config/check/PhabricatorSetupCheckTimezone.php b/src/applications/config/check/PhabricatorSetupCheckTimezone.php index ebff55f6f6..01ba5e278f 100644 --- a/src/applications/config/check/PhabricatorSetupCheckTimezone.php +++ b/src/applications/config/check/PhabricatorSetupCheckTimezone.php @@ -31,8 +31,8 @@ final class PhabricatorSetupCheckTimezone extends PhabricatorSetupCheck { } $summary = pht( - "Without a configured timezone, PHP will emit warnings when working ". - "with dates, and dates and times may not display correctly."); + 'Without a configured timezone, PHP will emit warnings when working '. + 'with dates, and dates and times may not display correctly.'); $message = pht( "Your configuration fails to specify a server timezone. You can either ". diff --git a/src/applications/config/controller/PhabricatorConfigEditController.php b/src/applications/config/controller/PhabricatorConfigEditController.php index 18815ab83b..ab346ccb59 100644 --- a/src/applications/config/controller/PhabricatorConfigEditController.php +++ b/src/applications/config/controller/PhabricatorConfigEditController.php @@ -24,8 +24,8 @@ final class PhabricatorConfigEditController $ancient[$this->key]); } else { $desc = pht( - "This configuration option is unknown. It may be misspelled, ". - "or have existed in a previous version of Phabricator."); + 'This configuration option is unknown. It may be misspelled, '. + 'or have existed in a previous version of Phabricator.'); } // This may be a dead config entry, which existed in the past but no @@ -112,8 +112,8 @@ final class PhabricatorConfigEditController ->setErrors($errors); } else if ($option->getHidden()) { $msg = pht( - "This configuration is hidden and can not be edited or viewed from ". - "the web interface."); + 'This configuration is hidden and can not be edited or viewed from '. + 'the web interface.'); $error_view = id(new AphrontErrorView()) ->setTitle(pht('Configuration Hidden')) @@ -121,8 +121,8 @@ final class PhabricatorConfigEditController ->appendChild(phutil_tag('p', array(), $msg)); } else if ($option->getLocked()) { $msg = pht( - "This configuration is locked and can not be edited from the web ". - "interface. Use `./bin/config` in `phabricator/` to edit it."); + 'This configuration is locked and can not be edited from the web '. + 'interface. Use `./bin/config` in `phabricator/` to edit it.'); $error_view = id(new AphrontErrorView()) ->setTitle(pht('Configuration Locked')) diff --git a/src/applications/config/controller/PhabricatorConfigIgnoreController.php b/src/applications/config/controller/PhabricatorConfigIgnoreController.php index 72fef3c366..9bc23d3458 100644 --- a/src/applications/config/controller/PhabricatorConfigIgnoreController.php +++ b/src/applications/config/controller/PhabricatorConfigIgnoreController.php @@ -31,8 +31,8 @@ final class PhabricatorConfigIgnoreController $title = pht('Unignore this setup issue?'); $submit_title = pht('Unignore'); $body = pht( - "This issue will no longer be suppressed, and will return to its ". - "rightful place as a global setup warning."); + 'This issue will no longer be suppressed, and will return to its '. + 'rightful place as a global setup warning.'); } else { throw new Exception('Unrecognized verb: ' . $this->verb); } diff --git a/src/applications/config/controller/PhabricatorConfigIssueListController.php b/src/applications/config/controller/PhabricatorConfigIssueListController.php index 71779d797b..9462c1f86a 100644 --- a/src/applications/config/controller/PhabricatorConfigIssueListController.php +++ b/src/applications/config/controller/PhabricatorConfigIssueListController.php @@ -15,7 +15,7 @@ final class PhabricatorConfigIssueListController PhabricatorSetupCheck::countUnignoredIssues($issues)); $list = $this->buildIssueList($issues); - $list->setNoDataString(pht("There are no open setup issues.")); + $list->setNoDataString(pht('There are no open setup issues.')); $header = id(new PHUIHeaderView()) ->setHeader(pht('Open Phabricator Setup Issues')); diff --git a/src/applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php b/src/applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php index cf1f05be74..00dbec1180 100644 --- a/src/applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php +++ b/src/applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php @@ -23,14 +23,14 @@ final class PhabricatorConfigManagementDeleteWorkflow $argv = $args->getArg('args'); if (count($argv) == 0) { throw new PhutilArgumentUsageException( - "Specify a configuration key to delete."); + 'Specify a configuration key to delete.'); } $key = $argv[0]; if (count($argv) > 1) { throw new PhutilArgumentUsageException( - "Too many arguments: expected one key."); + 'Too many arguments: expected one key.'); } $config = new PhabricatorConfigLocalSource(); diff --git a/src/applications/config/management/PhabricatorConfigManagementGetWorkflow.php b/src/applications/config/management/PhabricatorConfigManagementGetWorkflow.php index 49758e084d..09f0b95838 100644 --- a/src/applications/config/management/PhabricatorConfigManagementGetWorkflow.php +++ b/src/applications/config/management/PhabricatorConfigManagementGetWorkflow.php @@ -23,14 +23,14 @@ final class PhabricatorConfigManagementGetWorkflow $argv = $args->getArg('args'); if (count($argv) == 0) { throw new PhutilArgumentUsageException( - "Specify a configuration key to get."); + 'Specify a configuration key to get.'); } $key = $argv[0]; if (count($argv) > 1) { throw new PhutilArgumentUsageException( - "Too many arguments: expected one key."); + 'Too many arguments: expected one key.'); } $options = PhabricatorApplicationConfigOptions::loadAllOptions(); diff --git a/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php b/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php index 61afa1c6ee..46464c6929 100644 --- a/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php +++ b/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php @@ -22,7 +22,7 @@ final class PhabricatorConfigManagementSetWorkflow $argv = $args->getArg('args'); if (count($argv) == 0) { throw new PhutilArgumentUsageException( - "Specify a configuration key and a value to set it to."); + 'Specify a configuration key and a value to set it to.'); } $key = $argv[0]; @@ -36,7 +36,7 @@ final class PhabricatorConfigManagementSetWorkflow if (count($argv) > 2) { throw new PhutilArgumentUsageException( - "Too many arguments: expected one key and one value."); + 'Too many arguments: expected one key and one value.'); } $options = PhabricatorApplicationConfigOptions::loadAllOptions(); diff --git a/src/applications/config/option/PhabricatorAWSConfigOptions.php b/src/applications/config/option/PhabricatorAWSConfigOptions.php index 88042c410c..51e242a7b3 100644 --- a/src/applications/config/option/PhabricatorAWSConfigOptions.php +++ b/src/applications/config/option/PhabricatorAWSConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorAWSConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Amazon Web Services"); + return pht('Amazon Web Services'); } public function getDescription() { - return pht("Configure integration with AWS (EC2, SES, S3, etc)."); + return pht('Configure integration with AWS (EC2, SES, S3, etc).'); } public function getOptions() { diff --git a/src/applications/config/option/PhabricatorAccessLogConfigOptions.php b/src/applications/config/option/PhabricatorAccessLogConfigOptions.php index f03056b72b..c413088fa6 100644 --- a/src/applications/config/option/PhabricatorAccessLogConfigOptions.php +++ b/src/applications/config/option/PhabricatorAccessLogConfigOptions.php @@ -4,57 +4,57 @@ final class PhabricatorAccessLogConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Access Logs"); + return pht('Access Logs'); } public function getDescription() { - return pht("Configure the access logs, which log HTTP/SSH requests."); + return pht('Configure the access logs, which log HTTP/SSH requests.'); } public function getOptions() { $common_map = array( - 'C' => pht("The controller or workflow which handled the request."), - 'c' => pht("The HTTP response code or process exit code."), - 'D' => pht("The request date."), - 'e' => pht("Epoch timestamp."), + 'C' => pht('The controller or workflow which handled the request.'), + 'c' => pht('The HTTP response code or process exit code.'), + 'D' => pht('The request date.'), + 'e' => pht('Epoch timestamp.'), 'h' => pht("The webserver's host name."), - 'p' => pht("The PID of the server process."), - 'r' => pht("The remote IP."), - 'T' => pht("The request duration, in microseconds."), - 'U' => pht("The request path, or request target."), - 'm' => pht("For conduit, the Conduit method which was invoked."), - 'u' => pht("The logged-in username, if one is logged in."), - 'P' => pht("The logged-in user PHID, if one is logged in."), - 'i' => pht("Request input, in bytes."), - 'o' => pht("Request output, in bytes."), + 'p' => pht('The PID of the server process.'), + 'r' => pht('The remote IP.'), + 'T' => pht('The request duration, in microseconds.'), + 'U' => pht('The request path, or request target.'), + 'm' => pht('For conduit, the Conduit method which was invoked.'), + 'u' => pht('The logged-in username, if one is logged in.'), + 'P' => pht('The logged-in user PHID, if one is logged in.'), + 'i' => pht('Request input, in bytes.'), + 'o' => pht('Request output, in bytes.'), ); $http_map = $common_map + array( - 'R' => pht("The HTTP referrer."), - 'M' => pht("The HTTP method."), + 'R' => pht('The HTTP referrer.'), + 'M' => pht('The HTTP method.'), ); $ssh_map = $common_map + array( - 's' => pht("The system user."), - 'S' => pht("The system sudo user."), + 's' => pht('The system user.'), + 'S' => pht('The system sudo user.'), ); $http_desc = pht( - "Format for the HTTP access log. Use {{log.access.path}} to set the ". - "path. Available variables are:"); + 'Format for the HTTP access log. Use {{log.access.path}} to set the '. + 'path. Available variables are:'); $http_desc .= "\n\n"; $http_desc .= $this->renderMapHelp($http_map); $ssh_desc = pht( - "Format for the SSH access log. Use {{log.ssh.path}} to set the ". - "path. Available variables are:"); + 'Format for the SSH access log. Use {{log.ssh.path}} to set the '. + 'path. Available variables are:'); $ssh_desc .= "\n\n"; $ssh_desc .= $this->renderMapHelp($ssh_map); return array( $this->newOption('log.access.path', 'string', null) ->setLocked(true) - ->setSummary(pht("Access log location.")) + ->setSummary(pht('Access log location.')) ->setDescription( pht( "To enable the Phabricator access log, specify a path. The ". @@ -76,11 +76,11 @@ final class PhabricatorAccessLogConfigOptions 'wild', "[%D]\t%p\t%h\t%r\t%u\t%C\t%m\t%U\t%R\t%c\t%T") ->setLocked(true) - ->setSummary(pht("Access log format.")) + ->setSummary(pht('Access log format.')) ->setDescription($http_desc), $this->newOption('log.ssh.path', 'string', null) ->setLocked(true) - ->setSummary(pht("SSH log location.")) + ->setSummary(pht('SSH log location.')) ->setDescription( pht( "To enable the Phabricator SSH log, specify a path. The ". @@ -99,7 +99,7 @@ final class PhabricatorAccessLogConfigOptions 'wild', "[%D]\t%p\t%h\t%r\t%s\t%S\t%u\t%C\t%U\t%c\t%T\t%i\t%o") ->setLocked(true) - ->setSummary(pht("SSH log format.")) + ->setSummary(pht('SSH log format.')) ->setDescription($ssh_desc), ); } diff --git a/src/applications/config/option/PhabricatorAuthenticationConfigOptions.php b/src/applications/config/option/PhabricatorAuthenticationConfigOptions.php index 7e761085a8..d002ca4179 100644 --- a/src/applications/config/option/PhabricatorAuthenticationConfigOptions.php +++ b/src/applications/config/option/PhabricatorAuthenticationConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorAuthenticationConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Authentication"); + return pht('Authentication'); } public function getDescription() { - return pht("Options relating to authentication."); + return pht('Options relating to authentication.'); } public function getOptions() { @@ -16,24 +16,24 @@ final class PhabricatorAuthenticationConfigOptions $this->newOption('auth.require-email-verification', 'bool', false) ->setBoolOptions( array( - pht("Require email verification"), + pht('Require email verification'), pht("Don't require email verification") )) ->setSummary( - pht("Require email verification before a user can log in.")) + pht('Require email verification before a user can log in.')) ->setDescription( pht( - "If true, email addresses must be verified (by clicking a link ". - "in an email) before a user can login. By default, verification ". - "is optional unless {{auth.email-domains}} is nonempty.")), + 'If true, email addresses must be verified (by clicking a link '. + 'in an email) before a user can login. By default, verification '. + 'is optional unless {{auth.email-domains}} is nonempty.')), $this->newOption('auth.require-approval', 'bool', true) ->setBoolOptions( array( - pht("Require Administrators to Approve Accounts"), + pht('Require Administrators to Approve Accounts'), pht("Don't Require Manual Approval"), )) ->setSummary( - pht("Require administrators to approve new accounts.")) + pht('Require administrators to approve new accounts.')) ->setDescription( pht( "Newly registered Phabricator accounts can either be placed ". @@ -50,7 +50,7 @@ final class PhabricatorAuthenticationConfigOptions "{{auth.email-domains}} is configured correctly for your ". "install!")), $this->newOption('auth.email-domains', 'list', array()) - ->setSummary(pht("Only allow registration from particular domains.")) + ->setSummary(pht('Only allow registration from particular domains.')) ->setDescription( pht( "You can restrict allowed email addresses to certain domains ". @@ -67,7 +67,7 @@ final class PhabricatorAuthenticationConfigOptions pht('Valid Setting')), $this->newOption('auth.login-message', 'string', null) ->setLocked(true) - ->setSummary(pht("A block of HTML displayed on the login screen.")) + ->setSummary(pht('A block of HTML displayed on the login screen.')) ->setDescription( pht( "You can provide an arbitrary block of HTML here, which will ". @@ -76,26 +76,26 @@ final class PhabricatorAuthenticationConfigOptions $this->newOption('account.editable', 'bool', true) ->setBoolOptions( array( - pht("Allow editing"), - pht("Prevent editing") + pht('Allow editing'), + pht('Prevent editing') )) ->setSummary( pht( - "Determines whether or not basic account information is ". - "editable.")) + 'Determines whether or not basic account information is '. + 'editable.')) ->setDescription( pht( - "Is basic account information (email, real name, profile ". - "picture) editable? If you set up Phabricator to automatically ". - "synchronize account information from some other authoritative ". - "system, you can disable this to ensure information remains ". - "consistent across both systems.")), + 'Is basic account information (email, real name, profile '. + 'picture) editable? If you set up Phabricator to automatically '. + 'synchronize account information from some other authoritative '. + 'system, you can disable this to ensure information remains '. + 'consistent across both systems.')), $this->newOption('account.minimum-password-length', 'int', 8) - ->setSummary(pht("Minimum password length.")) + ->setSummary(pht('Minimum password length.')) ->setDescription( pht( - "When users set or reset a password, it must have at least this ". - "many characters.")), + 'When users set or reset a password, it must have at least this '. + 'many characters.')), ); } diff --git a/src/applications/config/option/PhabricatorConfigOption.php b/src/applications/config/option/PhabricatorConfigOption.php index a0d3c4d86a..1c0c090b08 100644 --- a/src/applications/config/option/PhabricatorConfigOption.php +++ b/src/applications/config/option/PhabricatorConfigOption.php @@ -187,7 +187,7 @@ final class PhabricatorConfigOption public function getCustomObject() { if (!$this->customObject) { if (!$this->isCustomType()) { - throw new Exception("This option does not have a custom type!"); + throw new Exception('This option does not have a custom type!'); } $this->customObject = newv(substr($this->getType(), 7), array()); } diff --git a/src/applications/config/option/PhabricatorCoreConfigOptions.php b/src/applications/config/option/PhabricatorCoreConfigOptions.php index 184def1554..56975bd66f 100644 --- a/src/applications/config/option/PhabricatorCoreConfigOptions.php +++ b/src/applications/config/option/PhabricatorCoreConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorCoreConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Core"); + return pht('Core'); } public function getDescription() { - return pht("Configure core options, including URIs."); + return pht('Configure core options, including URIs.'); } public function getOptions() { @@ -27,31 +27,31 @@ final class PhabricatorCoreConfigOptions return array( $this->newOption('phabricator.base-uri', 'string', null) ->setLocked(true) - ->setSummary(pht("URI where Phabricator is installed.")) + ->setSummary(pht('URI where Phabricator is installed.')) ->setDescription( pht( - "Set the URI where Phabricator is installed. Setting this ". - "improves security by preventing cookies from being set on other ". - "domains, and allows daemons to send emails with links that have ". - "the correct domain.")) + 'Set the URI where Phabricator is installed. Setting this '. + 'improves security by preventing cookies from being set on other '. + 'domains, and allows daemons to send emails with links that have '. + 'the correct domain.')) ->addExample('http://phabricator.example.com/', pht('Valid Setting')), $this->newOption('phabricator.production-uri', 'string', null) ->setSummary( - pht("Primary install URI, for multi-environment installs.")) + pht('Primary install URI, for multi-environment installs.')) ->setDescription( pht( - "If you have multiple Phabricator environments (like a ". - "development/staging environment for working on testing ". - "Phabricator, and a production environment for deploying it), ". - "set the production environment URI here so that emails and other ". - "durable URIs will always generate with links pointing at the ". - "production environment. If unset, defaults to ". - "{{phabricator.base-uri}}. Most installs do not need to set ". - "this option.")) + 'If you have multiple Phabricator environments (like a '. + 'development/staging environment for working on testing '. + 'Phabricator, and a production environment for deploying it), '. + 'set the production environment URI here so that emails and other '. + 'durable URIs will always generate with links pointing at the '. + 'production environment. If unset, defaults to '. + '{{phabricator.base-uri}}. Most installs do not need to set '. + 'this option.')) ->addExample('http://phabricator.example.com/', pht('Valid Setting')), $this->newOption('phabricator.allowed-uris', 'list', array()) ->setLocked(true) - ->setSummary(pht("Alternative URIs that can access Phabricator.")) + ->setSummary(pht('Alternative URIs that can access Phabricator.')) ->setDescription( pht( "These alternative URIs will be able to access 'normal' pages ". @@ -64,7 +64,7 @@ final class PhabricatorCoreConfigOptions pht('Valid Setting')), $this->newOption('phabricator.timezone', 'string', null) ->setSummary( - pht("The timezone Phabricator should use.")) + pht('The timezone Phabricator should use.')) ->setDescription( pht( "PHP requires that you set a timezone in your php.ini before ". @@ -78,13 +78,13 @@ final class PhabricatorCoreConfigOptions ->addExample('America/Los_Angeles', pht('US West (PDT)')), $this->newOption('phabricator.cookie-prefix', 'string', null) ->setSummary( - pht("Set a string Phabricator should use to prefix ". - "cookie names")) + pht('Set a string Phabricator should use to prefix '. + 'cookie names')) ->setDescription( pht( - "Cookies set for x.com are also sent for y.x.com. Assuming ". - "Phabricator instances are running on both domains, this will ". - "create a collision preventing you from logging in.")) + 'Cookies set for x.com are also sent for y.x.com. Assuming '. + 'Phabricator instances are running on both domains, this will '. + 'create a collision preventing you from logging in.')) ->addExample('dev', pht('Prefix cookie with "dev"')), $this->newOption('phabricator.show-beta-applications', 'bool', false) ->setBoolOptions( @@ -112,7 +112,7 @@ final class PhabricatorCoreConfigOptions pht('Shenanigans'), // That should be interesting to translate. :P )) ->setSummary( - pht("Allows you to remove levity and jokes from the UI.")) + pht('Allows you to remove levity and jokes from the UI.')) ->setDescription( pht( 'By default, Phabricator includes some flavor text in the UI, '. @@ -122,7 +122,7 @@ final class PhabricatorCoreConfigOptions 'extra flavor.')), $this->newOption('environment.append-paths', 'list', $paths) ->setSummary( - pht("These paths get appended to your \$PATH envrionment variable.")) + pht('These paths get appended to your \$PATH envrionment variable.')) ->setDescription( pht( "Phabricator occasionally shells out to other binaries on the ". diff --git a/src/applications/config/option/PhabricatorDeveloperConfigOptions.php b/src/applications/config/option/PhabricatorDeveloperConfigOptions.php index 95f841b4ea..9f26ba6bb2 100644 --- a/src/applications/config/option/PhabricatorDeveloperConfigOptions.php +++ b/src/applications/config/option/PhabricatorDeveloperConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorDeveloperConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Developer / Debugging"); + return pht('Developer / Debugging'); } public function getDescription() { - return pht("Options for Phabricator developers, including debugging."); + return pht('Options for Phabricator developers, including debugging.'); } public function getOptions() { @@ -16,8 +16,8 @@ final class PhabricatorDeveloperConfigOptions $this->newOption('darkconsole.enabled', 'bool', false) ->setBoolOptions( array( - pht("Enable DarkConsole"), - pht("Disable DarkConsole"), + pht('Enable DarkConsole'), + pht('Disable DarkConsole'), )) ->setSummary(pht("Enable Phabricator's debugging console.")) ->setDescription( @@ -34,10 +34,10 @@ final class PhabricatorDeveloperConfigOptions $this->newOption('darkconsole.always-on', 'bool', false) ->setBoolOptions( array( - pht("Always Activate DarkConsole"), - pht("Require DarkConsole Activation"), + pht('Always Activate DarkConsole'), + pht('Require DarkConsole Activation'), )) - ->setSummary(pht("Activate DarkConsole on every page.")) + ->setSummary(pht('Activate DarkConsole on every page.')) ->setDescription( pht( "This option allows you to enable DarkConsole on every page, ". @@ -49,27 +49,27 @@ final class PhabricatorDeveloperConfigOptions $this->newOption('debug.stop-on-redirect', 'bool', false) ->setBoolOptions( array( - pht("Stop Before HTTP Redirect"), - pht("Use Normal HTTP Redirects"), + pht('Stop Before HTTP Redirect'), + pht('Use Normal HTTP Redirects'), )) ->setSummary( pht( - "Confirm before redirecting so DarkConsole can be examined.")) + 'Confirm before redirecting so DarkConsole can be examined.')) ->setDescription( pht( - "Normally, Phabricator issues HTTP redirects after a successful ". - "POST. This can make it difficult to debug things which happen ". - "while processing the POST, because service and profiling ". - "information are lost. By setting this configuration option, ". - "Phabricator will show a page instead of automatically ". - "redirecting, allowing you to examine service and profiling ". - "information. It also makes the UX awful, so you should only ". - "enable it when debugging.")), + 'Normally, Phabricator issues HTTP redirects after a successful '. + 'POST. This can make it difficult to debug things which happen '. + 'while processing the POST, because service and profiling '. + 'information are lost. By setting this configuration option, '. + 'Phabricator will show a page instead of automatically '. + 'redirecting, allowing you to examine service and profiling '. + 'information. It also makes the UX awful, so you should only '. + 'enable it when debugging.')), $this->newOption('debug.profile-rate', 'int', 0) ->addExample(0, pht('No profiling')) ->addExample(1, pht('Profile every request (slow)')) ->addExample(1000, pht('Profile 0.1%% of all requests')) - ->setSummary(pht("Automatically profile some percentage of pages.")) + ->setSummary(pht('Automatically profile some percentage of pages.')) ->setDescription( pht( "Normally, Phabricator profiles pages only when explicitly ". @@ -91,37 +91,37 @@ final class PhabricatorDeveloperConfigOptions pht('Enable developer mode'), pht('Disable developer mode'), )) - ->setSummary(pht("Enable verbose error reporting and disk reads.")) + ->setSummary(pht('Enable verbose error reporting and disk reads.')) ->setDescription( pht( - "This option enables verbose error reporting (stack traces, ". - "error callouts) and forces disk reads of static assets on ". - "every reload.")), + 'This option enables verbose error reporting (stack traces, '. + 'error callouts) and forces disk reads of static assets on '. + 'every reload.')), $this->newOption('celerity.minify', 'bool', true) ->setBoolOptions( array( pht('Minify static resources.'), pht("Don't minify static resources."), )) - ->setSummary(pht("Minify static Celerity resources.")) + ->setSummary(pht('Minify static Celerity resources.')) ->setDescription( pht( - "Minify static resources by removing whitespace and comments. You ". - "should enable this in production, but disable it in ". - "development.")), + 'Minify static resources by removing whitespace and comments. You '. + 'should enable this in production, but disable it in '. + 'development.')), $this->newOption('cache.enable-deflate', 'bool', true) ->setBoolOptions( array( - pht("Enable deflate compression"), - pht("Disable deflate compression"), + pht('Enable deflate compression'), + pht('Disable deflate compression'), )) ->setSummary( - pht("Toggle gzdeflate()-based compression for some caches.")) + pht('Toggle gzdeflate()-based compression for some caches.')) ->setDescription( pht( - "Set this to false to disable the use of gzdeflate()-based ". - "compression in some caches. This may give you less performant ". - "(but more debuggable) caching.")), + 'Set this to false to disable the use of gzdeflate()-based '. + 'compression in some caches. This may give you less performant '. + '(but more debuggable) caching.')), ); } } diff --git a/src/applications/config/option/PhabricatorDisqusConfigOptions.php b/src/applications/config/option/PhabricatorDisqusConfigOptions.php index d3a06eba36..c85e3a7ebf 100644 --- a/src/applications/config/option/PhabricatorDisqusConfigOptions.php +++ b/src/applications/config/option/PhabricatorDisqusConfigOptions.php @@ -4,17 +4,17 @@ final class PhabricatorDisqusConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Integration with Disqus"); + return pht('Integration with Disqus'); } public function getDescription() { - return pht("Disqus authentication and integration options."); + return pht('Disqus authentication and integration options.'); } public function getOptions() { return array( $this->newOption('disqus.shortname', 'string', null) - ->setSummary(pht("Shortname for Disqus comment widget.")) + ->setSummary(pht('Shortname for Disqus comment widget.')) ->setDescription( pht( "Website shortname to use for Disqus comment widget in Phame. ". diff --git a/src/applications/config/option/PhabricatorExtendingPhabricatorConfigOptions.php b/src/applications/config/option/PhabricatorExtendingPhabricatorConfigOptions.php index 3c6678cf2f..0c5783f3db 100644 --- a/src/applications/config/option/PhabricatorExtendingPhabricatorConfigOptions.php +++ b/src/applications/config/option/PhabricatorExtendingPhabricatorConfigOptions.php @@ -4,29 +4,29 @@ final class PhabricatorExtendingPhabricatorConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Extending Phabricator"); + return pht('Extending Phabricator'); } public function getDescription() { - return pht("Make Phabricator even cooler!"); + return pht('Make Phabricator even cooler!'); } public function getOptions() { return array( $this->newOption('load-libraries', 'list', array()) ->setLocked(true) - ->setSummary(pht("Paths to additional phutil libraries to load.")) + ->setSummary(pht('Paths to additional phutil libraries to load.')) ->addExample('/srv/our-libs/sekrit-phutil', pht('Valid Setting')), $this->newOption('events.listeners', 'list', array()) ->setLocked(true) ->setSummary( - pht("Listeners receive callbacks when interesting things occur.")) + pht('Listeners receive callbacks when interesting things occur.')) ->setDescription( pht( - "You can respond to various application events by installing ". - "listeners, which will receive callbacks when interesting things ". - "occur. Specify a list of classes which extend ". - "PhabricatorEventListener here.")) + 'You can respond to various application events by installing '. + 'listeners, which will receive callbacks when interesting things '. + 'occur. Specify a list of classes which extend '. + 'PhabricatorEventListener here.')) ->addExample('MyEventListener', pht('Valid Setting')), $this->newOption( 'aphront.default-application-configuration-class', @@ -35,7 +35,7 @@ final class PhabricatorExtendingPhabricatorConfigOptions ->setLocked(true) ->setBaseClass('AphrontApplicationConfiguration') // TODO: This could probably use some better documentation. - ->setDescription(pht("Application configuration class.")), + ->setDescription(pht('Application configuration class.')), ); } diff --git a/src/applications/config/option/PhabricatorGarbageCollectorConfigOptions.php b/src/applications/config/option/PhabricatorGarbageCollectorConfigOptions.php index 3f5a42c624..24fd1a4014 100644 --- a/src/applications/config/option/PhabricatorGarbageCollectorConfigOptions.php +++ b/src/applications/config/option/PhabricatorGarbageCollectorConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorGarbageCollectorConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Garbage Collector"); + return pht('Garbage Collector'); } public function getDescription() { - return pht("Configure the GC for old logs, caches, etc."); + return pht('Configure the GC for old logs, caches, etc.'); } public function getOptions() { diff --git a/src/applications/config/option/PhabricatorMailgunConfigOptions.php b/src/applications/config/option/PhabricatorMailgunConfigOptions.php index 7c5b629227..cd1beb155b 100644 --- a/src/applications/config/option/PhabricatorMailgunConfigOptions.php +++ b/src/applications/config/option/PhabricatorMailgunConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorMailgunConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Integration with Mailgun"); + return pht('Integration with Mailgun'); } public function getDescription() { - return pht("Configure Mailgun integration."); + return pht('Configure Mailgun integration.'); } public function getOptions() { diff --git a/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php b/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php index 18ae3d27c5..8eb0b5c85f 100644 --- a/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php +++ b/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorMetaMTAConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Mail"); + return pht('Mail'); } public function getDescription() { - return pht("Configure Mail."); + return pht('Configure Mail.'); } public function getOptions() { @@ -207,8 +207,8 @@ EODOC true) ->setBoolOptions( array( - pht("Send Mail To Each Recipient"), - pht("Send Mail To All Recipients"), + pht('Send Mail To Each Recipient'), + pht('Send Mail To All Recipients'), )) ->setSummary( pht( @@ -219,8 +219,8 @@ EODOC $this->newOption('metamta.can-send-as-user', 'bool', false) ->setBoolOptions( array( - pht("Send as User Taking Action"), - pht("Send as Phabricator"), + pht('Send as User Taking Action'), + pht('Send as Phabricator'), )) ->setSummary( pht( @@ -236,24 +236,24 @@ EODOC $this->newOption('metamta.reply.show-hints', 'bool', true) ->setBoolOptions( array( - pht("Show Reply Handler Hints"), - pht("No Reply Handler Hints"), + pht('Show Reply Handler Hints'), + pht('No Reply Handler Hints'), )) ->setSummary(pht('Show hints about reply handler actions in email.')) ->setDescription($reply_hints_description), $this->newOption('metamta.herald.show-hints', 'bool', true) ->setBoolOptions( array( - pht("Show Herald Hints"), - pht("No Herald Hints"), + pht('Show Herald Hints'), + pht('No Herald Hints'), )) ->setSummary(pht('Show hints about Herald rules in email.')) ->setDescription($herald_hints_description), $this->newOption('metamta.recipients.show-hints', 'bool', true) ->setBoolOptions( array( - pht("Show Recipient Hints"), - pht("No Recipient Hints"), + pht('Show Recipient Hints'), + pht('No Recipient Hints'), )) ->setSummary(pht('Show "To:" and "Cc:" footer hints in email.')) ->setDescription($recipient_hints_description), diff --git a/src/applications/config/option/PhabricatorMySQLConfigOptions.php b/src/applications/config/option/PhabricatorMySQLConfigOptions.php index e19348880b..61dddf853e 100644 --- a/src/applications/config/option/PhabricatorMySQLConfigOptions.php +++ b/src/applications/config/option/PhabricatorMySQLConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorMySQLConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("MySQL"); + return pht('MySQL'); } public function getDescription() { - return pht("Database configuration."); + return pht('Database configuration.'); } public function getOptions() { @@ -16,17 +16,17 @@ final class PhabricatorMySQLConfigOptions $this->newOption('mysql.host', 'string', 'localhost') ->setLocked(true) ->setDescription( - pht("MySQL database hostname.")) + pht('MySQL database hostname.')) ->addExample('localhost', pht('MySQL on this machine')) ->addExample('db.example.com:3300', pht('Nonstandard port')), $this->newOption('mysql.user', 'string', 'root') ->setLocked(true) ->setDescription( - pht("MySQL username to use when connecting to the database.")), + pht('MySQL username to use when connecting to the database.')), $this->newOption('mysql.pass', 'string', null) ->setHidden(true) ->setDescription( - pht("MySQL password to use when connecting to the database.")), + pht('MySQL password to use when connecting to the database.')), $this->newOption( 'mysql.configuration-provider', 'class', @@ -37,9 +37,9 @@ final class PhabricatorMySQLConfigOptions pht('Configure database configuration class.')) ->setDescription( pht( - "Phabricator chooses which database to connect to through a ". - "swappable configuration provider. You almost certainly do not ". - "need to change this.")), + 'Phabricator chooses which database to connect to through a '. + 'swappable configuration provider. You almost certainly do not '. + 'need to change this.')), $this->newOption( 'mysql.implementation', 'class', @@ -52,15 +52,15 @@ final class PhabricatorMySQLConfigOptions pht('Configure database connection class.')) ->setDescription( pht( - "Phabricator connects to MySQL through a swappable abstraction ". - "layer. You can choose an alternate implementation by setting ". - "this option. To provide your own implementation, extend ". - "`AphrontMySQLDatabaseConnectionBase`. It is very unlikely that ". - "you need to change this.")), + 'Phabricator connects to MySQL through a swappable abstraction '. + 'layer. You can choose an alternate implementation by setting '. + 'this option. To provide your own implementation, extend '. + '`AphrontMySQLDatabaseConnectionBase`. It is very unlikely that '. + 'you need to change this.')), $this->newOption('storage.default-namespace', 'string', 'phabricator') ->setLocked(true) ->setSummary( - pht("The namespace that Phabricator databases should use.")) + pht('The namespace that Phabricator databases should use.')) ->setDescription( pht( "Phabricator puts databases in a namespace, which defaults to ". @@ -72,7 +72,7 @@ final class PhabricatorMySQLConfigOptions $this->newOption('mysql.port', 'string', null) ->setLocked(true) ->setDescription( - pht("MySQL port to use when connecting to the database.")), + pht('MySQL port to use when connecting to the database.')), ); } diff --git a/src/applications/config/option/PhabricatorNotificationConfigOptions.php b/src/applications/config/option/PhabricatorNotificationConfigOptions.php index bb8f2c70b5..eb750a65b0 100644 --- a/src/applications/config/option/PhabricatorNotificationConfigOptions.php +++ b/src/applications/config/option/PhabricatorNotificationConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorNotificationConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Notifications"); + return pht('Notifications'); } public function getDescription() { - return pht("Configure real-time notifications."); + return pht('Configure real-time notifications.'); } public function getOptions() { @@ -16,8 +16,8 @@ final class PhabricatorNotificationConfigOptions $this->newOption('notification.enabled', 'bool', false) ->setBoolOptions( array( - pht("Enable Real-Time Notifications"), - pht("Disable Real-Time Notifications"), + pht('Enable Real-Time Notifications'), + pht('Disable Real-Time Notifications'), )) ->setSummary(pht('Enable real-time notifications.')) ->setDescription( @@ -40,10 +40,10 @@ final class PhabricatorNotificationConfigOptions ->setSummary(pht('Drop permissions to a less-privileged user.')) ->setDescription( pht( - "The notifcation server must be started as root so it can bind ". - "to privileged ports, but if you specify a system user here it ". - "will drop permissions to that user after binding to the ports ". - "it needs.")), + 'The notifcation server must be started as root so it can bind '. + 'to privileged ports, but if you specify a system user here it '. + 'will drop permissions to that user after binding to the ports '. + 'it needs.')), $this->newOption('notification.log', 'string', '/var/log/aphlict.log') ->setDescription(pht('Location of the server log file.')), $this->newOption( diff --git a/src/applications/config/option/PhabricatorPHDConfigOptions.php b/src/applications/config/option/PhabricatorPHDConfigOptions.php index a15844f4d2..e106e78de2 100644 --- a/src/applications/config/option/PhabricatorPHDConfigOptions.php +++ b/src/applications/config/option/PhabricatorPHDConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorPHDConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Daemons"); + return pht('Daemons'); } public function getDescription() { - return pht("Options relating to PHD (daemons)."); + return pht('Options relating to PHD (daemons).'); } public function getOptions() { @@ -16,13 +16,13 @@ final class PhabricatorPHDConfigOptions $this->newOption('phd.pid-directory', 'string', '/var/tmp/phd/pid') ->setDescription( pht( - "Directory that phd should use to track running daemons.")), + 'Directory that phd should use to track running daemons.')), $this->newOption('phd.log-directory', 'string', '/var/tmp/phd/log') ->setDescription( pht( - "Directory that the daemons should use to store log files.")), + 'Directory that the daemons should use to store log files.')), $this->newOption('phd.start-taskmasters', 'int', 4) - ->setSummary(pht("Number of TaskMaster daemons to start by default.")) + ->setSummary(pht('Number of TaskMaster daemons to start by default.')) ->setDescription( pht( "Number of 'TaskMaster' daemons that 'phd start' should start. ". @@ -31,8 +31,8 @@ final class PhabricatorPHDConfigOptions $this->newOption('phd.verbose', 'bool', false) ->setBoolOptions( array( - pht("Verbose mode"), - pht("Normal mode"), + pht('Verbose mode'), + pht('Normal mode'), )) ->setSummary(pht("Launch daemons in 'verbose' mode by default.")) ->setDescription( @@ -43,18 +43,18 @@ final class PhabricatorPHDConfigOptions "also 'phd.trace'.")), $this->newOption('phd.user', 'string', null) ->setLocked(true) - ->setSummary(pht("System user to run daemons as.")) + ->setSummary(pht('System user to run daemons as.')) ->setDescription( pht( - "Specify a system user to run the daemons as. Primarily, this ". - "user will own the working copies of any repositories that ". - "Phabricator imports or manages. This option is new and ". - "experimental.")), + 'Specify a system user to run the daemons as. Primarily, this '. + 'user will own the working copies of any repositories that '. + 'Phabricator imports or manages. This option is new and '. + 'experimental.')), $this->newOption('phd.trace', 'bool', false) ->setBoolOptions( array( - pht("Trace mode"), - pht("Normal mode"), + pht('Trace mode'), + pht('Normal mode'), )) ->setSummary(pht("Launch daemons in 'trace' mode by default.")) ->setDescription( diff --git a/src/applications/config/option/PhabricatorPHPMailerConfigOptions.php b/src/applications/config/option/PhabricatorPHPMailerConfigOptions.php index c49ae1c2fd..d4918f934c 100644 --- a/src/applications/config/option/PhabricatorPHPMailerConfigOptions.php +++ b/src/applications/config/option/PhabricatorPHPMailerConfigOptions.php @@ -4,18 +4,18 @@ final class PhabricatorPHPMailerConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("PHPMailer"); + return pht('PHPMailer'); } public function getDescription() { - return pht("Configure PHPMailer."); + return pht('Configure PHPMailer.'); } public function getOptions() { return array( $this->newOption('phpmailer.mailer', 'string', 'smtp') ->setLocked(true) - ->setSummary(pht("Configure mailer used by PHPMailer.")) + ->setSummary(pht('Configure mailer used by PHPMailer.')) ->setDescription( pht( "If you're using PHPMailer to send email, provide the mailer and ". diff --git a/src/applications/config/option/PhabricatorRecaptchaConfigOptions.php b/src/applications/config/option/PhabricatorRecaptchaConfigOptions.php index 5aef7058c8..ef3ccf2afd 100644 --- a/src/applications/config/option/PhabricatorRecaptchaConfigOptions.php +++ b/src/applications/config/option/PhabricatorRecaptchaConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorRecaptchaConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Integration with Recaptcha"); + return pht('Integration with Recaptcha'); } public function getDescription() { - return pht("Configure Recaptcha captchas."); + return pht('Configure Recaptcha captchas.'); } public function getOptions() { @@ -17,15 +17,15 @@ final class PhabricatorRecaptchaConfigOptions $this->newOption('recaptcha.enabled', 'bool', false) ->setBoolOptions( array( - pht("Enable Recaptcha"), - pht("Disable Recaptcha"), + pht('Enable Recaptcha'), + pht('Disable Recaptcha'), )) ->setSummary(pht('Enable captchas with Recaptcha.')) ->setDescription( pht( - "Enable recaptcha to require users solve captchas after a few ". - "failed login attempts. This hinders brute-force attacks against ". - "user passwords. For more information, see http://recaptcha.net/")), + 'Enable recaptcha to require users solve captchas after a few '. + 'failed login attempts. This hinders brute-force attacks against '. + 'user passwords. For more information, see http://recaptcha.net/')), $this->newOption('recaptcha.public-key', 'string', null) ->setDescription( pht('Recaptcha public key, obtained by signing up for Recaptcha.')), diff --git a/src/applications/config/option/PhabricatorSecurityConfigOptions.php b/src/applications/config/option/PhabricatorSecurityConfigOptions.php index 56cffb414c..7e5150a282 100644 --- a/src/applications/config/option/PhabricatorSecurityConfigOptions.php +++ b/src/applications/config/option/PhabricatorSecurityConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorSecurityConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Security"); + return pht('Security'); } public function getDescription() { - return pht("Security options."); + return pht('Security options.'); } public function getOptions() { @@ -17,7 +17,7 @@ final class PhabricatorSecurityConfigOptions return array( $this->newOption('security.alternate-file-domain', 'string', null) ->setLocked(true) - ->setSummary(pht("Alternate domain to serve files from.")) + ->setSummary(pht('Alternate domain to serve files from.')) ->setDescription( pht( "IMPORTANT: By default, Phabricator serves files from the same ". @@ -46,17 +46,17 @@ final class PhabricatorSecurityConfigOptions ->setMasked(true) ->setLocked(true) ->setSummary( - pht("Key for HMAC digests.")) + pht('Key for HMAC digests.')) ->setDescription( pht( - "Default key for HMAC digests where the key is not important ". - "(i.e., the hash itself is secret). You can change this if you ". - "want (to any other string), but doing so will break existing ". - "sessions and CSRF tokens.")), + 'Default key for HMAC digests where the key is not important '. + '(i.e., the hash itself is secret). You can change this if you '. + 'want (to any other string), but doing so will break existing '. + 'sessions and CSRF tokens.')), $this->newOption('security.require-https', 'bool', false) ->setLocked(true) ->setSummary( - pht("Force users to connect via HTTPS instead of HTTP.")) + pht('Force users to connect via HTTPS instead of HTTP.')) ->setDescription( pht( "If the web server responds to both HTTP and HTTPS requests but ". @@ -105,15 +105,15 @@ final class PhabricatorSecurityConfigOptions ->setMasked(true) ->setLocked(true) ->setSummary( - pht("Hashed with other inputs to generate CSRF tokens.")) + pht('Hashed with other inputs to generate CSRF tokens.')) ->setDescription( pht( - "This is hashed with other inputs to generate CSRF tokens. If ". - "you want, you can change it to some other string which is ". - "unique to your install. This will make your install more secure ". - "in a vague, mostly theoretical way. But it will take you like 3 ". - "seconds of mashing on your keyboard to set it up so you might ". - "as well.")), + 'This is hashed with other inputs to generate CSRF tokens. If '. + 'you want, you can change it to some other string which is '. + 'unique to your install. This will make your install more secure '. + 'in a vague, mostly theoretical way. But it will take you like 3 '. + 'seconds of mashing on your keyboard to set it up so you might '. + 'as well.')), $this->newOption( 'phabricator.mail-key', 'string', @@ -121,7 +121,7 @@ final class PhabricatorSecurityConfigOptions ->setMasked(true) ->setLocked(true) ->setSummary( - pht("Hashed with other inputs to generate mail tokens.")) + pht('Hashed with other inputs to generate mail tokens.')) ->setDescription( pht( "This is hashed with other inputs to generate mail tokens. If ". @@ -138,7 +138,7 @@ final class PhabricatorSecurityConfigOptions 'mailto' => true, )) ->setSummary( - pht("Determines which URI protocols are auto-linked.")) + pht('Determines which URI protocols are auto-linked.')) ->setDescription( pht( "When users write comments which have URIs, they'll be ". @@ -187,24 +187,24 @@ final class PhabricatorSecurityConfigOptions 'string', 'd9455ea150622ee044f7931dabfa52aa') ->setSummary( - pht("An input to the hash function when building resource hashes.")) + pht('An input to the hash function when building resource hashes.')) ->setDescription( pht( - "This value is an input to the hash function when building ". - "resource hashes. It has no security value, but if you ". - "accidentally poison user caches (by pushing a bad patch or ". - "having something go wrong with a CDN, e.g.) you can change this ". - "to something else and rebuild the Celerity map to break user ". - "caches. Unless you are doing Celerity development, it is ". - "exceptionally unlikely that you need to modify this.")), + 'This value is an input to the hash function when building '. + 'resource hashes. It has no security value, but if you '. + 'accidentally poison user caches (by pushing a bad patch or '. + 'having something go wrong with a CDN, e.g.) you can change this '. + 'to something else and rebuild the Celerity map to break user '. + 'caches. Unless you are doing Celerity development, it is '. + 'exceptionally unlikely that you need to modify this.')), $this->newOption('remarkup.enable-embedded-youtube', 'bool', false) ->setBoolOptions( array( - pht("Embed YouTube videos"), + pht('Embed YouTube videos'), pht("Don't embed YouTube videos"), )) ->setSummary( - pht("Determines whether or not YouTube videos get embedded.")) + pht('Determines whether or not YouTube videos get embedded.')) ->setDescription( pht( "If you enable this, linked YouTube videos will be embeded ". @@ -214,16 +214,16 @@ final class PhabricatorSecurityConfigOptions $this->newOption('security.allow-outbound-http', 'bool', true) ->setBoolOptions( array( - pht("Allow"), - pht("Disallow"), + pht('Allow'), + pht('Disallow'), )) ->setLocked(true) ->setSummary( - pht("Allow outbound HTTP requests")) + pht('Allow outbound HTTP requests')) ->setDescription( pht( - "If you enable this, you are allowing Phabricator to ". - "potentially make requests to external servers.")), + 'If you enable this, you are allowing Phabricator to '. + 'potentially make requests to external servers.')), ); } diff --git a/src/applications/config/option/PhabricatorSendGridConfigOptions.php b/src/applications/config/option/PhabricatorSendGridConfigOptions.php index 898268b598..04f54e12c1 100644 --- a/src/applications/config/option/PhabricatorSendGridConfigOptions.php +++ b/src/applications/config/option/PhabricatorSendGridConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorSendGridConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Integration with SendGrid"); + return pht('Integration with SendGrid'); } public function getDescription() { - return pht("Configure SendGrid integration."); + return pht('Configure SendGrid integration.'); } public function getOptions() { diff --git a/src/applications/config/option/PhabricatorSyntaxHighlightingConfigOptions.php b/src/applications/config/option/PhabricatorSyntaxHighlightingConfigOptions.php index 4ce4725faa..00474a5e84 100644 --- a/src/applications/config/option/PhabricatorSyntaxHighlightingConfigOptions.php +++ b/src/applications/config/option/PhabricatorSyntaxHighlightingConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorSyntaxHighlightingConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Syntax Highlighting"); + return pht('Syntax Highlighting'); } public function getDescription() { - return pht("Options relating to syntax highlighting source code."); + return pht('Options relating to syntax highlighting source code.'); } public function getOptions() { @@ -18,16 +18,16 @@ final class PhabricatorSyntaxHighlightingConfigOptions 'class', 'PhutilDefaultSyntaxHighlighterEngine') ->setBaseClass('PhutilSyntaxHighlighterEngine') - ->setSummary(pht("Default non-pygments syntax highlighter engine.")) + ->setSummary(pht('Default non-pygments syntax highlighter engine.')) ->setDescription( pht( - "Phabricator can highlight PHP by default and use Pygments for ". - "other languages if enabled. You can provide a custom ". - "highlighter engine by extending class ". - "PhutilSyntaxHighlighterEngine.")), + 'Phabricator can highlight PHP by default and use Pygments for '. + 'other languages if enabled. You can provide a custom '. + 'highlighter engine by extending class '. + 'PhutilSyntaxHighlighterEngine.')), $this->newOption('pygments.enabled', 'bool', false) ->setSummary( - pht("Should Phabricator shell out to Pygments to highlight code?")) + pht('Should Phabricator shell out to Pygments to highlight code?')) ->setDescription( pht( "If you want syntax highlighting for other languages than PHP ". @@ -73,11 +73,11 @@ final class PhabricatorSyntaxHighlightingConfigOptions 'yaml' => 'YAML', )) ->setSummary( - pht("Set the language list which appears in dropdowns.")) + pht('Set the language list which appears in dropdowns.')) ->setDescription( pht( - "In places that we display a dropdown to syntax-highlight code, ". - "this is where that list is defined.")), + 'In places that we display a dropdown to syntax-highlight code, '. + 'this is where that list is defined.')), $this->newOption( 'syntax.filemap', 'wild', @@ -87,17 +87,17 @@ final class PhabricatorSyntaxHighlightingConfigOptions '@\.divinerconfig$@' => 'js', )) ->setSummary( - pht("Override what language files (based on filename) highlight as.")) + pht('Override what language files (based on filename) highlight as.')) ->setDescription( pht( - "This is an override list of regular expressions which allows ". - "you to choose what language files are highlighted as. If your ". - "projects have certain rules about filenames or use unusual or ". - "ambiguous language extensions, you can create a mapping here. ". - "This is an ordered dictionary of regular expressions which will ". - "be tested against the filename. They should map to either an ". - "explicit language as a string value, or a numeric index into ". - "the captured groups as an integer.")) + 'This is an override list of regular expressions which allows '. + 'you to choose what language files are highlighted as. If your '. + 'projects have certain rules about filenames or use unusual or '. + 'ambiguous language extensions, you can create a mapping here. '. + 'This is an ordered dictionary of regular expressions which will '. + 'be tested against the filename. They should map to either an '. + 'explicit language as a string value, or a numeric index into '. + 'the captured groups as an integer.')) ->addExample('{"@\\.xyz$@": "php"}', pht('Highlight *.xyz as PHP.')) ->addExample( '{"@/httpd\\.conf@": "apacheconf"}', @@ -113,7 +113,7 @@ final class PhabricatorSyntaxHighlightingConfigOptions '10px "Menlo", "Consolas", "Monaco", monospace') ->setLocked(true) ->setSummary( - pht("Default monospace font.")) + pht('Default monospace font.')) ->setDescription( pht( "Set the default monospaced font style for users who haven't set ". @@ -124,7 +124,7 @@ final class PhabricatorSyntaxHighlightingConfigOptions '11px "Menlo", "Consolas", "Monaco", monospace') ->setLocked(true) ->setSummary( - pht("Default monospace font for clients on Windows.")) + pht('Default monospace font for clients on Windows.')) ->setDescription( pht( "Set the default monospaced font style for users who haven't set ". diff --git a/src/applications/config/option/PhabricatorTranslationsConfigOptions.php b/src/applications/config/option/PhabricatorTranslationsConfigOptions.php index e3392a1302..5144bb3f18 100644 --- a/src/applications/config/option/PhabricatorTranslationsConfigOptions.php +++ b/src/applications/config/option/PhabricatorTranslationsConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorTranslationsConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Translations"); + return pht('Translations'); } public function getDescription() { - return pht("Options relating to translations."); + return pht('Options relating to translations.'); } public function getOptions() { @@ -18,16 +18,16 @@ final class PhabricatorTranslationsConfigOptions 'class', 'PhabricatorEnglishTranslation') ->setBaseClass('PhabricatorTranslation') - ->setSummary(pht("Translation class that should be used for strings.")) + ->setSummary(pht('Translation class that should be used for strings.')) ->setDescription( pht( - "This allows customizing texts used in Phabricator. The class ". - "must extend PhabricatorTranslation.")) + 'This allows customizing texts used in Phabricator. The class '. + 'must extend PhabricatorTranslation.')) ->addExample('PhabricatorEnglishTranslation', pht('Valid Setting')), // TODO: This should be dict I think, but that doesn't // exist yet. $this->newOption('translation.override', 'wild', array()) - ->setSummary(pht("Override translations.")) + ->setSummary(pht('Override translations.')) ->setDescription( pht( "You can use 'translation.override' if you don't want to create ". diff --git a/src/applications/config/option/PhabricatorUIConfigOptions.php b/src/applications/config/option/PhabricatorUIConfigOptions.php index 83c9f054c3..01a55b7922 100644 --- a/src/applications/config/option/PhabricatorUIConfigOptions.php +++ b/src/applications/config/option/PhabricatorUIConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorUIConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("User Interface"); + return pht('User Interface'); } public function getDescription() { - return pht("Configure the Phabricator UI, including colors."); + return pht('Configure the Phabricator UI, including colors.'); } public function getOptions() { diff --git a/src/applications/config/response/PhabricatorConfigResponse.php b/src/applications/config/response/PhabricatorConfigResponse.php index 5ae68f2c6d..cc04498961 100644 --- a/src/applications/config/response/PhabricatorConfigResponse.php +++ b/src/applications/config/response/PhabricatorConfigResponse.php @@ -15,8 +15,8 @@ final class PhabricatorConfigResponse extends AphrontHTMLResponse { // We don't want to flood the console with html, just return a simple // message for now. return pht( - "This install has a fatal setup error, access the internet web ". - "version to view details and resolve it."); + 'This install has a fatal setup error, access the internet web '. + 'version to view details and resolve it.'); } $resources = $this->buildResources(); diff --git a/src/applications/config/view/PhabricatorSetupIssueView.php b/src/applications/config/view/PhabricatorSetupIssueView.php index ef8914e5b6..ca575adc8d 100644 --- a/src/applications/config/view/PhabricatorSetupIssueView.php +++ b/src/applications/config/view/PhabricatorSetupIssueView.php @@ -42,7 +42,7 @@ final class PhabricatorSetupIssueView extends AphrontView { $commands = $issue->getCommands(); if ($commands) { - $run_these = pht("Run these %d command(s):", count($commands)); + $run_these = pht('Run these %d command(s):', count($commands)); $description[] = phutil_tag( 'div', array( @@ -57,11 +57,11 @@ final class PhabricatorSetupIssueView extends AphrontView { $extensions = $issue->getPHPExtensions(); if ($extensions) { $install_these = pht( - "Install these %d PHP extension(s):", count($extensions)); + 'Install these %d PHP extension(s):', count($extensions)); $install_info = pht( - "You can usually install a PHP extension using %s or %s. Common ". - "package names are %s or %s. Try commands like these:", + 'You can usually install a PHP extension using %s or %s. Common '. + 'package names are %s or %s. Try commands like these:', phutil_tag('tt', array(), 'apt-get'), phutil_tag('tt', array(), 'yum'), hsprintf('php-%s', pht('extname')), @@ -82,8 +82,8 @@ final class PhabricatorSetupIssueView extends AphrontView { "OS X, you might want to try Homebrew."); $restart_info = pht( - "After installing new PHP extensions, restart your webserver ". - "for the changes to take effect.", + 'After installing new PHP extensions, restart your webserver '. + 'for the changes to take effect.', hsprintf('')); $description[] = phutil_tag( @@ -152,7 +152,7 @@ final class PhabricatorSetupIssueView extends AphrontView { 'p', array(), pht( - "The current Phabricator configuration has these %d value(s):", + 'The current Phabricator configuration has these %d value(s):', count($configs))); $options = PhabricatorApplicationConfigOptions::loadAllOptions(); @@ -180,8 +180,8 @@ final class PhabricatorSetupIssueView extends AphrontView { 'p', array(), pht( - "To update these %d value(s), run these command(s) from the command ". - "line:", + 'To update these %d value(s), run these command(s) from the command '. + 'line:', count($configs))); $update = array(); @@ -212,12 +212,12 @@ final class PhabricatorSetupIssueView extends AphrontView { $update_info = phutil_tag( 'p', array(), - pht("You can update these %d value(s) here:", count($configs))); + pht('You can update these %d value(s) here:', count($configs))); } else { $update_info = phutil_tag( 'p', array(), - pht("These %d configuration value(s) are related:", count($configs))); + pht('These %d configuration value(s) are related:', count($configs))); } } else { $update = null; @@ -243,7 +243,7 @@ final class PhabricatorSetupIssueView extends AphrontView { 'p', array(), pht( - "The current PHP configuration has these %d value(s):", + 'The current PHP configuration has these %d value(s):', count($configs))); $dict = array(); @@ -284,15 +284,15 @@ final class PhabricatorSetupIssueView extends AphrontView { 'p', array(), pht( - "To update these %d value(s), edit your PHP configuration file.", + 'To update these %d value(s), edit your PHP configuration file.', count($configs))); } else { $info[] = phutil_tag( 'p', array(), pht( - "To update these %d value(s), edit your PHP configuration file, ". - "located here:", + 'To update these %d value(s), edit your PHP configuration file, '. + 'located here:', count($configs))); $info[] = phutil_tag( 'pre', @@ -305,7 +305,7 @@ final class PhabricatorSetupIssueView extends AphrontView { 'p', array(), pht( - "PHP also loaded these configuration file(s):", + 'PHP also loaded these configuration file(s):', count($more_loc))); $info[] = phutil_tag( 'pre', @@ -331,8 +331,8 @@ final class PhabricatorSetupIssueView extends AphrontView { 'p', array(), pht( - "After editing the PHP configuration, restart your ". - "webserver for the changes to take effect.", + 'After editing the PHP configuration, restart your '. + 'webserver for the changes to take effect.', hsprintf(''))); return phutil_tag( diff --git a/src/applications/conpherence/mail/ConpherenceReplyHandler.php b/src/applications/conpherence/mail/ConpherenceReplyHandler.php index 6c57db0700..3a8df69cbb 100644 --- a/src/applications/conpherence/mail/ConpherenceReplyHandler.php +++ b/src/applications/conpherence/mail/ConpherenceReplyHandler.php @@ -14,7 +14,7 @@ final class ConpherenceReplyHandler extends PhabricatorMailReplyHandler { public function validateMailReceiver($mail_receiver) { if (!($mail_receiver instanceof ConpherenceThread)) { - throw new Exception("Mail receiver is not a ConpherenceThread!"); + throw new Exception('Mail receiver is not a ConpherenceThread!'); } } diff --git a/src/applications/conpherence/storage/ConpherenceThread.php b/src/applications/conpherence/storage/ConpherenceThread.php index 3dde719f3b..3efed163a2 100644 --- a/src/applications/conpherence/storage/ConpherenceThread.php +++ b/src/applications/conpherence/storage/ConpherenceThread.php @@ -194,7 +194,7 @@ final class ConpherenceThread extends ConpherenceDAO } public function describeAutomaticCapability($capability) { - return pht("Participants in a thread can always view and edit it."); + return pht('Participants in a thread can always view and edit it.'); } } diff --git a/src/applications/countdown/view/PhabricatorCountdownView.php b/src/applications/countdown/view/PhabricatorCountdownView.php index 1f4b961144..11f43825dd 100644 --- a/src/applications/countdown/view/PhabricatorCountdownView.php +++ b/src/applications/countdown/view/PhabricatorCountdownView.php @@ -30,7 +30,7 @@ final class PhabricatorCountdownView extends AphrontTagView { 'class' => 'phabricator-timer-header', ), array( - "C".$countdown->getID(), + 'C'.$countdown->getID(), ' ', phutil_tag( 'a', diff --git a/src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php b/src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php index 169df03d84..3b40b5e5af 100644 --- a/src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php +++ b/src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php @@ -139,7 +139,7 @@ final class PhabricatorWorkerTaskDetailController $status = pht('Cancelled'); break; default: - throw new Exception("Unknown task status!"); + throw new Exception('Unknown task status!'); } } else { $status = pht('Queued'); diff --git a/src/applications/daemon/management/PhabricatorDaemonManagementListWorkflow.php b/src/applications/daemon/management/PhabricatorDaemonManagementListWorkflow.php index 56263f32c4..5f9ce9d95f 100644 --- a/src/applications/daemon/management/PhabricatorDaemonManagementListWorkflow.php +++ b/src/applications/daemon/management/PhabricatorDaemonManagementListWorkflow.php @@ -17,7 +17,7 @@ final class PhabricatorDaemonManagementListWorkflow $symbols = igroup($symbols, 'library'); foreach ($symbols as $library => $symbol_list) { - $console->writeOut(pht("Daemons in library __%s__:", $library)."\n"); + $console->writeOut(pht('Daemons in library __%s__:', $library)."\n"); foreach ($symbol_list as $symbol) { $console->writeOut(" %s\n", $symbol['name']); } diff --git a/src/applications/daemon/management/PhabricatorDaemonManagementStatusWorkflow.php b/src/applications/daemon/management/PhabricatorDaemonManagementStatusWorkflow.php index ef0d857c7a..dbccce3dc5 100644 --- a/src/applications/daemon/management/PhabricatorDaemonManagementStatusWorkflow.php +++ b/src/applications/daemon/management/PhabricatorDaemonManagementStatusWorkflow.php @@ -17,7 +17,7 @@ final class PhabricatorDaemonManagementStatusWorkflow if (!$daemons) { $console->writeErr( "%s\n", - pht("There are no running Phabricator daemons.")); + pht('There are no running Phabricator daemons.')); return 1; } diff --git a/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php b/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php index d37cc47639..54546c3031 100644 --- a/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php +++ b/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php @@ -273,7 +273,7 @@ abstract class PhabricatorDaemonManagementWorkflow $this->launchDaemon($name, $argv, $is_debug = false); } - $console->writeErr(pht("Done.")."\n"); + $console->writeErr(pht('Done.')."\n"); return 0; } @@ -313,7 +313,7 @@ abstract class PhabricatorDaemonManagementWorkflow } if (empty($running)) { - $console->writeErr(pht("No daemons to kill.")."\n"); + $console->writeErr(pht('No daemons to kill.')."\n"); return 0; } @@ -324,7 +324,7 @@ abstract class PhabricatorDaemonManagementWorkflow $console->writeErr(pht("Stopping daemon '%s' (%s)...", $name, $pid)."\n"); if (!$daemon->isRunning()) { - $console->writeErr(pht("Daemon is not running.")."\n"); + $console->writeErr(pht('Daemon is not running.')."\n"); unset($running[$key]); $daemon->updateStatus(PhabricatorDaemonLog::STATUS_EXITED); } else { diff --git a/src/applications/daemon/view/PhabricatorDaemonLogEventsView.php b/src/applications/daemon/view/PhabricatorDaemonLogEventsView.php index bb7c288aab..a3598bfe25 100644 --- a/src/applications/daemon/view/PhabricatorDaemonLogEventsView.php +++ b/src/applications/daemon/view/PhabricatorDaemonLogEventsView.php @@ -27,7 +27,7 @@ final class PhabricatorDaemonLogEventsView extends AphrontView { $rows = array(); if (!$this->user) { - throw new Exception("Call setUser() before rendering!"); + throw new Exception('Call setUser() before rendering!'); } foreach ($this->events as $event) { @@ -61,10 +61,10 @@ final class PhabricatorDaemonLogEventsView extends AphrontView { if ($more_chars) { $more = new PhutilNumber($more_chars); - $more = pht("Show %d more character(s)...", $more); + $more = pht('Show %d more character(s)...', $more); } else if ($more_lines) { $more = new PhutilNumber($more_lines); - $more = pht("Show %d more line(s)...", $more); + $more = pht('Show %d more line(s)...', $more); } if ($more) { diff --git a/src/applications/daemon/view/PhabricatorDaemonLogListView.php b/src/applications/daemon/view/PhabricatorDaemonLogListView.php index 41d341ec66..754da49de7 100644 --- a/src/applications/daemon/view/PhabricatorDaemonLogListView.php +++ b/src/applications/daemon/view/PhabricatorDaemonLogListView.php @@ -14,7 +14,7 @@ final class PhabricatorDaemonLogListView extends AphrontView { $rows = array(); if (!$this->user) { - throw new Exception("Call setUser() before rendering!"); + throw new Exception('Call setUser() before rendering!'); } $list = id(new PHUIObjectItemListView()) @@ -24,7 +24,7 @@ final class PhabricatorDaemonLogListView extends AphrontView { $epoch = $log->getDateCreated(); $item = id(new PHUIObjectItemView()) - ->setObjectName(pht("Daemon %s", $id)) + ->setObjectName(pht('Daemon %s', $id)) ->setHeader($log->getDaemon()) ->setHref("/daemon/log/{$id}/") ->addIcon('none', phabricator_datetime($epoch, $this->user)); diff --git a/src/applications/differential/conduit/ConduitAPI_differential_close_Method.php b/src/applications/differential/conduit/ConduitAPI_differential_close_Method.php index 5a62601ee9..19c3bb3aaa 100644 --- a/src/applications/differential/conduit/ConduitAPI_differential_close_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_close_Method.php @@ -4,7 +4,7 @@ final class ConduitAPI_differential_close_Method extends ConduitAPI_differential_Method { public function getMethodDescription() { - return pht("Close a Differential revision."); + return pht('Close a Differential revision.'); } public function defineParamTypes() { diff --git a/src/applications/differential/conduit/ConduitAPI_differential_createcomment_Method.php b/src/applications/differential/conduit/ConduitAPI_differential_createcomment_Method.php index 726d5171fd..bfad64481e 100644 --- a/src/applications/differential/conduit/ConduitAPI_differential_createcomment_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_createcomment_Method.php @@ -4,7 +4,7 @@ final class ConduitAPI_differential_createcomment_Method extends ConduitAPI_differential_Method { public function getMethodDescription() { - return pht("Add a comment to a Differential revision."); + return pht('Add a comment to a Differential revision.'); } public function defineParamTypes() { diff --git a/src/applications/differential/conduit/ConduitAPI_differential_creatediff_Method.php b/src/applications/differential/conduit/ConduitAPI_differential_creatediff_Method.php index 8232f14504..2722bb6df2 100644 --- a/src/applications/differential/conduit/ConduitAPI_differential_creatediff_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_creatediff_Method.php @@ -4,7 +4,7 @@ final class ConduitAPI_differential_creatediff_Method extends ConduitAPI_differential_Method { public function getMethodDescription() { - return "Create a new Differential diff."; + return 'Create a new Differential diff.'; } public function defineParamTypes() { diff --git a/src/applications/differential/conduit/ConduitAPI_differential_createinline_Method.php b/src/applications/differential/conduit/ConduitAPI_differential_createinline_Method.php index 96478f5a11..08b524fc09 100644 --- a/src/applications/differential/conduit/ConduitAPI_differential_createinline_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_createinline_Method.php @@ -4,7 +4,7 @@ final class ConduitAPI_differential_createinline_Method extends ConduitAPI_differential_Method { public function getMethodDescription() { - return "Add an inline comment to a Differential revision."; + return 'Add an inline comment to a Differential revision.'; } public function defineParamTypes() { diff --git a/src/applications/differential/conduit/ConduitAPI_differential_createrawdiff_Method.php b/src/applications/differential/conduit/ConduitAPI_differential_createrawdiff_Method.php index 05f71da352..2387cf2845 100644 --- a/src/applications/differential/conduit/ConduitAPI_differential_createrawdiff_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_createrawdiff_Method.php @@ -4,7 +4,7 @@ final class ConduitAPI_differential_createrawdiff_Method extends ConduitAPI_differential_Method { public function getMethodDescription() { - return pht("Create a new Differential diff from a raw diff source."); + return pht('Create a new Differential diff from a raw diff source.'); } public function defineParamTypes() { diff --git a/src/applications/differential/conduit/ConduitAPI_differential_createrevision_Method.php b/src/applications/differential/conduit/ConduitAPI_differential_createrevision_Method.php index deb4999b0b..36b99ffc37 100644 --- a/src/applications/differential/conduit/ConduitAPI_differential_createrevision_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_createrevision_Method.php @@ -4,7 +4,7 @@ final class ConduitAPI_differential_createrevision_Method extends ConduitAPI_differential_Method { public function getMethodDescription() { - return pht("Create a new Differential revision."); + return pht('Create a new Differential revision.'); } public function defineParamTypes() { diff --git a/src/applications/differential/conduit/ConduitAPI_differential_find_Method.php b/src/applications/differential/conduit/ConduitAPI_differential_find_Method.php index 2275845c78..f58c5e293c 100644 --- a/src/applications/differential/conduit/ConduitAPI_differential_find_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_find_Method.php @@ -12,7 +12,7 @@ final class ConduitAPI_differential_find_Method } public function getMethodDescription() { - return "Query Differential revisions which match certain criteria."; + return 'Query Differential revisions which match certain criteria.'; } public function defineParamTypes() { diff --git a/src/applications/differential/conduit/ConduitAPI_differential_finishpostponedlinters_Method.php b/src/applications/differential/conduit/ConduitAPI_differential_finishpostponedlinters_Method.php index f0117073da..b5018dbb55 100644 --- a/src/applications/differential/conduit/ConduitAPI_differential_finishpostponedlinters_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_finishpostponedlinters_Method.php @@ -4,8 +4,8 @@ final class ConduitAPI_differential_finishpostponedlinters_Method extends ConduitAPI_differential_Method { public function getMethodDescription() { - return "Update diff with new lint messages and mark postponed ". - "linters as finished."; + return 'Update diff with new lint messages and mark postponed '. + 'linters as finished.'; } public function defineParamTypes() { diff --git a/src/applications/differential/conduit/ConduitAPI_differential_getalldiffs_Method.php b/src/applications/differential/conduit/ConduitAPI_differential_getalldiffs_Method.php index aa3a853120..a018abd7f7 100644 --- a/src/applications/differential/conduit/ConduitAPI_differential_getalldiffs_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_getalldiffs_Method.php @@ -13,7 +13,7 @@ final class ConduitAPI_differential_getalldiffs_Method } public function getMethodDescription() { - return "Load all diffs for given revisions from Differential."; + return 'Load all diffs for given revisions from Differential.'; } public function defineParamTypes() { diff --git a/src/applications/differential/conduit/ConduitAPI_differential_getcommitmessage_Method.php b/src/applications/differential/conduit/ConduitAPI_differential_getcommitmessage_Method.php index 505570305f..5db1b3a673 100644 --- a/src/applications/differential/conduit/ConduitAPI_differential_getcommitmessage_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_getcommitmessage_Method.php @@ -4,7 +4,7 @@ final class ConduitAPI_differential_getcommitmessage_Method extends ConduitAPI_differential_Method { public function getMethodDescription() { - return "Retrieve Differential commit messages or message templates."; + return 'Retrieve Differential commit messages or message templates.'; } public function defineParamTypes() { @@ -185,7 +185,7 @@ final class ConduitAPI_differential_getcommitmessage_Method $lines = explode("\n", $tip); foreach ($lines as $key => $line) { - $lines[$key] = "# ".$line; + $lines[$key] = '# '.$line; } return implode("\n", $lines); diff --git a/src/applications/differential/conduit/ConduitAPI_differential_getcommitpaths_Method.php b/src/applications/differential/conduit/ConduitAPI_differential_getcommitpaths_Method.php index 8820b4bea7..21896a0481 100644 --- a/src/applications/differential/conduit/ConduitAPI_differential_getcommitpaths_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_getcommitpaths_Method.php @@ -4,8 +4,8 @@ final class ConduitAPI_differential_getcommitpaths_Method extends ConduitAPI_differential_Method { public function getMethodDescription() { - return "Query which paths should be included when committing a ". - "Differential revision."; + return 'Query which paths should be included when committing a '. + 'Differential revision.'; } public function defineParamTypes() { diff --git a/src/applications/differential/conduit/ConduitAPI_differential_getrawdiff_Method.php b/src/applications/differential/conduit/ConduitAPI_differential_getrawdiff_Method.php index 5970012eb1..9788d01245 100644 --- a/src/applications/differential/conduit/ConduitAPI_differential_getrawdiff_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_getrawdiff_Method.php @@ -4,7 +4,7 @@ final class ConduitAPI_differential_getrawdiff_Method extends ConduitAPI_differential_Method { public function getMethodDescription() { - return pht("Retrieve a raw diff"); + return pht('Retrieve a raw diff'); } public function defineParamTypes() { diff --git a/src/applications/differential/conduit/ConduitAPI_differential_getrevision_Method.php b/src/applications/differential/conduit/ConduitAPI_differential_getrevision_Method.php index ff25fbd00b..0697ad1044 100644 --- a/src/applications/differential/conduit/ConduitAPI_differential_getrevision_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_getrevision_Method.php @@ -12,7 +12,7 @@ final class ConduitAPI_differential_getrevision_Method } public function getMethodDescription() { - return "Load the content of a revision from Differential."; + return 'Load the content of a revision from Differential.'; } public function defineParamTypes() { diff --git a/src/applications/differential/conduit/ConduitAPI_differential_getrevisioncomments_Method.php b/src/applications/differential/conduit/ConduitAPI_differential_getrevisioncomments_Method.php index e8f37b6daf..d4ce2aeb90 100644 --- a/src/applications/differential/conduit/ConduitAPI_differential_getrevisioncomments_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_getrevisioncomments_Method.php @@ -12,7 +12,7 @@ final class ConduitAPI_differential_getrevisioncomments_Method } public function getMethodDescription() { - return "Retrieve Differential Revision Comments."; + return 'Retrieve Differential Revision Comments.'; } public function defineParamTypes() { diff --git a/src/applications/differential/conduit/ConduitAPI_differential_parsecommitmessage_Method.php b/src/applications/differential/conduit/ConduitAPI_differential_parsecommitmessage_Method.php index b5934997bc..7fbccbcb06 100644 --- a/src/applications/differential/conduit/ConduitAPI_differential_parsecommitmessage_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_parsecommitmessage_Method.php @@ -6,7 +6,7 @@ final class ConduitAPI_differential_parsecommitmessage_Method private $errors; public function getMethodDescription() { - return pht("Parse commit messages for Differential fields."); + return pht('Parse commit messages for Differential fields.'); } public function defineParamTypes() { diff --git a/src/applications/differential/conduit/ConduitAPI_differential_query_Method.php b/src/applications/differential/conduit/ConduitAPI_differential_query_Method.php index af979dbfac..6a5476758f 100644 --- a/src/applications/differential/conduit/ConduitAPI_differential_query_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_query_Method.php @@ -4,7 +4,7 @@ final class ConduitAPI_differential_query_Method extends ConduitAPI_differential_Method { public function getMethodDescription() { - return "Query Differential revisions which match certain criteria."; + return 'Query Differential revisions which match certain criteria.'; } public function defineParamTypes() { diff --git a/src/applications/differential/conduit/ConduitAPI_differential_setdiffproperty_Method.php b/src/applications/differential/conduit/ConduitAPI_differential_setdiffproperty_Method.php index 657f4b2706..06fa7c0249 100644 --- a/src/applications/differential/conduit/ConduitAPI_differential_setdiffproperty_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_setdiffproperty_Method.php @@ -4,7 +4,7 @@ final class ConduitAPI_differential_setdiffproperty_Method extends ConduitAPI_differential_Method { public function getMethodDescription() { - return "Attach properties to Differential diffs."; + return 'Attach properties to Differential diffs.'; } public function defineParamTypes() { diff --git a/src/applications/differential/conduit/ConduitAPI_differential_updaterevision_Method.php b/src/applications/differential/conduit/ConduitAPI_differential_updaterevision_Method.php index badd7cbb49..44eed48a5b 100644 --- a/src/applications/differential/conduit/ConduitAPI_differential_updaterevision_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_updaterevision_Method.php @@ -4,7 +4,7 @@ final class ConduitAPI_differential_updaterevision_Method extends ConduitAPI_differential_Method { public function getMethodDescription() { - return pht("Update a Differential revision."); + return pht('Update a Differential revision.'); } public function defineParamTypes() { diff --git a/src/applications/differential/conduit/ConduitAPI_differential_updateunitresults_Method.php b/src/applications/differential/conduit/ConduitAPI_differential_updateunitresults_Method.php index be9da87f2d..989b8c545c 100644 --- a/src/applications/differential/conduit/ConduitAPI_differential_updateunitresults_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_updateunitresults_Method.php @@ -4,7 +4,7 @@ final class ConduitAPI_differential_updateunitresults_Method extends ConduitAPI_differential_Method { public function getMethodDescription() { - return "Update arc unit results for a postponed test."; + return 'Update arc unit results for a postponed test.'; } public function defineParamTypes() { diff --git a/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php b/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php index 61832ae125..cf8221c11d 100644 --- a/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php +++ b/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php @@ -110,18 +110,18 @@ final class PhabricatorDifferentialConfigOptions 'thorough review. You can enable "!accept" by setting this '. 'option to true.')), $this->newOption('differential.generated-paths', 'list', array()) - ->setSummary(pht("File regexps to treat as automatically generated.")) + ->setSummary(pht('File regexps to treat as automatically generated.')) ->setDescription( pht( - "List of file regexps that should be treated as if they are ". - "generated by an automatic process, and thus get hidden by ". - "default in differential.")) - ->addExample("/config\.h$/\n#/autobuilt/#", pht("Valid Setting")), + 'List of file regexps that should be treated as if they are '. + 'generated by an automatic process, and thus get hidden by '. + 'default in differential.')) + ->addExample("/config\.h$/\n#/autobuilt/#", pht('Valid Setting')), $this->newOption('differential.sticky-accept', 'bool', true) ->setBoolOptions( array( - pht("Accepts persist across updates"), - pht("Accepts are reset by updates"), + pht('Accepts persist across updates'), + pht('Accepts are reset by updates'), )) ->setSummary( pht('Should "Accepted" revisions remain "Accepted" after updates?')) @@ -139,10 +139,10 @@ final class PhabricatorDifferentialConfigOptions $this->newOption('differential.allow-self-accept', 'bool', false) ->setBoolOptions( array( - pht("Allow self-accept"), - pht("Disallow self-accept"), + pht('Allow self-accept'), + pht('Disallow self-accept'), )) - ->setSummary(pht("Allows users to accept their own revisions.")) + ->setSummary(pht('Allows users to accept their own revisions.')) ->setDescription( pht( "If you set this to true, users can accept their own revisions. ". @@ -153,18 +153,18 @@ final class PhabricatorDifferentialConfigOptions $this->newOption('differential.always-allow-close', 'bool', false) ->setBoolOptions( array( - pht("Allow any user"), - pht("Restrict to submitter"), + pht('Allow any user'), + pht('Restrict to submitter'), )) - ->setSummary(pht("Allows any user to close accepted revisions.")) + ->setSummary(pht('Allows any user to close accepted revisions.')) ->setDescription( pht( - "If you set this to true, any user can close any revision so ". - "long as it has been accepted. This can be useful depending on ". - "your development model. For example, github-style pull requests ". - "where the reviewer is often the actual committer can benefit ". - "from turning this option to true. If false, only the submitter ". - "can close a revision.")), + 'If you set this to true, any user can close any revision so '. + 'long as it has been accepted. This can be useful depending on '. + 'your development model. For example, github-style pull requests '. + 'where the reviewer is often the actual committer can benefit '. + 'from turning this option to true. If false, only the submitter '. + 'can close a revision.')), $this->newOption('differential.always-allow-abandon', 'bool', false) ->setBoolOptions( array( @@ -179,16 +179,16 @@ final class PhabricatorDifferentialConfigOptions $this->newOption('differential.allow-reopen', 'bool', false) ->setBoolOptions( array( - pht("Enable reopen"), - pht("Disable reopen"), + pht('Enable reopen'), + pht('Disable reopen'), )) - ->setSummary(pht("Allows any user to reopen a closed revision.")) + ->setSummary(pht('Allows any user to reopen a closed revision.')) ->setDescription( - pht("If you set this to true, any user can reopen a revision so ". - "long as it has been closed. This can be useful if a revision ". - "is accidentally closed or if a developer changes his or her ". - "mind after closing a revision. If it is false, reopening ". - "is not allowed.")), + pht('If you set this to true, any user can reopen a revision so '. + 'long as it has been closed. This can be useful if a revision '. + 'is accidentally closed or if a developer changes his or her '. + 'mind after closing a revision. If it is false, reopening '. + 'is not allowed.')), $this->newOption('differential.close-on-accept', 'bool', false) ->setBoolOptions( array( @@ -216,10 +216,10 @@ final class PhabricatorDifferentialConfigOptions "'fresh'?")) ->setDescription( pht( - "Revisions newer than this number of days are marked as fresh in ". - "Action Required and Revisions Waiting on You views. Only work ". - "days (not weekends and holidays) are included. Set to 0 to ". - "disable this feature.")), + 'Revisions newer than this number of days are marked as fresh in '. + 'Action Required and Revisions Waiting on You views. Only work '. + 'days (not weekends and holidays) are included. Set to 0 to '. + 'disable this feature.')), $this->newOption('differential.days-stale', 'int', 3) ->setSummary( pht("After this many days, a revision will be considered 'stale'.")) @@ -250,20 +250,20 @@ final class PhabricatorDifferentialConfigOptions false) ->setBoolOptions( array( - pht("Attach Patches"), - pht("Do Not Attach Patches"), + pht('Attach Patches'), + pht('Do Not Attach Patches'), )) - ->setSummary(pht("Attach patches to email, as text attachments.")) + ->setSummary(pht('Attach patches to email, as text attachments.')) ->setDescription( pht( - "If you set this to true, Phabricator will attach patches to ". - "Differential mail (as text attachments). This will not work if ". - "you are using SendGrid as your mail adapter.")), + 'If you set this to true, Phabricator will attach patches to '. + 'Differential mail (as text attachments). This will not work if '. + 'you are using SendGrid as your mail adapter.')), $this->newOption( 'metamta.differential.inline-patches', 'int', 0) - ->setSummary(pht("Inline patches in email, as body text.")) + ->setSummary(pht('Inline patches in email, as body text.')) ->setDescription( pht( "To include patches inline in email bodies, set this to a ". @@ -284,15 +284,15 @@ final class PhabricatorDifferentialConfigOptions false) ->setBoolOptions( array( - pht("Show context"), - pht("Do not show context"), + pht('Show context'), + pht('Do not show context'), )) - ->setSummary(pht("Show diff context around inline comments in email.")) + ->setSummary(pht('Show diff context around inline comments in email.')) ->setDescription( pht( - "Normally, inline comments in emails are shown with a file and ". - "line but without any diff context. Enabling this option adds ". - "diff context.")), + 'Normally, inline comments in emails are shown with a file and '. + 'line but without any diff context. Enabling this option adds '. + 'diff context.')), ); } diff --git a/src/applications/differential/controller/DifferentialDiffCreateController.php b/src/applications/differential/controller/DifferentialDiffCreateController.php index f306160f84..c7d98544a7 100644 --- a/src/applications/differential/controller/DifferentialDiffCreateController.php +++ b/src/applications/differential/controller/DifferentialDiffCreateController.php @@ -20,8 +20,8 @@ final class DifferentialDiffCreateController extends DifferentialController { if (!strlen($diff)) { $errors[] = pht( - "You can not create an empty diff. Copy/paste a diff, or upload a ". - "diff file."); + 'You can not create an empty diff. Copy/paste a diff, or upload a '. + 'diff file.'); $e_diff = pht('Required'); $e_file = pht('Required'); } @@ -79,7 +79,7 @@ final class DifferentialDiffCreateController extends DifferentialController { ->appendChild( id(new AphrontFormSubmitControl()) ->addCancelButton($cancel_uri) - ->setValue(pht("Create Diff"))); + ->setValue(pht('Create Diff'))); $form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Create New Diff')) diff --git a/src/applications/differential/controller/DifferentialInlineCommentEditController.php b/src/applications/differential/controller/DifferentialInlineCommentEditController.php index 1bda9e05d2..08366bbdd6 100644 --- a/src/applications/differential/controller/DifferentialInlineCommentEditController.php +++ b/src/applications/differential/controller/DifferentialInlineCommentEditController.php @@ -22,11 +22,11 @@ final class DifferentialInlineCommentEditController ->executeOne(); if (!$revision) { - throw new Exception("Invalid revision ID!"); + throw new Exception('Invalid revision ID!'); } if (!id(new DifferentialChangeset())->load($changeset_id)) { - throw new Exception("Invalid changeset ID!"); + throw new Exception('Invalid changeset ID!'); } return id(new DifferentialInlineComment()) @@ -46,7 +46,7 @@ final class DifferentialInlineCommentEditController $inline = $this->loadComment($id); if (!$this->canEditInlineComment($user, $inline)) { - throw new Exception("That comment is not editable!"); + throw new Exception('That comment is not editable!'); } return $inline; } diff --git a/src/applications/differential/controller/DifferentialRevisionEditController.php b/src/applications/differential/controller/DifferentialRevisionEditController.php index e88fe947eb..b1dc82af24 100644 --- a/src/applications/differential/controller/DifferentialRevisionEditController.php +++ b/src/applications/differential/controller/DifferentialRevisionEditController.php @@ -49,7 +49,7 @@ final class DifferentialRevisionEditController } if ($diff->getRevisionID()) { // TODO: Redirect? - throw new Exception("This diff is already attached to a revision!"); + throw new Exception('This diff is already attached to a revision!'); } } else { $diff = null; diff --git a/src/applications/differential/controller/DifferentialRevisionLandController.php b/src/applications/differential/controller/DifferentialRevisionLandController.php index 774906671c..2f07b9ee60 100644 --- a/src/applications/differential/controller/DifferentialRevisionLandController.php +++ b/src/applications/differential/controller/DifferentialRevisionLandController.php @@ -40,10 +40,10 @@ final class DifferentialRevisionLandController extends DifferentialController { $text = ''; try { $response = $this->attemptLand($revision, $request); - $title = pht("Success!"); - $text = pht("Revision was successfully landed."); + $title = pht('Success!'); + $text = pht('Revision was successfully landed.'); } catch (Exception $ex) { - $title = pht("Failed to land revision"); + $title = pht('Failed to land revision'); if ($ex instanceof PhutilProxyException) { $text = hsprintf( '%s:
%s
', @@ -76,7 +76,7 @@ final class DifferentialRevisionLandController extends DifferentialController { if (is_string($is_disabled)) { $explain = $is_disabled; } else { - $explain = pht("This action is not currently enabled."); + $explain = pht('This action is not currently enabled.'); } $dialog = id(new AphrontDialogView()) ->setUser($viewer) @@ -97,7 +97,7 @@ final class DifferentialRevisionLandController extends DifferentialController { $dialog = id(new AphrontDialogView()) ->setUser($viewer) - ->setTitle(pht("Land Revision %s?", $revision_id)) + ->setTitle(pht('Land Revision %s?', $revision_id)) ->appendChild($prompt) ->setSubmitURI($request->getRequestURI()) ->addSubmitButton(pht('Land it!')) @@ -109,13 +109,13 @@ final class DifferentialRevisionLandController extends DifferentialController { private function attemptLand($revision, $request) { $status = $revision->getStatus(); if ($status != ArcanistDifferentialRevisionStatus::ACCEPTED) { - throw new Exception("Only Accepted revisions can be landed."); + throw new Exception('Only Accepted revisions can be landed.'); } $repository = $revision->getRepository(); if ($repository === null) { - throw new Exception("revision is not attached to a repository."); + throw new Exception('revision is not attached to a repository.'); } $can_push = PhabricatorPolicyFilter::hasCapability( diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php index 3a859d75d7..61d60332df 100644 --- a/src/applications/differential/controller/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/DifferentialRevisionViewController.php @@ -39,7 +39,7 @@ final class DifferentialRevisionViewController extends DifferentialController { if (!$diffs) { throw new Exception( - "This revision has no diffs. Something has gone quite wrong."); + 'This revision has no diffs. Something has gone quite wrong.'); } $revision->attachActiveDiff(last($diffs)); diff --git a/src/applications/differential/customfield/DifferentialJIRAIssuesField.php b/src/applications/differential/customfield/DifferentialJIRAIssuesField.php index 5a0e62164f..d179952bd4 100644 --- a/src/applications/differential/customfield/DifferentialJIRAIssuesField.php +++ b/src/applications/differential/customfield/DifferentialJIRAIssuesField.php @@ -183,8 +183,8 @@ final class DifferentialJIRAIssuesField $type, pht('Invalid'), pht( - "Some JIRA issues could not be loaded. They may not exist, or ". - "you may not have permission to view them: %s", + 'Some JIRA issues could not be loaded. They may not exist, or '. + 'you may not have permission to view them: %s', $bad), $xaction); } diff --git a/src/applications/differential/customfield/DifferentialLintField.php b/src/applications/differential/customfield/DifferentialLintField.php index b726089715..0d5272b2f8 100644 --- a/src/applications/differential/customfield/DifferentialLintField.php +++ b/src/applications/differential/customfield/DifferentialLintField.php @@ -128,9 +128,9 @@ final class DifferentialLintField $other_line = idx($location, 'line'); $locations[] = idx($location, 'path', $path). - ($other_line ? ":{$other_line}" : ""); + ($other_line ? ":{$other_line}" : ''); } - $description .= "\nOther locations: ".implode(", ", $locations); + $description .= "\nOther locations: ".implode(', ', $locations); } if (strlen($description)) { @@ -231,7 +231,7 @@ final class DifferentialLintField } } - return "Show Full Lint Results (".implode(', ', $show).")"; + return 'Show Full Lint Results ('.implode(', ', $show).')'; } public function getWarningsForDetailView() { diff --git a/src/applications/differential/customfield/DifferentialTitleField.php b/src/applications/differential/customfield/DifferentialTitleField.php index 77cddae751..facd0e80cb 100644 --- a/src/applications/differential/customfield/DifferentialTitleField.php +++ b/src/applications/differential/customfield/DifferentialTitleField.php @@ -110,8 +110,8 @@ final class DifferentialTitleField if (!strlen($value)) { throw new DifferentialFieldValidationException( pht( - "You must provide a revision title in the first line ". - "of your commit message.")); + 'You must provide a revision title in the first line '. + 'of your commit message.')); } if (preg_match('/^<<.*>>$/', $value)) { diff --git a/src/applications/differential/customfield/DifferentialUnitField.php b/src/applications/differential/customfield/DifferentialUnitField.php index fb813f7077..de76056898 100644 --- a/src/applications/differential/customfield/DifferentialUnitField.php +++ b/src/applications/differential/customfield/DifferentialUnitField.php @@ -200,7 +200,7 @@ final class DifferentialUnitField } } - return "Show Full Unit Results (".implode(', ', $show).")"; + return 'Show Full Unit Results ('.implode(', ', $show).')'; } public function getWarningsForDetailView() { diff --git a/src/applications/differential/editor/DifferentialTransactionEditor.php b/src/applications/differential/editor/DifferentialTransactionEditor.php index 9e06fb1da0..87e73ab085 100644 --- a/src/applications/differential/editor/DifferentialTransactionEditor.php +++ b/src/applications/differential/editor/DifferentialTransactionEditor.php @@ -857,22 +857,22 @@ final class DifferentialTransactionEditor if ($revision_status == $status_closed) { return pht( - "You can not commandeer this revision because it has already been ". - "closed."); + 'You can not commandeer this revision because it has already been '. + 'closed.'); } break; case DifferentialAction::ACTION_ABANDON: if (!$actor_is_author && !$always_allow_abandon) { return pht( - "You can not abandon this revision because you do not own it. ". - "You can only abandon revisions you own."); + 'You can not abandon this revision because you do not own it. '. + 'You can only abandon revisions you own.'); } if ($revision_status == $status_closed) { return pht( - "You can not abandon this revision because it has already been ". - "closed."); + 'You can not abandon this revision because it has already been '. + 'closed.'); } // NOTE: Abandons of already-abandoned revisions are treated as no-op @@ -883,14 +883,14 @@ final class DifferentialTransactionEditor case DifferentialAction::ACTION_RECLAIM: if (!$actor_is_author) { return pht( - "You can not reclaim this revision because you do not own ". - "it. You can only reclaim revisions you own."); + 'You can not reclaim this revision because you do not own '. + 'it. You can only reclaim revisions you own.'); } if ($revision_status == $status_closed) { return pht( - "You can not reclaim this revision because it has already been ". - "closed."); + 'You can not reclaim this revision because it has already been '. + 'closed.'); } // NOTE: Reclaims of other non-abandoned revisions are treated as no-op @@ -913,8 +913,8 @@ final class DifferentialTransactionEditor case DifferentialAction::ACTION_RETHINK: if (!$actor_is_author) { return pht( - "You can not plan changes to this revision because you do not ". - "own it. To plan changes to a revision, you must be its owner."); + 'You can not plan changes to this revision because you do not '. + 'own it. To plan changes to a revision, you must be its owner.'); } switch ($revision_status) { @@ -928,12 +928,12 @@ final class DifferentialTransactionEditor break; case ArcanistDifferentialRevisionStatus::ABANDONED: return pht( - "You can not plan changes to this revision because it has ". - "been abandoned."); + 'You can not plan changes to this revision because it has '. + 'been abandoned.'); case ArcanistDifferentialRevisionStatus::CLOSED: return pht( - "You can not plan changes to this revision because it has ". - "already been closed."); + 'You can not plan changes to this revision because it has '. + 'already been closed.'); default: throw new Exception( pht( @@ -947,9 +947,9 @@ final class DifferentialTransactionEditor case DifferentialAction::ACTION_REQUEST: if (!$actor_is_author) { return pht( - "You can not request review of this revision because you do ". - "not own it. To request review of a revision, you must be its ". - "owner."); + 'You can not request review of this revision because you do '. + 'not own it. To request review of a revision, you must be its '. + 'owner.'); } switch ($revision_status) { @@ -963,12 +963,12 @@ final class DifferentialTransactionEditor break; case ArcanistDifferentialRevisionStatus::ABANDONED: return pht( - "You can not request review of this revision because it has ". - "been abandoned. Instead, reclaim it."); + 'You can not request review of this revision because it has '. + 'been abandoned. Instead, reclaim it.'); case ArcanistDifferentialRevisionStatus::CLOSED: return pht( - "You can not request review of this revision because it has ". - "already been closed."); + 'You can not request review of this revision because it has '. + 'already been closed.'); default: throw new Exception( pht( @@ -987,14 +987,14 @@ final class DifferentialTransactionEditor if (!$this->getIsCloseByCommit()) { if (!$actor_is_author && !$always_allow_close) { return pht( - "You can not close this revision because you do not own it. To ". - "close a revision, you must be its owner."); + 'You can not close this revision because you do not own it. To '. + 'close a revision, you must be its owner.'); } if ($revision_status != $status_accepted) { return pht( - "You can not close this revision because it has not been ". - "accepted. You can only close accepted revisions."); + 'You can not close this revision because it has not been '. + 'accepted. You can only close accepted revisions.'); } } break; @@ -1321,15 +1321,15 @@ final class DifferentialTransactionEditor if (!$show_context) { $result[] = "{$file}:{$range} {$inline_content}"; } else { - $result[] = "================"; - $result[] = "Comment at: " . $file . ":" . $range; + $result[] = '================'; + $result[] = 'Comment at: ' . $file . ':' . $range; $result[] = $hunk_parser->makeContextDiff( $changeset->getHunks(), $comment->getIsNewFile(), $comment->getLineNumber(), $comment->getLineLength(), 1); - $result[] = "----------------"; + $result[] = '----------------'; $result[] = $inline_content; $result[] = null; diff --git a/src/applications/differential/landing/DifferentialLandingStrategy.php b/src/applications/differential/landing/DifferentialLandingStrategy.php index aea5d83719..211c54b989 100644 --- a/src/applications/differential/landing/DifferentialLandingStrategy.php +++ b/src/applications/differential/landing/DifferentialLandingStrategy.php @@ -44,14 +44,14 @@ abstract class DifferentialLandingStrategy { $status = $revision->getStatus(); if ($status != ArcanistDifferentialRevisionStatus::ACCEPTED) { - return pht("Only Accepted revisions can be landed."); + return pht('Only Accepted revisions can be landed.'); } if (!PhabricatorPolicyFilter::hasCapability( $viewer, $repository, DiffusionCapabilityPush::CAPABILITY)) { - return pht("You do not have permissions to push to this repository."); + return pht('You do not have permissions to push to this repository.'); } return false; diff --git a/src/applications/differential/landing/DifferentialLandingToGitHub.php b/src/applications/differential/landing/DifferentialLandingToGitHub.php index f459f109bc..74e2a2f689 100644 --- a/src/applications/differential/landing/DifferentialLandingToGitHub.php +++ b/src/applications/differential/landing/DifferentialLandingToGitHub.php @@ -88,7 +88,7 @@ final class DifferentialLandingToGitHub $github_repo); $workspace->execxLocal( - "push %P HEAD:master", + 'push %P HEAD:master', new PhutilOpaqueEnvelope($remote)); } @@ -99,7 +99,7 @@ final class DifferentialLandingToGitHub $this->account = id(new PhabricatorExternalAccountQuery()) ->setViewer($viewer) ->withUserPHIDs(array($viewer->getPHID())) - ->withAccountTypes(array("github")) + ->withAccountTypes(array('github')) ->withAccountDomains(array($repo_domain)) ->executeOne(); diff --git a/src/applications/differential/landing/DifferentialLandingToHostedGit.php b/src/applications/differential/landing/DifferentialLandingToHostedGit.php index 5084785ef4..0b4642a776 100644 --- a/src/applications/differential/landing/DifferentialLandingToHostedGit.php +++ b/src/applications/differential/landing/DifferentialLandingToHostedGit.php @@ -56,7 +56,7 @@ final class DifferentialLandingToHostedGit . "0000000000000000000000000000000000000000.." . "0000000000000000000000000000000000000000\n"; if (strpos($raw_diff, $missing_binary) !== false) { - throw new Exception("Patch is missing content for a binary file"); + throw new Exception('Patch is missing content for a binary file'); } $future = $workspace->execFutureLocal('apply --index -'); @@ -102,7 +102,7 @@ final class DifferentialLandingToHostedGit ArcanistRepositoryAPI $workspace, PhabricatorUser $user) { - $workspace->execxLocal("push origin HEAD:master"); + $workspace->execxLocal('push origin HEAD:master'); } public function createMenuItem( diff --git a/src/applications/differential/landing/DifferentialLandingToHostedMercurial.php b/src/applications/differential/landing/DifferentialLandingToHostedMercurial.php index 029f821814..e121b22441 100644 --- a/src/applications/differential/landing/DifferentialLandingToHostedMercurial.php +++ b/src/applications/differential/landing/DifferentialLandingToHostedMercurial.php @@ -90,7 +90,7 @@ final class DifferentialLandingToHostedMercurial ArcanistRepositoryAPI $workspace, PhabricatorUser $user) { - $workspace->execxLocal("push -b default"); + $workspace->execxLocal('push -b default'); } public function createMenuItem( diff --git a/src/applications/differential/mail/DifferentialReplyHandler.php b/src/applications/differential/mail/DifferentialReplyHandler.php index aa02b3a55f..1abb30bc97 100644 --- a/src/applications/differential/mail/DifferentialReplyHandler.php +++ b/src/applications/differential/mail/DifferentialReplyHandler.php @@ -11,7 +11,7 @@ class DifferentialReplyHandler extends PhabricatorMailReplyHandler { public function validateMailReceiver($mail_receiver) { if (!($mail_receiver instanceof DifferentialRevision)) { - throw new Exception("Receiver is not a DifferentialRevision!"); + throw new Exception('Receiver is not a DifferentialRevision!'); } } @@ -71,7 +71,7 @@ class DifferentialReplyHandler extends PhabricatorMailReplyHandler { $text .= implode(', ', $modified_commands); } - $text .= "."; + $text .= '.'; return $text; } diff --git a/src/applications/differential/parser/DifferentialChangesetParser.php b/src/applications/differential/parser/DifferentialChangesetParser.php index d2c539ffe7..6ca27db88e 100644 --- a/src/applications/differential/parser/DifferentialChangesetParser.php +++ b/src/applications/differential/parser/DifferentialChangesetParser.php @@ -990,7 +990,7 @@ final class DifferentialChangesetParser { for ($ii = $range_end; $ii >= $range_start; $ii--) { // We need to expand tabs to process mixed indenting and to round // correctly later. - $line = str_replace("\t", " ", $this->new[$ii]['text']); + $line = str_replace("\t", ' ', $this->new[$ii]['text']); $trimmed = ltrim($line); if ($trimmed != '') { // We round down to flatten "/**" and " *". @@ -1043,7 +1043,7 @@ final class DifferentialChangesetParser { PhabricatorInlineCommentInterface $comment) { if (!$this->isCommentVisibleOnRenderedDiff($comment)) { - throw new Exception("Comment is not visible on changeset!"); + throw new Exception('Comment is not visible on changeset!'); } $changeset_id = $comment->getChangesetID(); diff --git a/src/applications/differential/parser/DifferentialHunkParser.php b/src/applications/differential/parser/DifferentialHunkParser.php index 4964e109c3..f404d81f4a 100644 --- a/src/applications/differential/parser/DifferentialHunkParser.php +++ b/src/applications/differential/parser/DifferentialHunkParser.php @@ -428,7 +428,7 @@ final class DifferentialHunkParser { if (isset($line[0])) { $char = $line[0]; switch ($char) { - case " ": + case ' ': $line_type_map[$line_index] = null; $line_text[$line_index] = substr($line, 1); break; @@ -442,9 +442,9 @@ final class DifferentialHunkParser { $line_type_map[$line_index] = null; $line_text[$line_index] = $line; break; - case "+": - case "-": - case "\\": + case '+': + case '-': + case '\\': $line_type_map[$line_index] = $char; $line_text[$line_index] = substr($line, 1); break; @@ -602,13 +602,13 @@ final class DifferentialHunkParser { $start = $start - $add_context; $end = $end + $add_context; $hunk_content = array(); - $hunk_pos = array( "-" => 0, "+" => 0 ); - $hunk_offset = array( "-" => null, "+" => null ); - $hunk_last = array( "-" => null, "+" => null ); + $hunk_pos = array( '-' => 0, '+' => 0 ); + $hunk_offset = array( '-' => null, '+' => null ); + $hunk_last = array( '-' => null, '+' => null ); foreach (explode("\n", $hunk->getChanges()) as $line) { - $in_common = strncmp($line, " ", 1) === 0; - $in_old = strncmp($line, "-", 1) === 0 || $in_common; - $in_new = strncmp($line, "+", 1) === 0 || $in_common; + $in_common = strncmp($line, ' ', 1) === 0; + $in_old = strncmp($line, '-', 1) === 0 || $in_common; + $in_new = strncmp($line, '+', 1) === 0 || $in_common; $in_selected = strncmp($line, $prefix, 1) === 0; $skip = !$in_selected && !$in_common; if ($hunk_pos[$prefix] <= $end) { @@ -616,36 +616,36 @@ final class DifferentialHunkParser { if (!$skip || ($hunk_pos[$prefix] != $start && $hunk_pos[$prefix] != $end)) { if ($in_old) { - if ($hunk_offset["-"] === null) { - $hunk_offset["-"] = $hunk_pos["-"]; + if ($hunk_offset['-'] === null) { + $hunk_offset['-'] = $hunk_pos['-']; } - $hunk_last["-"] = $hunk_pos["-"]; + $hunk_last['-'] = $hunk_pos['-']; } if ($in_new) { - if ($hunk_offset["+"] === null) { - $hunk_offset["+"] = $hunk_pos["+"]; + if ($hunk_offset['+'] === null) { + $hunk_offset['+'] = $hunk_pos['+']; } - $hunk_last["+"] = $hunk_pos["+"]; + $hunk_last['+'] = $hunk_pos['+']; } $hunk_content[] = $line; } } - if ($in_old) { ++$hunk_pos["-"]; } - if ($in_new) { ++$hunk_pos["+"]; } + if ($in_old) { ++$hunk_pos['-']; } + if ($in_new) { ++$hunk_pos['+']; } } } - if ($hunk_offset["-"] !== null || $hunk_offset["+"] !== null) { - $header = "@@"; - if ($hunk_offset["-"] !== null) { - $header .= " -" . ($hunk->getOldOffset() + $hunk_offset["-"]) . - "," . ($hunk_last["-"] - $hunk_offset["-"] + 1); + if ($hunk_offset['-'] !== null || $hunk_offset['+'] !== null) { + $header = '@@'; + if ($hunk_offset['-'] !== null) { + $header .= ' -' . ($hunk->getOldOffset() + $hunk_offset['-']) . + ',' . ($hunk_last['-'] - $hunk_offset['-'] + 1); } - if ($hunk_offset["+"] !== null) { - $header .= " +" . ($hunk->getNewOffset() + $hunk_offset["+"]) . - "," . ($hunk_last["+"] - $hunk_offset["+"] + 1); + if ($hunk_offset['+'] !== null) { + $header .= ' +' . ($hunk->getNewOffset() + $hunk_offset['+']) . + ',' . ($hunk_last['+'] - $hunk_offset['+'] + 1); } - $header .= " @@"; + $header .= ' @@'; $context[] = $header; $context[] = implode("\n", $hunk_content); } diff --git a/src/applications/differential/parser/__tests__/DifferentialCustomFieldRevertsParserTestCase.php b/src/applications/differential/parser/__tests__/DifferentialCustomFieldRevertsParserTestCase.php index bb7a276319..ff8d1c1bf7 100644 --- a/src/applications/differential/parser/__tests__/DifferentialCustomFieldRevertsParserTestCase.php +++ b/src/applications/differential/parser/__tests__/DifferentialCustomFieldRevertsParserTestCase.php @@ -42,7 +42,7 @@ final class DifferentialCustomFieldRevertsParserTestCase ), ), - "Reverts 123" => array( + 'Reverts 123' => array( array( 'match' => 'Reverts 123', 'prefix' => 'Reverts', @@ -54,7 +54,7 @@ final class DifferentialCustomFieldRevertsParserTestCase ), - "Reverts r123" => array( + 'Reverts r123' => array( array( 'match' => 'Reverts r123', 'prefix' => 'Reverts', @@ -78,7 +78,7 @@ final class DifferentialCustomFieldRevertsParserTestCase "This doesn't revert anything" => array(), 'nonrevert of r11' => array(), - "fixed a bug" => array(), + 'fixed a bug' => array(), ); foreach ($map as $input => $expect) { diff --git a/src/applications/differential/parser/__tests__/DifferentialHunkParserTestCase.php b/src/applications/differential/parser/__tests__/DifferentialHunkParserTestCase.php index 9147ea3ad9..dc4acb383b 100644 --- a/src/applications/differential/parser/__tests__/DifferentialHunkParserTestCase.php +++ b/src/applications/differential/parser/__tests__/DifferentialHunkParserTestCase.php @@ -46,7 +46,7 @@ final class DifferentialHunkParserTestCase extends PhabricatorTestCase { public function testOneLineOldComment() { $parser = new DifferentialHunkParser(); - $hunks = $this->createSingleChange(1, 0, "-a"); + $hunks = $this->createSingleChange(1, 0, '-a'); $context = $parser->makeContextDiff( $hunks, 0, @@ -58,7 +58,7 @@ final class DifferentialHunkParserTestCase extends PhabricatorTestCase { public function testOneLineNewComment() { $parser = new DifferentialHunkParser(); - $hunks = $this->createSingleChange(0, 1, "+a"); + $hunks = $this->createSingleChange(0, 1, '+a'); $context = $parser->makeContextDiff( $hunks, 1, @@ -70,14 +70,14 @@ final class DifferentialHunkParserTestCase extends PhabricatorTestCase { public function testCannotFindContext() { $parser = new DifferentialHunkParser(); - $hunks = $this->createSingleChange(0, 1, "+a"); + $hunks = $this->createSingleChange(0, 1, '+a'); $context = $parser->makeContextDiff( $hunks, 1, 2, 0, 0); - $this->assertEqual("", $context); + $this->assertEqual('', $context); } public function testOverlapFromStartOfHunk() { diff --git a/src/applications/differential/query/DifferentialRevisionQuery.php b/src/applications/differential/query/DifferentialRevisionQuery.php index 4c6ba908c5..dd6854302f 100644 --- a/src/applications/differential/query/DifferentialRevisionQuery.php +++ b/src/applications/differential/query/DifferentialRevisionQuery.php @@ -889,7 +889,7 @@ final class DifferentialRevisionQuery case self::ORDER_PATH_MODIFIED: if (!$this->pathIDs) { throw new Exception( - "To use ORDER_PATH_MODIFIED, you must specify withPath()."); + 'To use ORDER_PATH_MODIFIED, you must specify withPath().'); } return 'p.epoch'; default: diff --git a/src/applications/differential/render/DifferentialChangesetOneUpRenderer.php b/src/applications/differential/render/DifferentialChangesetOneUpRenderer.php index 25d8aeee58..ac3c2a7d1a 100644 --- a/src/applications/differential/render/DifferentialChangesetOneUpRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetOneUpRenderer.php @@ -71,7 +71,7 @@ final class DifferentialChangesetOneUpRenderer $new_file = null, $id = 0, $vs = 0) { - throw new Exception("Not implemented!"); + throw new Exception('Not implemented!'); } } diff --git a/src/applications/differential/render/DifferentialChangesetTestRenderer.php b/src/applications/differential/render/DifferentialChangesetTestRenderer.php index 4472eaf246..4dd0ff7646 100644 --- a/src/applications/differential/render/DifferentialChangesetTestRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetTestRenderer.php @@ -80,7 +80,7 @@ abstract class DifferentialChangesetTestRenderer $new_file = null, $id = 0, $vs = 0) { - throw new Exception("Not implemented!"); + throw new Exception('Not implemented!'); } } diff --git a/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php b/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php index 78ac18bbb3..b4d36723ff 100644 --- a/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php @@ -94,7 +94,7 @@ final class DifferentialChangesetTwoUpRenderer ), ), $is_first_block - ? pht("Show First 20 Lines") + ? pht('Show First 20 Lines') : pht("\xE2\x96\xB2 Show 20 Lines")); } @@ -130,7 +130,7 @@ final class DifferentialChangesetTwoUpRenderer ), ), $is_last_block - ? pht("Show Last 20 Lines") + ? pht('Show Last 20 Lines') : pht("\xE2\x96\xBC Show 20 Lines")); } diff --git a/src/applications/differential/storage/DifferentialReviewer.php b/src/applications/differential/storage/DifferentialReviewer.php index dd15ce4004..6893d7d187 100644 --- a/src/applications/differential/storage/DifferentialReviewer.php +++ b/src/applications/differential/storage/DifferentialReviewer.php @@ -41,7 +41,7 @@ final class DifferentialReviewer { $viewer_phid = $viewer->getPHID(); if (!array_key_exists($viewer_phid, $this->authority)) { - throw new Exception("You must attachAuthority() first!"); + throw new Exception('You must attachAuthority() first!'); } return $this->authority[$viewer_phid]; } diff --git a/src/applications/differential/storage/__tests__/DifferentialHunkTestCase.php b/src/applications/differential/storage/__tests__/DifferentialHunkTestCase.php index 785f5e7422..a62f7f21d1 100644 --- a/src/applications/differential/storage/__tests__/DifferentialHunkTestCase.php +++ b/src/applications/differential/storage/__tests__/DifferentialHunkTestCase.php @@ -29,8 +29,8 @@ final class DifferentialHunkTestCase extends ArcanistPhutilTestCase { $hunk->setNewOffset(11); $this->assertEqual("a\n", $hunk->makeOldFile()); - $this->assertEqual("a", $hunk->makeNewFile()); - $this->assertEqual(array(11 => "a"), $hunk->getAddedLines()); + $this->assertEqual('a', $hunk->makeNewFile()); + $this->assertEqual(array(11 => 'a'), $hunk->getAddedLines()); } diff --git a/src/applications/differential/view/DifferentialDiffTableOfContentsView.php b/src/applications/differential/view/DifferentialDiffTableOfContentsView.php index 91e44259cf..cffb1f34a1 100644 --- a/src/applications/differential/view/DifferentialDiffTableOfContentsView.php +++ b/src/applications/differential/view/DifferentialDiffTableOfContentsView.php @@ -136,8 +136,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView { $pchar = ($changeset->getOldProperties() === $changeset->getNewProperties()) ? '' - : phutil_tag('span', array('title' => pht('Properties Changed')), 'M') - ; + : phutil_tag('span', array('title' => pht('Properties Changed')), 'M'); $fname = $changeset->getFilename(); $cov = $this->renderCoverage($coverage, $fname); diff --git a/src/applications/differential/view/DifferentialInlineCommentEditView.php b/src/applications/differential/view/DifferentialInlineCommentEditView.php index 4e0f4814cf..453175d75a 100644 --- a/src/applications/differential/view/DifferentialInlineCommentEditView.php +++ b/src/applications/differential/view/DifferentialInlineCommentEditView.php @@ -42,10 +42,10 @@ final class DifferentialInlineCommentEditView extends AphrontView { public function render() { if (!$this->uri) { - throw new Exception("Call setSubmitURI() before render()!"); + throw new Exception('Call setSubmitURI() before render()!'); } if (!$this->user) { - throw new Exception("Call setUser() before render()!"); + throw new Exception('Call setUser() before render()!'); } $content = phabricator_form( diff --git a/src/applications/differential/view/DifferentialLocalCommitsView.php b/src/applications/differential/view/DifferentialLocalCommitsView.php index 6da8515af8..aa965af340 100644 --- a/src/applications/differential/view/DifferentialLocalCommitsView.php +++ b/src/applications/differential/view/DifferentialLocalCommitsView.php @@ -19,7 +19,7 @@ final class DifferentialLocalCommitsView extends AphrontView { public function render() { $user = $this->user; if (!$user) { - throw new Exception("Call setUser() before render()-ing this view."); + throw new Exception('Call setUser() before render()-ing this view.'); } $local = $this->localCommits; diff --git a/src/applications/differential/view/DifferentialRevisionListView.php b/src/applications/differential/view/DifferentialRevisionListView.php index d7564d3f61..ea8fcc531c 100644 --- a/src/applications/differential/view/DifferentialRevisionListView.php +++ b/src/applications/differential/view/DifferentialRevisionListView.php @@ -54,7 +54,7 @@ final class DifferentialRevisionListView extends AphrontView { $user = $this->user; if (!$user) { - throw new Exception("Call setUser() before render()!"); + throw new Exception('Call setUser() before render()!'); } $fresh = PhabricatorEnv::getEnvConfig('differential.days-fresh'); diff --git a/src/applications/differential/view/DifferentialTransactionView.php b/src/applications/differential/view/DifferentialTransactionView.php index dfdb7c2f48..443a4d23c4 100644 --- a/src/applications/differential/view/DifferentialTransactionView.php +++ b/src/applications/differential/view/DifferentialTransactionView.php @@ -104,7 +104,7 @@ final class DifferentialTransactionView $inlines[] = $xaction; break; default: - throw new Exception("Unknown grouped transaction type!"); + throw new Exception('Unknown grouped transaction type!'); } } @@ -149,9 +149,9 @@ final class DifferentialTransactionView $comment_id = $comment->getID(); $item['href'] = - "/D".$revision_id. - "?id=".$changeset_diff_id. - "#inline-".$comment_id; + '/D'.$revision_id. + '?id='.$changeset_diff_id. + '#inline-'.$comment_id; } $items[] = $item; diff --git a/src/applications/diffusion/conduit/ConduitAPI_diffusion_existsquery_Method.php b/src/applications/diffusion/conduit/ConduitAPI_diffusion_existsquery_Method.php index 1948960a46..8fda475ed6 100644 --- a/src/applications/diffusion/conduit/ConduitAPI_diffusion_existsquery_Method.php +++ b/src/applications/diffusion/conduit/ConduitAPI_diffusion_existsquery_Method.php @@ -7,7 +7,7 @@ final class ConduitAPI_diffusion_existsquery_Method extends ConduitAPI_diffusion_abstractquery_Method { public function getMethodDescription() { - return "Determine if code exists in a version control system."; + return 'Determine if code exists in a version control system.'; } public function defineReturnType() { diff --git a/src/applications/diffusion/conduit/ConduitAPI_diffusion_findsymbols_Method.php b/src/applications/diffusion/conduit/ConduitAPI_diffusion_findsymbols_Method.php index d44f51bfef..51462659af 100644 --- a/src/applications/diffusion/conduit/ConduitAPI_diffusion_findsymbols_Method.php +++ b/src/applications/diffusion/conduit/ConduitAPI_diffusion_findsymbols_Method.php @@ -7,7 +7,7 @@ final class ConduitAPI_diffusion_findsymbols_Method extends ConduitAPI_diffusion_Method { public function getMethodDescription() { - return "Retrieve Diffusion symbol information."; + return 'Retrieve Diffusion symbol information.'; } public function defineParamTypes() { diff --git a/src/applications/diffusion/conduit/ConduitAPI_diffusion_getlintmessages_Method.php b/src/applications/diffusion/conduit/ConduitAPI_diffusion_getlintmessages_Method.php index 8d80588c89..1e11ef114b 100644 --- a/src/applications/diffusion/conduit/ConduitAPI_diffusion_getlintmessages_Method.php +++ b/src/applications/diffusion/conduit/ConduitAPI_diffusion_getlintmessages_Method.php @@ -11,7 +11,7 @@ final class ConduitAPI_diffusion_getlintmessages_Method } public function getMethodDescription() { - return "Get lint messages for existing code."; + return 'Get lint messages for existing code.'; } public function defineParamTypes() { diff --git a/src/applications/diffusion/conduit/ConduitAPI_diffusion_getrecentcommitsbypath_Method.php b/src/applications/diffusion/conduit/ConduitAPI_diffusion_getrecentcommitsbypath_Method.php index 3c4ff3f1a7..ca4467e018 100644 --- a/src/applications/diffusion/conduit/ConduitAPI_diffusion_getrecentcommitsbypath_Method.php +++ b/src/applications/diffusion/conduit/ConduitAPI_diffusion_getrecentcommitsbypath_Method.php @@ -9,7 +9,7 @@ final class ConduitAPI_diffusion_getrecentcommitsbypath_Method const DEFAULT_LIMIT = 10; public function getMethodDescription() { - return "Get commit identifiers for recent commits affecting a given path."; + return 'Get commit identifiers for recent commits affecting a given path.'; } public function defineParamTypes() { diff --git a/src/applications/diffusion/conduit/ConduitAPI_diffusion_historyquery_Method.php b/src/applications/diffusion/conduit/ConduitAPI_diffusion_historyquery_Method.php index 8cf211509b..fbcc750ef5 100644 --- a/src/applications/diffusion/conduit/ConduitAPI_diffusion_historyquery_Method.php +++ b/src/applications/diffusion/conduit/ConduitAPI_diffusion_historyquery_Method.php @@ -66,7 +66,7 @@ extends ConduitAPI_diffusion_abstractquery_Method { $hash_list = array(); $parent_map = array(); foreach ($lines as $line) { - list($hash, $parents) = explode(":", $line); + list($hash, $parents) = explode(':', $line); $hash_list[] = $hash; $parent_map[$hash] = preg_split('/\s+/', $parents); } diff --git a/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php b/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php index 40821e3f89..b2271c1316 100644 --- a/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php +++ b/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php @@ -38,8 +38,8 @@ final class PhabricatorDiffusionConfigOptions false) ->setBoolOptions( array( - pht("Attach Patches"), - pht("Do Not Attach Patches"), + pht('Attach Patches'), + pht('Do Not Attach Patches'), )) ->setDescription(pht( 'Set this to true if you want patches to be attached to commit '. @@ -61,8 +61,8 @@ final class PhabricatorDiffusionConfigOptions false) ->setBoolOptions( array( - pht("Enable Closing Audits"), - pht("Disable Closing Audits"), + pht('Enable Closing Audits'), + pht('Disable Closing Audits'), )) ->setDescription(pht('Controls whether Author can Close Audits.')), diff --git a/src/applications/diffusion/controller/DiffusionBrowseFileController.php b/src/applications/diffusion/controller/DiffusionBrowseFileController.php index 2a926136a8..9975fbc830 100644 --- a/src/applications/diffusion/controller/DiffusionBrowseFileController.php +++ b/src/applications/diffusion/controller/DiffusionBrowseFileController.php @@ -125,13 +125,13 @@ final class DiffusionBrowseFileController extends DiffusionBrowseController { switch ($follow) { case 'first': $notice->appendChild( - pht("Unable to continue tracing the history of this file because ". - "this commit is the first commit in the repository.")); + pht('Unable to continue tracing the history of this file because '. + 'this commit is the first commit in the repository.')); break; case 'created': $notice->appendChild( - pht("Unable to continue tracing the history of this file because ". - "this commit created the file.")); + pht('Unable to continue tracing the history of this file because '. + 'this commit created the file.')); break; } $content[] = $notice; @@ -210,7 +210,7 @@ final class DiffusionBrowseFileController extends DiffusionBrowseController { if (!$show_color) { $style = - "border: none; width: 100%; height: 80em; font-family: monospace"; + 'border: none; width: 100%; height: 80em; font-family: monospace'; if (!$show_blame) { $corpus = phutil_tag( 'textarea', @@ -228,7 +228,7 @@ final class DiffusionBrowseFileController extends DiffusionBrowseController { $rev = $rev_list[$k]; $author = $blame_dict[$rev]['author']; $rows[] = - sprintf("%-10s %-20s %s", substr($rev, 0, 7), $author, $line); + sprintf('%-10s %-20s %s', substr($rev, 0, 7), $author, $line); } $corpus = phutil_tag( @@ -256,7 +256,7 @@ final class DiffusionBrowseFileController extends DiffusionBrowseController { $corpus_table = javelin_tag( 'table', array( - 'class' => "diffusion-source remarkup-code PhabricatorMonospaced", + 'class' => 'diffusion-source remarkup-code PhabricatorMonospaced', 'sigil' => 'phabricator-source', ), $rows); diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php index c6dd87a946..ab156ef072 100644 --- a/src/applications/diffusion/controller/DiffusionCommitController.php +++ b/src/applications/diffusion/controller/DiffusionCommitController.php @@ -247,7 +247,7 @@ final class DiffusionCommitController extends DiffusionController { $change_panel = new PHUIObjectBoxView(); $header = new PHUIHeaderView(); - $header->setHeader("Changes (".number_format($count).")"); + $header->setHeader('Changes ('.number_format($count).')'); $change_panel->setID('toc'); if ($count > self::CHANGES_LIMIT && !$show_all_details) { @@ -264,7 +264,7 @@ final class DiffusionCommitController extends DiffusionController { ->setSeverity(AphrontErrorView::SEVERITY_WARNING) ->setTitle('Very Large Commit') ->appendChild( - pht("This commit is very large. Load each file individually.")); + pht('This commit is very large. Load each file individually.')); $change_panel->setErrorView($warning_view); $header->addActionLink($button); @@ -288,7 +288,7 @@ final class DiffusionCommitController extends DiffusionController { $vcs_supports_directory_changes = false; break; default: - throw new Exception("Unknown VCS."); + throw new Exception('Unknown VCS.'); } $references = array(); diff --git a/src/applications/diffusion/controller/DiffusionController.php b/src/applications/diffusion/controller/DiffusionController.php index 2a76156a5d..a8c42eab15 100644 --- a/src/applications/diffusion/controller/DiffusionController.php +++ b/src/applications/diffusion/controller/DiffusionController.php @@ -11,7 +11,7 @@ abstract class DiffusionController extends PhabricatorController { protected function getDiffusionRequest() { if (!$this->diffusionRequest) { - throw new Exception("No Diffusion request object!"); + throw new Exception('No Diffusion request object!'); } return $this->diffusionRequest; } @@ -104,7 +104,7 @@ abstract class DiffusionController extends PhabricatorController { $crumb = new PhabricatorCrumbView(); if ($spec['commit']) { $crumb->setName( - pht("Tags for %s", 'r'.$callsign.$stable_commit)); + pht('Tags for %s', 'r'.$callsign.$stable_commit)); $crumb->setHref($drequest->generateURI( array( 'action' => 'commit', diff --git a/src/applications/diffusion/controller/DiffusionExternalController.php b/src/applications/diffusion/controller/DiffusionExternalController.php index cc322a3034..98285c8478 100644 --- a/src/applications/diffusion/controller/DiffusionExternalController.php +++ b/src/applications/diffusion/controller/DiffusionExternalController.php @@ -76,9 +76,9 @@ final class DiffusionExternalController extends DiffusionController { ->appendChild(phutil_tag( 'p', array(), - pht("This external (%s) does not appear in any tracked ". - "repository. It may exist in an untracked repository that ". - "Diffusion does not know about.", $desc))); + pht('This external (%s) does not appear in any tracked '. + 'repository. It may exist in an untracked repository that '. + 'Diffusion does not know about.', $desc))); } else if (count($commits) == 1) { $commit = head($commits); $repo = $repositories[$commit->getRepositoryID()]; diff --git a/src/applications/diffusion/controller/DiffusionInlineCommentController.php b/src/applications/diffusion/controller/DiffusionInlineCommentController.php index 78df83292d..c0e816951a 100644 --- a/src/applications/diffusion/controller/DiffusionInlineCommentController.php +++ b/src/applications/diffusion/controller/DiffusionInlineCommentController.php @@ -19,7 +19,7 @@ final class DiffusionInlineCommentController 'phid = %s', $commit_phid); if (!$commit) { - throw new Exception("Invalid commit ID!"); + throw new Exception('Invalid commit ID!'); } // TODO: Write a real PathQuery object? @@ -31,7 +31,7 @@ final class DiffusionInlineCommentController $path_id); if (!$path) { - throw new Exception("Invalid path ID!"); + throw new Exception('Invalid path ID!'); } return id(new PhabricatorAuditInlineComment()) @@ -49,7 +49,7 @@ final class DiffusionInlineCommentController $inline = $this->loadComment($id); if (!$this->canEditInlineComment($user, $inline)) { - throw new Exception("That comment is not editable!"); + throw new Exception('That comment is not editable!'); } return $inline; } diff --git a/src/applications/diffusion/controller/DiffusionRepositoryController.php b/src/applications/diffusion/controller/DiffusionRepositoryController.php index f58e9d3c8e..149b55da46 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryController.php @@ -290,7 +290,7 @@ final class DiffusionRepositoryController extends DiffusionController { ->setIconFont('fa-fork'); $button = new PHUIButtonView(); - $button->setText(pht("Show All Branches")); + $button->setText(pht('Show All Branches')); $button->setTag('a'); $button->setIcon($icon); $button->setHref($drequest->generateURI( @@ -362,7 +362,7 @@ final class DiffusionRepositoryController extends DiffusionController { ->setIconFont('fa-tag'); $button = new PHUIButtonView(); - $button->setText(pht("Show All Tags")); + $button->setText(pht('Show All Tags')); $button->setTag('a'); $button->setIcon($icon); $button->setHref($drequest->generateURI( diff --git a/src/applications/diffusion/controller/DiffusionRepositoryCreateController.php b/src/applications/diffusion/controller/DiffusionRepositoryCreateController.php index f4390c0c75..9a65a5bfd0 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryCreateController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryCreateController.php @@ -43,7 +43,7 @@ final class DiffusionRepositoryCreateController $cancel_uri = $this->getApplicationURI('new/'); break; default: - throw new Exception("Invalid edit operation!"); + throw new Exception('Invalid edit operation!'); } $form = id(new PHUIPagedFormView()) @@ -432,7 +432,7 @@ final class DiffusionRepositoryCreateController $is_mercurial = true; break; default: - throw new Exception("Unsupported VCS!"); + throw new Exception('Unsupported VCS!'); } $has_local = ($is_git || $is_mercurial); @@ -478,7 +478,7 @@ final class DiffusionRepositoryCreateController "repository, use the //Import Only// option at the end of this ". "workflow.)"); } else { - throw new Exception("Unsupported VCS!"); + throw new Exception('Unsupported VCS!'); } $page->addRemarkupInstructions($instructions, 'remoteURI'); @@ -492,7 +492,7 @@ final class DiffusionRepositoryCreateController if (!strlen($v_remote)) { $c_remote->setError(pht('Required')); $page->addPageError( - pht("You must specify a URI.")); + pht('You must specify a URI.')); } else { $proto = $this->getRemoteURIProtocol($v_remote); @@ -623,7 +623,7 @@ final class DiffusionRepositoryCreateController 'accessed over the `file://` protocol. Continue to the next step.'), 'credential'); } else { - throw new Exception("Unknown URI protocol!"); + throw new Exception('Unknown URI protocol!'); } if ($provides_type) { @@ -735,7 +735,7 @@ final class DiffusionRepositoryCreateController ->setUser($viewer) ->addRemarkupInstructions( pht( - "Select access policies for this repository.")) + 'Select access policies for this repository.')) ->addControl($view_policy) ->addControl($edit_policy) ->addControl($push_policy); diff --git a/src/applications/diffusion/controller/DiffusionServeController.php b/src/applications/diffusion/controller/DiffusionServeController.php index e8b238053d..3154231116 100644 --- a/src/applications/diffusion/controller/DiffusionServeController.php +++ b/src/applications/diffusion/controller/DiffusionServeController.php @@ -16,7 +16,7 @@ final class DiffusionServeController extends DiffusionController { // We get this initially for `info/refs`. // Git also gives us a User-Agent like "git/1.8.2.3". $vcs = PhabricatorRepositoryType::REPOSITORY_TYPE_GIT; - } else if (strncmp($user_agent, "git/", 4) === 0) { + } else if (strncmp($user_agent, 'git/', 4) === 0) { $vcs = PhabricatorRepositoryType::REPOSITORY_TYPE_GIT; } else if ($content_type == 'application/x-git-upload-pack-request') { // We get this for `git-upload-pack`. @@ -305,7 +305,7 @@ final class DiffusionServeController extends DiffusionController { // resolve the binary first. $bin = Filesystem::resolveBinary('git-http-backend'); if (!$bin) { - throw new Exception("Unable to find `git-http-backend` in PATH!"); + throw new Exception('Unable to find `git-http-backend` in PATH!'); } $env = array( @@ -448,7 +448,7 @@ final class DiffusionServeController extends DiffusionController { $bin = Filesystem::resolveBinary('hg'); if (!$bin) { - throw new Exception("Unable to find `hg` in PATH!"); + throw new Exception('Unable to find `hg` in PATH!'); } $env = $this->getCommonEnvironment($viewer); @@ -502,7 +502,7 @@ final class DiffusionServeController extends DiffusionController { // "Why would you do this?". $args_raw = array(); - for ($ii = 1; ; $ii++) { + for ($ii = 1;; $ii++) { $header = 'HTTP_X_HGARG_'.$ii; if (!array_key_exists($header, $_SERVER)) { break; diff --git a/src/applications/diffusion/controller/DiffusionSymbolController.php b/src/applications/diffusion/controller/DiffusionSymbolController.php index c389ee1052..07ff1bae5d 100644 --- a/src/applications/diffusion/controller/DiffusionSymbolController.php +++ b/src/applications/diffusion/controller/DiffusionSymbolController.php @@ -136,7 +136,7 @@ final class DiffusionSymbolController extends DiffusionController { '', )); $table->setNoDataString( - pht("No matching symbol could be found in any indexed project.")); + pht('No matching symbol could be found in any indexed project.')); $panel = new AphrontPanelView(); $panel->setHeader(pht('Similar Symbols')); diff --git a/src/applications/diffusion/data/DiffusionRepositoryTag.php b/src/applications/diffusion/data/DiffusionRepositoryTag.php index a8e3696b46..12e71185bf 100644 --- a/src/applications/diffusion/data/DiffusionRepositoryTag.php +++ b/src/applications/diffusion/data/DiffusionRepositoryTag.php @@ -72,7 +72,7 @@ final class DiffusionRepositoryTag { public function getMessage() { if ($this->message === false) { - throw new Exception("Message is not attached!"); + throw new Exception('Message is not attached!'); } return $this->message; } diff --git a/src/applications/diffusion/engine/DiffusionCommitHookEngine.php b/src/applications/diffusion/engine/DiffusionCommitHookEngine.php index d4f0df94b7..430417fcf7 100644 --- a/src/applications/diffusion/engine/DiffusionCommitHookEngine.php +++ b/src/applications/diffusion/engine/DiffusionCommitHookEngine.php @@ -610,8 +610,8 @@ final class DiffusionCommitHookEngine extends Phobject { if (!$err) { // This hook ran OK, but echo its output in case there was something // informative. - $console->writeOut("%s", $stdout); - $console->writeErr("%s", $stderr); + $console->writeOut('%s', $stdout); + $console->writeErr('%s', $stderr); continue; } diff --git a/src/applications/diffusion/query/DiffusionCommitQuery.php b/src/applications/diffusion/query/DiffusionCommitQuery.php index 1b7b90d706..73a9221726 100644 --- a/src/applications/diffusion/query/DiffusionCommitQuery.php +++ b/src/applications/diffusion/query/DiffusionCommitQuery.php @@ -135,7 +135,7 @@ final class DiffusionCommitQuery public function getIdentifierMap() { if ($this->identifierMap === null) { throw new Exception( - "You must execute() the query before accessing the identifier map."); + 'You must execute() the query before accessing the identifier map.'); } return $this->identifierMap; } diff --git a/src/applications/diffusion/query/DiffusionLintCountQuery.php b/src/applications/diffusion/query/DiffusionLintCountQuery.php index 1b227815f7..89fca4cded 100644 --- a/src/applications/diffusion/query/DiffusionLintCountQuery.php +++ b/src/applications/diffusion/query/DiffusionLintCountQuery.php @@ -23,11 +23,11 @@ final class DiffusionLintCountQuery extends PhabricatorQuery { public function execute() { if (!$this->paths) { - throw new Exception(pht("Call withPaths() before execute()!")); + throw new Exception(pht('Call withPaths() before execute()!')); } if (!$this->branchIDs) { - throw new Exception(pht("Call withBranchIDs() before execute()!")); + throw new Exception(pht('Call withBranchIDs() before execute()!')); } $conn_r = id(new PhabricatorRepositoryCommit())->establishConnection('r'); diff --git a/src/applications/diffusion/query/DiffusionQuery.php b/src/applications/diffusion/query/DiffusionQuery.php index 2b189d2266..f54a7a0ebd 100644 --- a/src/applications/diffusion/query/DiffusionQuery.php +++ b/src/applications/diffusion/query/DiffusionQuery.php @@ -32,7 +32,7 @@ abstract class DiffusionQuery extends PhabricatorQuery { $name = idx($map, $repository->getVersionControlSystem()); if (!$name) { - throw new Exception("Unsupported VCS!"); + throw new Exception('Unsupported VCS!'); } $class = str_replace('Diffusion', 'Diffusion'.$name, $base_class); diff --git a/src/applications/diffusion/query/DiffusionSymbolQuery.php b/src/applications/diffusion/query/DiffusionSymbolQuery.php index ec546ec1a5..a9341d34fd 100644 --- a/src/applications/diffusion/query/DiffusionSymbolQuery.php +++ b/src/applications/diffusion/query/DiffusionSymbolQuery.php @@ -119,10 +119,10 @@ final class DiffusionSymbolQuery extends PhabricatorOffsetPagedQuery { public function execute() { if ($this->name && $this->namePrefix) { throw new Exception( - "You can not set both a name and a name prefix!"); + 'You can not set both a name and a name prefix!'); } else if (!$this->name && !$this->namePrefix) { throw new Exception( - "You must set a name or a name prefix!"); + 'You must set a name or a name prefix!'); } $symbol = new PhabricatorRepositorySymbol(); diff --git a/src/applications/diffusion/query/filecontent/DiffusionFileContentQuery.php b/src/applications/diffusion/query/filecontent/DiffusionFileContentQuery.php index 94e2697046..2f3493737a 100644 --- a/src/applications/diffusion/query/filecontent/DiffusionFileContentQuery.php +++ b/src/applications/diffusion/query/filecontent/DiffusionFileContentQuery.php @@ -28,7 +28,7 @@ abstract class DiffusionFileContentQuery extends DiffusionQuery { if ($try_encoding) { $this->fileContent->setCorpus( phutil_utf8_convert( - $this->fileContent->getCorpus(), "UTF-8", $try_encoding)); + $this->fileContent->getCorpus(), 'UTF-8', $try_encoding)); } return $this->fileContent; diff --git a/src/applications/diffusion/query/filecontent/DiffusionSvnFileContentQuery.php b/src/applications/diffusion/query/filecontent/DiffusionSvnFileContentQuery.php index c78b6f9b95..d87db3ec87 100644 --- a/src/applications/diffusion/query/filecontent/DiffusionSvnFileContentQuery.php +++ b/src/applications/diffusion/query/filecontent/DiffusionSvnFileContentQuery.php @@ -26,9 +26,9 @@ final class DiffusionSvnFileContentQuery extends DiffusionFileContentQuery { // nuked; Diffusion will think it still exists and try to grab content // at HEAD. throw new Exception( - "Failed to retrieve file content from Subversion. The file may ". - "have been recently deleted, or the Diffusion cache may be out of ". - "date."); + 'Failed to retrieve file content from Subversion. The file may '. + 'have been recently deleted, or the Diffusion cache may be out of '. + 'date.'); } else { throw $ex; } diff --git a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelGitRefQuery.php b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelGitRefQuery.php index 82de8e404a..751fbc4a95 100644 --- a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelGitRefQuery.php +++ b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelGitRefQuery.php @@ -25,7 +25,7 @@ final class DiffusionLowLevelGitRefQuery extends DiffusionLowLevelQuery { $repository = $this->getRepository(); if ($this->isTag && $this->isOriginBranch) { - throw new Exception("Specify tags or origin branches, not both!"); + throw new Exception('Specify tags or origin branches, not both!'); } else if ($this->isTag) { $prefix = 'refs/tags/'; } else if ($this->isOriginBranch) { @@ -36,7 +36,7 @@ final class DiffusionLowLevelGitRefQuery extends DiffusionLowLevelQuery { $prefix = 'refs/remotes/'.$remote.'/'; } } else { - throw new Exception("Specify tags or origin branches!"); + throw new Exception('Specify tags or origin branches!'); } $order = '-creatordate'; @@ -114,7 +114,7 @@ final class DiffusionLowLevelGitRefQuery extends DiffusionLowLevelQuery { $fields[$key] = '%('.$field.')'; } - return implode("%01", $fields); + return implode('%01', $fields); } /** diff --git a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelQuery.php b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelQuery.php index 9f0a61bfc8..6c19f9839b 100644 --- a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelQuery.php +++ b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelQuery.php @@ -17,7 +17,7 @@ abstract class DiffusionLowLevelQuery extends Phobject { public function execute() { if (!$this->getRepository()) { - throw new Exception("Call setRepository() before execute()!"); + throw new Exception('Call setRepository() before execute()!'); } return $this->executeQuery(); diff --git a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelResolveRefsQuery.php b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelResolveRefsQuery.php index abc7ae1c22..0d18d9601e 100644 --- a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelResolveRefsQuery.php +++ b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelResolveRefsQuery.php @@ -31,7 +31,7 @@ final class DiffusionLowLevelResolveRefsQuery $result = $this->resolveSubversionRefs(); break; default: - throw new Exception("Unsupported repository type!"); + throw new Exception('Unsupported repository type!'); } return $result; @@ -46,7 +46,7 @@ final class DiffusionLowLevelResolveRefsQuery $lines = explode("\n", rtrim($stdout, "\n")); if (count($lines) !== count($this->refs)) { - throw new Exception("Unexpected line count from `git cat-file`!"); + throw new Exception('Unexpected line count from `git cat-file`!'); } $hits = array(); diff --git a/src/applications/diffusion/query/rawdiff/DiffusionGitRawDiffQuery.php b/src/applications/diffusion/query/rawdiff/DiffusionGitRawDiffQuery.php index 566f8f9d02..c7fdeb0e38 100644 --- a/src/applications/diffusion/query/rawdiff/DiffusionGitRawDiffQuery.php +++ b/src/applications/diffusion/query/rawdiff/DiffusionGitRawDiffQuery.php @@ -28,7 +28,7 @@ final class DiffusionGitRawDiffQuery extends DiffusionRawDiffQuery { $path = nonempty($drequest->getPath(), '.'); $future = $repository->getLocalCommandFuture( - "diff %C %s %s -- %s", + 'diff %C %s %s -- %s', $options, $against, $commit, diff --git a/src/applications/diffusion/request/DiffusionGitRequest.php b/src/applications/diffusion/request/DiffusionGitRequest.php index f42f7a57bb..d8c9e932e1 100644 --- a/src/applications/diffusion/request/DiffusionGitRequest.php +++ b/src/applications/diffusion/request/DiffusionGitRequest.php @@ -17,7 +17,7 @@ final class DiffusionGitRequest extends DiffusionRequest { if ($this->repository) { return $this->repository->getDefaultBranch(); } - throw new Exception("Unable to determine branch!"); + throw new Exception('Unable to determine branch!'); } protected function getResolvableBranchName($branch) { diff --git a/src/applications/diffusion/request/DiffusionMercurialRequest.php b/src/applications/diffusion/request/DiffusionMercurialRequest.php index b76d0597d6..d518f3b70d 100644 --- a/src/applications/diffusion/request/DiffusionMercurialRequest.php +++ b/src/applications/diffusion/request/DiffusionMercurialRequest.php @@ -19,7 +19,7 @@ final class DiffusionMercurialRequest extends DiffusionRequest { return $this->repository->getDefaultBranch(); } - throw new Exception("Unable to determine branch!"); + throw new Exception('Unable to determine branch!'); } } diff --git a/src/applications/diffusion/request/DiffusionRequest.php b/src/applications/diffusion/request/DiffusionRequest.php index e2c21367c1..e18f2a3578 100644 --- a/src/applications/diffusion/request/DiffusionRequest.php +++ b/src/applications/diffusion/request/DiffusionRequest.php @@ -163,7 +163,7 @@ abstract class DiffusionRequest { $class = idx($map, $repository->getVersionControlSystem()); if (!$class) { - throw new Exception("Unknown version control system!"); + throw new Exception('Unknown version control system!'); } $object = new $class(); @@ -665,7 +665,7 @@ abstract class DiffusionRequest { // Prevent any hyjinx since we're ultimately shipping this to the // filesystem under a lot of workflows. if ($part == '..') { - throw new Exception("Invalid path URI."); + throw new Exception('Invalid path URI.'); } } diff --git a/src/applications/diffusion/ssh/DiffusionSSHMercurialServeWorkflow.php b/src/applications/diffusion/ssh/DiffusionSSHMercurialServeWorkflow.php index e7697e6083..13bdb9bc34 100644 --- a/src/applications/diffusion/ssh/DiffusionSSHMercurialServeWorkflow.php +++ b/src/applications/diffusion/ssh/DiffusionSSHMercurialServeWorkflow.php @@ -32,11 +32,11 @@ final class DiffusionSSHMercurialServeWorkflow $args = $this->getArgs(); if (!$args->getArg('stdio')) { - throw new Exception("Expected `hg ... --stdio`!"); + throw new Exception('Expected `hg ... --stdio`!'); } if ($args->getArg('command') !== array('serve')) { - throw new Exception("Expected `hg ... serve`!"); + throw new Exception('Expected `hg ... serve`!'); } $command = csprintf('hg -R %s serve --stdio', $repository->getLocalPath()); diff --git a/src/applications/diffusion/ssh/DiffusionSSHSubversionServeWorkflow.php b/src/applications/diffusion/ssh/DiffusionSSHSubversionServeWorkflow.php index 09315d1ef8..5d0e4fad3f 100644 --- a/src/applications/diffusion/ssh/DiffusionSSHSubversionServeWorkflow.php +++ b/src/applications/diffusion/ssh/DiffusionSSHSubversionServeWorkflow.php @@ -35,7 +35,7 @@ final class DiffusionSSHSubversionServeWorkflow protected function executeRepositoryOperations() { $args = $this->getArgs(); if (!$args->getArg('tunnel')) { - throw new Exception("Expected `svnserve -t`!"); + throw new Exception('Expected `svnserve -t`!'); } $command = csprintf( diff --git a/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php b/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php index 74bfcdc728..d62ff1d87e 100644 --- a/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php +++ b/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php @@ -8,7 +8,7 @@ abstract class DiffusionSSHWorkflow extends PhabricatorSSHWorkflow { public function getRepository() { if (!$this->repository) { - throw new Exception("Call loadRepository() before getRepository()!"); + throw new Exception('Call loadRepository() before getRepository()!'); } return $this->repository; } @@ -62,7 +62,7 @@ abstract class DiffusionSSHWorkflow extends PhabricatorSSHWorkflow { 'Unrecognized repository path "%s". Expected a path like '. '"%s".', $path, - "/diffusion/X/")); + '/diffusion/X/')); } $callsign = $matches[1]; diff --git a/src/applications/diffusion/view/DiffusionCommentView.php b/src/applications/diffusion/view/DiffusionCommentView.php index defaf49a07..41804e59a8 100644 --- a/src/applications/diffusion/view/DiffusionCommentView.php +++ b/src/applications/diffusion/view/DiffusionCommentView.php @@ -114,15 +114,15 @@ final class DiffusionCommentView extends AphrontView { $actions = array(); if ($action == PhabricatorAuditActionConstants::ADD_CCS) { $rendered_ccs = $this->renderHandleList($added_ccs); - $actions[] = pht("%s added CCs: %s.", $author_link, $rendered_ccs); + $actions[] = pht('%s added CCs: %s.', $author_link, $rendered_ccs); } else if ($action == PhabricatorAuditActionConstants::ADD_AUDITORS) { $rendered_auditors = $this->renderHandleList($added_auditors); $actions[] = pht( - "%s added auditors: %s.", + '%s added auditors: %s.', $author_link, $rendered_auditors); } else { - $actions[] = hsprintf("%s %s this commit.", $author_link, $verb); + $actions[] = hsprintf('%s %s this commit.', $author_link, $verb); } foreach ($actions as $key => $action) { diff --git a/src/applications/diffusion/view/DiffusionEmptyResultView.php b/src/applications/diffusion/view/DiffusionEmptyResultView.php index 66d14ab36f..e8a8de7641 100644 --- a/src/applications/diffusion/view/DiffusionEmptyResultView.php +++ b/src/applications/diffusion/view/DiffusionEmptyResultView.php @@ -32,7 +32,7 @@ final class DiffusionEmptyResultView extends DiffusionView { $title = pht('Path Does Not Exist'); // TODO: Under git, this error message should be more specific. It // may exist on some other branch. - $body = pht("This path does not exist anywhere."); + $body = pht('This path does not exist anywhere.'); $severity = AphrontErrorView::SEVERITY_ERROR; break; case DiffusionBrowseResultSet::REASON_IS_EMPTY: @@ -54,8 +54,8 @@ final class DiffusionEmptyResultView extends DiffusionView { $title = pht('Path Was Deleted'); $body = pht( - "This path does not exist at %s. It was deleted in %s and last %s ". - "at %s.", + 'This path does not exist at %s. It was deleted in %s and last %s '. + 'at %s.', $commit, self::linkCommit($drequest->getRepository(), $deleted), $browse, diff --git a/src/applications/diviner/atom/DivinerAtom.php b/src/applications/diviner/atom/DivinerAtom.php index b130dbf2a4..f9d10fa524 100644 --- a/src/applications/diviner/atom/DivinerAtom.php +++ b/src/applications/diviner/atom/DivinerAtom.php @@ -95,14 +95,14 @@ final class DivinerAtom { public function getDocblockText() { if ($this->docblockText === null) { - throw new Exception("Call setDocblockRaw() before getDocblockText()!"); + throw new Exception('Call setDocblockRaw() before getDocblockText()!'); } return $this->docblockText; } public function getDocblockMeta() { if ($this->docblockMeta === null) { - throw new Exception("Call setDocblockRaw() before getDocblockMeta()!"); + throw new Exception('Call setDocblockRaw() before getDocblockMeta()!'); } return $this->docblockMeta; } @@ -248,7 +248,7 @@ final class DivinerAtom { public function setParentHash($parent_hash) { if ($this->parentHash) { - throw new Exception("Atom already has a parent!"); + throw new Exception('Atom already has a parent!'); } $this->parentHash = $parent_hash; return $this; @@ -260,7 +260,7 @@ final class DivinerAtom { public function setParent(DivinerAtom $atom) { if ($this->parentHash) { - throw new Exception("Parent hash has already been computed!"); + throw new Exception('Parent hash has already been computed!'); } $this->parent = $atom; return $this; @@ -275,7 +275,7 @@ final class DivinerAtom { public function addChild(DivinerAtom $atom) { if ($this->childHashes) { - throw new Exception("Child hashes have already been computed!"); + throw new Exception('Child hashes have already been computed!'); } $atom->setParent($this); diff --git a/src/applications/diviner/atomizer/DivinerArticleAtomizer.php b/src/applications/diviner/atomizer/DivinerArticleAtomizer.php index 3a6f0bf826..62f568d3ef 100644 --- a/src/applications/diviner/atomizer/DivinerArticleAtomizer.php +++ b/src/applications/diviner/atomizer/DivinerArticleAtomizer.php @@ -16,7 +16,7 @@ final class DivinerArticleAtomizer extends DivinerAtomizer { $title = idx($meta, 'title'); if (!strlen($title)) { $title = pht('Untitled Article "%s"', basename($file_name)); - $atom->addWarning("Article has no @title!"); + $atom->addWarning('Article has no @title!'); $atom->setDocblockMetaValue('title', $title); } diff --git a/src/applications/diviner/publisher/DivinerPublisher.php b/src/applications/diviner/publisher/DivinerPublisher.php index 33109933a2..298d0b42e7 100644 --- a/src/applications/diviner/publisher/DivinerPublisher.php +++ b/src/applications/diviner/publisher/DivinerPublisher.php @@ -74,7 +74,7 @@ abstract class DivinerPublisher { $shash = $atom->getRef()->toHash(); if (empty($this->symbolReverseMap[$shash])) { - throw new Exception("Atom has no symbol map entry!"); + throw new Exception('Atom has no symbol map entry!'); } $hashes = $this->symbolReverseMap[$shash]; @@ -107,7 +107,7 @@ abstract class DivinerPublisher { $index++; } - throw new Exception("Expected to find atom while disambiguating!"); + throw new Exception('Expected to find atom while disambiguating!'); } diff --git a/src/applications/diviner/workflow/DivinerAtomizeWorkflow.php b/src/applications/diviner/workflow/DivinerAtomizeWorkflow.php index aff3312bb7..2694eb9a04 100644 --- a/src/applications/diviner/workflow/DivinerAtomizeWorkflow.php +++ b/src/applications/diviner/workflow/DivinerAtomizeWorkflow.php @@ -36,7 +36,7 @@ final class DivinerAtomizeWorkflow extends DivinerWorkflow { $atomizer_class = $args->getArg('atomizer'); if (!$atomizer_class) { - throw new Exception("Specify an atomizer class with --atomizer."); + throw new Exception('Specify an atomizer class with --atomizer.'); } $symbols = id(new PhutilSymbolLoader()) @@ -54,7 +54,7 @@ final class DivinerAtomizeWorkflow extends DivinerWorkflow { $files = $args->getArg('files'); if (!$files) { - throw new Exception("Specify one or more files to atomize."); + throw new Exception('Specify one or more files to atomize.'); } $file_atomizer = new DivinerFileAtomizer(); @@ -98,7 +98,7 @@ final class DivinerAtomizeWorkflow extends DivinerWorkflow { $all_atoms[] = $file_atoms; if (count($file_atoms) !== 1) { - throw new Exception("Expected exactly one atom from file atomizer."); + throw new Exception('Expected exactly one atom from file atomizer.'); } $file_atom = head($file_atoms); diff --git a/src/applications/diviner/workflow/DivinerGenerateWorkflow.php b/src/applications/diviner/workflow/DivinerGenerateWorkflow.php index 6975f85c76..ac1d29c333 100644 --- a/src/applications/diviner/workflow/DivinerGenerateWorkflow.php +++ b/src/applications/diviner/workflow/DivinerGenerateWorkflow.php @@ -192,12 +192,12 @@ final class DivinerGenerateWorkflow extends DivinerWorkflow { if ($futures) { $this->resolveAtomizerFutures($futures, $file_hashes); - $this->log(pht("Atomization complete.")); + $this->log(pht('Atomization complete.')); } else { - $this->log(pht("Atom cache is up to date, no files to atomize.")); + $this->log(pht('Atom cache is up to date, no files to atomize.')); } - $this->log(pht("Writing atom cache.")); + $this->log(pht('Writing atom cache.')); $this->getAtomCache()->saveAtoms(); diff --git a/src/applications/diviner/workflow/DivinerWorkflow.php b/src/applications/diviner/workflow/DivinerWorkflow.php index 896aa63e8d..25b71760bd 100644 --- a/src/applications/diviner/workflow/DivinerWorkflow.php +++ b/src/applications/diviner/workflow/DivinerWorkflow.php @@ -20,7 +20,7 @@ abstract class DivinerWorkflow extends PhabricatorManagementWorkflow { protected function readBookConfiguration($book_path) { if ($book_path === null) { throw new PhutilArgumentUsageException( - "Specify a Diviner book configuration file with --book."); + 'Specify a Diviner book configuration file with --book.'); } $book_data = Filesystem::readFile($book_path); diff --git a/src/applications/doorkeeper/engine/DoorkeeperObjectRef.php b/src/applications/doorkeeper/engine/DoorkeeperObjectRef.php index aa76571fee..0244532bcc 100644 --- a/src/applications/doorkeeper/engine/DoorkeeperObjectRef.php +++ b/src/applications/doorkeeper/engine/DoorkeeperObjectRef.php @@ -30,7 +30,7 @@ final class DoorkeeperObjectRef extends Phobject { public function getExternalObject() { if (!$this->externalObject) { throw new Exception( - "Call attachExternalObject() before getExternalObject()!"); + 'Call attachExternalObject() before getExternalObject()!'); } return $this->externalObject; } diff --git a/src/applications/doorkeeper/option/PhabricatorAsanaConfigOptions.php b/src/applications/doorkeeper/option/PhabricatorAsanaConfigOptions.php index 48f984372c..33b32dc28f 100644 --- a/src/applications/doorkeeper/option/PhabricatorAsanaConfigOptions.php +++ b/src/applications/doorkeeper/option/PhabricatorAsanaConfigOptions.php @@ -4,17 +4,17 @@ final class PhabricatorAsanaConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Integration with Asana"); + return pht('Integration with Asana'); } public function getDescription() { - return pht("Asana integration options."); + return pht('Asana integration options.'); } public function getOptions() { return array( $this->newOption('asana.workspace-id', 'string', null) - ->setSummary(pht("Asana Workspace ID to publish into.")) + ->setSummary(pht('Asana Workspace ID to publish into.')) ->setDescription( pht( 'To enable synchronization into Asana, enter an Asana Workspace '. @@ -22,7 +22,7 @@ final class PhabricatorAsanaConfigOptions "\n\n". "NOTE: This feature is new and experimental.")), $this->newOption('asana.project-ids', 'wild', null) - ->setSummary(pht("Optional Asana projects to use as application tags.")) + ->setSummary(pht('Optional Asana projects to use as application tags.')) ->setDescription( pht( 'When Phabricator creates tasks in Asana, it can add the tasks '. @@ -83,8 +83,8 @@ final class PhabricatorAsanaConfigOptions } $out = array(); - $out[] = pht("| Workspace ID | Workspace Name |"); - $out[] = "| ------------ | -------------- |"; + $out[] = pht('| Workspace ID | Workspace Name |'); + $out[] = '| ------------ | -------------- |'; foreach ($workspaces as $workspace) { $out[] = sprintf('| `%s` | `%s` |', $workspace['id'], $workspace['name']); } diff --git a/src/applications/doorkeeper/worker/DoorkeeperFeedWorkerAsana.php b/src/applications/doorkeeper/worker/DoorkeeperFeedWorkerAsana.php index 6e71dab3b8..50a2dfabf2 100644 --- a/src/applications/doorkeeper/worker/DoorkeeperFeedWorkerAsana.php +++ b/src/applications/doorkeeper/worker/DoorkeeperFeedWorkerAsana.php @@ -143,7 +143,7 @@ final class DoorkeeperFeedWorkerAsana extends DoorkeeperFeedWorker { $this->makeAsanaAPICall( $oauth_token, - "tasks/".$parent_ref->getObjectID(), + 'tasks/'.$parent_ref->getObjectID(), 'PUT', $main_data); } else { diff --git a/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php b/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php index 8c4246aa8a..34373aaf11 100644 --- a/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php +++ b/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php @@ -45,7 +45,7 @@ abstract class DrydockBlueprintImplementation { protected function getInstance() { if (!$this->instance) { throw new Exception( - "Attach the blueprint instance to the implementation."); + 'Attach the blueprint instance to the implementation.'); } return $this->instance; @@ -279,7 +279,7 @@ abstract class DrydockBlueprintImplementation { $lease->saveTransaction(); if (!$released) { - throw new Exception("Unable to release lease: lease not active!"); + throw new Exception('Unable to release lease: lease not active!'); } } @@ -444,7 +444,7 @@ abstract class DrydockBlueprintImplementation { if (($this->activeResource !== null) || ($this->activeLease !== null)) { - throw new Exception("There is already an active resource or lease!"); + throw new Exception('There is already an active resource or lease!'); } $this->activeResource = $resource; diff --git a/src/applications/drydock/blueprint/DrydockLocalHostBlueprintImplementation.php b/src/applications/drydock/blueprint/DrydockLocalHostBlueprintImplementation.php index b1bfac2395..43ee8bab62 100644 --- a/src/applications/drydock/blueprint/DrydockLocalHostBlueprintImplementation.php +++ b/src/applications/drydock/blueprint/DrydockLocalHostBlueprintImplementation.php @@ -43,8 +43,8 @@ final class DrydockLocalHostBlueprintImplementation $resource = $this->newResourceTemplate('Host (localhost)'); $resource->setStatus(DrydockResourceStatus::STATUS_OPEN); $resource->setAttribute('path', $path); - $resource->setAttribute('remote', "false"); - $resource->setAttribute('preallocated', "false"); + $resource->setAttribute('remote', 'false'); + $resource->setAttribute('preallocated', 'false'); $resource->save(); return $resource; diff --git a/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php b/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php index ed92311e65..286785748a 100644 --- a/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php +++ b/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php @@ -53,7 +53,7 @@ final class DrydockWorkingCopyBlueprintImplementation case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: break; default: - throw new Exception("Unsupported VCS!"); + throw new Exception('Unsupported VCS!'); } // TODO: Policy stuff here too. diff --git a/src/applications/drydock/interface/command/DrydockSSHCommandInterface.php b/src/applications/drydock/interface/command/DrydockSSHCommandInterface.php index 3ac20f0f41..70b023f2e2 100644 --- a/src/applications/drydock/interface/command/DrydockSSHCommandInterface.php +++ b/src/applications/drydock/interface/command/DrydockSSHCommandInterface.php @@ -17,7 +17,7 @@ final class DrydockSSHCommandInterface extends DrydockCommandInterface { if ($credential->getProvidesType() !== PassphraseCredentialTypeSSHPrivateKey::PROVIDES_TYPE) { - throw new Exception("Only private key credentials are supported."); + throw new Exception('Only private key credentials are supported.'); } $this->passphraseSSHKey = PassphraseSSHKey::loadFromPHID( diff --git a/src/applications/drydock/interface/filesystem/DrydockSFTPFilesystemInterface.php b/src/applications/drydock/interface/filesystem/DrydockSFTPFilesystemInterface.php index bffe85144b..6d6265ac69 100644 --- a/src/applications/drydock/interface/filesystem/DrydockSFTPFilesystemInterface.php +++ b/src/applications/drydock/interface/filesystem/DrydockSFTPFilesystemInterface.php @@ -17,7 +17,7 @@ final class DrydockSFTPFilesystemInterface extends DrydockFilesystemInterface { if ($credential->getProvidesType() !== PassphraseCredentialTypeSSHPrivateKey::PROVIDES_TYPE) { - throw new Exception("Only private key credentials are supported."); + throw new Exception('Only private key credentials are supported.'); } $this->passphraseSSHKey = PassphraseSSHKey::loadFromPHID( @@ -39,7 +39,7 @@ final class DrydockSFTPFilesystemInterface extends DrydockFilesystemInterface { public function readFile($path) { $target = new TempFile(); $future = $this->getExecFuture($path); - $future->write(csprintf("get %s %s", $path, $target)); + $future->write(csprintf('get %s %s', $path, $target)); $future->resolvex(); return Filesystem::readFile($target); } @@ -58,7 +58,7 @@ final class DrydockSFTPFilesystemInterface extends DrydockFilesystemInterface { $source = new TempFile(); Filesystem::writeFile($source, $data); $future = $this->getExecFuture($path); - $future->write(csprintf("put %s %s", $source, $path)); + $future->write(csprintf('put %s %s', $source, $path)); $future->resolvex(); } diff --git a/src/applications/drydock/management/DrydockManagementCloseWorkflow.php b/src/applications/drydock/management/DrydockManagementCloseWorkflow.php index 684a5333cf..774a94b02b 100644 --- a/src/applications/drydock/management/DrydockManagementCloseWorkflow.php +++ b/src/applications/drydock/management/DrydockManagementCloseWorkflow.php @@ -22,7 +22,7 @@ final class DrydockManagementCloseWorkflow $ids = $args->getArg('ids'); if (!$ids) { throw new PhutilArgumentUsageException( - "Specify one or more resource IDs to close."); + 'Specify one or more resource IDs to close.'); } $viewer = $this->getViewer(); diff --git a/src/applications/drydock/management/DrydockManagementCreateResourceWorkflow.php b/src/applications/drydock/management/DrydockManagementCreateResourceWorkflow.php index 82259d5d2b..eae8e1921e 100644 --- a/src/applications/drydock/management/DrydockManagementCreateResourceWorkflow.php +++ b/src/applications/drydock/management/DrydockManagementCreateResourceWorkflow.php @@ -33,13 +33,13 @@ final class DrydockManagementCreateResourceWorkflow $resource_name = $args->getArg('name'); if (!$resource_name) { throw new PhutilArgumentUsageException( - "Specify a resource name with `--name`."); + 'Specify a resource name with `--name`.'); } $blueprint_id = $args->getArg('blueprint'); if (!$blueprint_id) { throw new PhutilArgumentUsageException( - "Specify a blueprint ID with `--blueprint`."); + 'Specify a blueprint ID with `--blueprint`.'); } $attributes = $args->getArg('attributes'); @@ -57,7 +57,7 @@ final class DrydockManagementCreateResourceWorkflow ->executeOne(); if (!$blueprint) { throw new PhutilArgumentUsageException( - "Specified blueprint does not exist."); + 'Specified blueprint does not exist.'); } $resource = id(new DrydockResource()) diff --git a/src/applications/drydock/management/DrydockManagementLeaseWorkflow.php b/src/applications/drydock/management/DrydockManagementLeaseWorkflow.php index 4b60ce2fab..9d910ca2ea 100644 --- a/src/applications/drydock/management/DrydockManagementLeaseWorkflow.php +++ b/src/applications/drydock/management/DrydockManagementLeaseWorkflow.php @@ -28,7 +28,7 @@ final class DrydockManagementLeaseWorkflow $resource_type = $args->getArg('type'); if (!$resource_type) { throw new PhutilArgumentUsageException( - "Specify a resource type with `--type`."); + 'Specify a resource type with `--type`.'); } $attributes = $args->getArg('attributes'); diff --git a/src/applications/drydock/management/DrydockManagementReleaseWorkflow.php b/src/applications/drydock/management/DrydockManagementReleaseWorkflow.php index 5913bda447..544fe9bdd0 100644 --- a/src/applications/drydock/management/DrydockManagementReleaseWorkflow.php +++ b/src/applications/drydock/management/DrydockManagementReleaseWorkflow.php @@ -22,7 +22,7 @@ final class DrydockManagementReleaseWorkflow $ids = $args->getArg('ids'); if (!$ids) { throw new PhutilArgumentUsageException( - "Specify one or more lease IDs to release."); + 'Specify one or more lease IDs to release.'); } $viewer = $this->getViewer(); diff --git a/src/applications/drydock/storage/DrydockLease.php b/src/applications/drydock/storage/DrydockLease.php index 26312ef51c..9271d4c4ec 100644 --- a/src/applications/drydock/storage/DrydockLease.php +++ b/src/applications/drydock/storage/DrydockLease.php @@ -85,7 +85,7 @@ final class DrydockLease extends DrydockDAO public function queueForActivation() { if ($this->getID()) { throw new Exception( - "Only new leases may be queued for activation!"); + 'Only new leases may be queued for activation!'); } $this->setStatus(DrydockLeaseStatus::STATUS_PENDING); @@ -128,8 +128,8 @@ final class DrydockLease extends DrydockDAO private function assertActive() { if (!$this->isActive()) { throw new Exception( - "Lease is not active! You can not interact with resources through ". - "an inactive lease."); + 'Lease is not active! You can not interact with resources through '. + 'an inactive lease.'); } } @@ -149,16 +149,16 @@ final class DrydockLease extends DrydockDAO unset($unresolved[$key]); break; case DrydockLeaseStatus::STATUS_RELEASED: - throw new Exception("Lease has already been released!"); + throw new Exception('Lease has already been released!'); case DrydockLeaseStatus::STATUS_EXPIRED: - throw new Exception("Lease has already expired!"); + throw new Exception('Lease has already expired!'); case DrydockLeaseStatus::STATUS_BROKEN: - throw new Exception("Lease has been broken!"); + throw new Exception('Lease has been broken!'); case DrydockLeaseStatus::STATUS_PENDING: case DrydockLeaseStatus::STATUS_ACQUIRING: break; default: - throw new Exception("Unknown status??"); + throw new Exception('Unknown status??'); } } diff --git a/src/applications/drydock/worker/DrydockAllocatorWorker.php b/src/applications/drydock/worker/DrydockAllocatorWorker.php index 0e9d99aa97..3b955f16fe 100644 --- a/src/applications/drydock/worker/DrydockAllocatorWorker.php +++ b/src/applications/drydock/worker/DrydockAllocatorWorker.php @@ -19,7 +19,7 @@ final class DrydockAllocatorWorker extends PhabricatorWorker { ->executeOne(); if (!$lease) { throw new PhabricatorWorkerPermanentFailureException( - pht("No such lease %d!", $this->getTaskData())); + pht('No such lease %d!', $this->getTaskData())); } $this->lease = $lease; } @@ -170,7 +170,7 @@ final class DrydockAllocatorWorker extends PhabricatorWorker { // and then switch them to "OPEN" only after the allocating lease gets // its grubby mitts on the resource. This might make more sense but // is a bit messy. - throw new Exception("Lost an allocation race?"); + throw new Exception('Lost an allocation race?'); } } diff --git a/src/applications/fact/controller/PhabricatorFactChartController.php b/src/applications/fact/controller/PhabricatorFactChartController.php index 434bbe077d..a9f4f9ab7d 100644 --- a/src/applications/fact/controller/PhabricatorFactChartController.php +++ b/src/applications/fact/controller/PhabricatorFactChartController.php @@ -32,7 +32,7 @@ final class PhabricatorFactChartController extends PhabricatorFactController { if (!$points) { // NOTE: Raphael crashes Safari if you hand it series with no points. - throw new Exception("No data to show!"); + throw new Exception('No data to show!'); } // Limit amount of data passed to browser. diff --git a/src/applications/fact/daemon/PhabricatorFactDaemon.php b/src/applications/fact/daemon/PhabricatorFactDaemon.php index 64a1c17184..f4f680b23a 100644 --- a/src/applications/fact/daemon/PhabricatorFactDaemon.php +++ b/src/applications/fact/daemon/PhabricatorFactDaemon.php @@ -15,7 +15,7 @@ final class PhabricatorFactDaemon extends PhabricatorDaemon { } $this->processAggregates(); - $this->log("Zzz..."); + $this->log('Zzz...'); $this->sleep(60 * 5); } } @@ -91,7 +91,7 @@ final class PhabricatorFactDaemon extends PhabricatorDaemon { } public function processAggregates() { - $this->log("Processing aggregates."); + $this->log('Processing aggregates.'); $facts = $this->computeAggregateFacts(); $this->updateAggregateFacts($facts); diff --git a/src/applications/fact/management/PhabricatorFactManagementCursorsWorkflow.php b/src/applications/fact/management/PhabricatorFactManagementCursorsWorkflow.php index 741f8f9ca4..0aa6d99f27 100644 --- a/src/applications/fact/management/PhabricatorFactManagementCursorsWorkflow.php +++ b/src/applications/fact/management/PhabricatorFactManagementCursorsWorkflow.php @@ -31,12 +31,12 @@ final class PhabricatorFactManagementCursorsWorkflow 'name = %s', $name); if ($cursor) { - $console->writeOut("%s\n", pht("Resetting cursor %s...", $name)); + $console->writeOut("%s\n", pht('Resetting cursor %s...', $name)); $cursor->delete(); } else { $console->writeErr( "%s\n", - pht("Cursor %s does not exist or is already reset.", $name)); + pht('Cursor %s does not exist or is already reset.', $name)); } } return 0; @@ -44,7 +44,7 @@ final class PhabricatorFactManagementCursorsWorkflow $iterator_map = PhabricatorFactDaemon::getAllApplicationIterators(); if (!$iterator_map) { - $console->writeErr("%s\n", pht("No cursors.")); + $console->writeErr("%s\n", pht('No cursors.')); return 0; } diff --git a/src/applications/feed/PhabricatorFeedStoryPublisher.php b/src/applications/feed/PhabricatorFeedStoryPublisher.php index 552dc795b3..3c0dc0b808 100644 --- a/src/applications/feed/PhabricatorFeedStoryPublisher.php +++ b/src/applications/feed/PhabricatorFeedStoryPublisher.php @@ -65,7 +65,7 @@ final class PhabricatorFeedStoryPublisher { public function publish() { $class = $this->storyType; if (!$class) { - throw new Exception("Call setStoryType() before publishing!"); + throw new Exception('Call setStoryType() before publishing!'); } if (!class_exists($class)) { @@ -140,7 +140,7 @@ final class PhabricatorFeedStoryPublisher { if (!$this->primaryObjectPHID) { throw new Exception( - "You must call setPrimaryObjectPHID() if you setSubscribedPHIDs()!"); + 'You must call setPrimaryObjectPHID() if you setSubscribedPHIDs()!'); } $notif = new PhabricatorFeedStoryNotification(); diff --git a/src/applications/feed/conduit/ConduitAPI_feed_publish_Method.php b/src/applications/feed/conduit/ConduitAPI_feed_publish_Method.php index 3fcc18ea7a..c7e853b8ab 100644 --- a/src/applications/feed/conduit/ConduitAPI_feed_publish_Method.php +++ b/src/applications/feed/conduit/ConduitAPI_feed_publish_Method.php @@ -11,7 +11,7 @@ final class ConduitAPI_feed_publish_Method } public function getMethodDescription() { - return "Publish a story to the feed."; + return 'Publish a story to the feed.'; } public function defineParamTypes() { diff --git a/src/applications/feed/conduit/ConduitAPI_feed_query_Method.php b/src/applications/feed/conduit/ConduitAPI_feed_query_Method.php index b392233660..3c40c3ec11 100644 --- a/src/applications/feed/conduit/ConduitAPI_feed_query_Method.php +++ b/src/applications/feed/conduit/ConduitAPI_feed_query_Method.php @@ -11,7 +11,7 @@ final class ConduitAPI_feed_query_Method } public function getMethodDescription() { - return "Query the feed for stories"; + return 'Query the feed for stories'; } private function getDefaultLimit() { diff --git a/src/applications/feed/management/PhabricatorFeedManagementRepublishWorkflow.php b/src/applications/feed/management/PhabricatorFeedManagementRepublishWorkflow.php index 4f6279ba7a..34530d2eb0 100644 --- a/src/applications/feed/management/PhabricatorFeedManagementRepublishWorkflow.php +++ b/src/applications/feed/management/PhabricatorFeedManagementRepublishWorkflow.php @@ -26,10 +26,10 @@ final class PhabricatorFeedManagementRepublishWorkflow $key = $args->getArg('key'); if (count($key) < 1) { throw new PhutilArgumentUsageException( - pht("Specify a story key to republish.")); + pht('Specify a story key to republish.')); } else if (count($key) > 1) { throw new PhutilArgumentUsageException( - pht("Specify exactly one story key to republish.")); + pht('Specify exactly one story key to republish.')); } $key = head($key); @@ -43,7 +43,7 @@ final class PhabricatorFeedManagementRepublishWorkflow pht('No story exists with key "%s"!', $key)); } - $console->writeOut("%s\n", pht("Republishing story...")); + $console->writeOut("%s\n", pht('Republishing story...')); PhabricatorWorker::setRunAllTasksInProcess(true); @@ -53,7 +53,7 @@ final class PhabricatorFeedManagementRepublishWorkflow 'key' => $key, )); - $console->writeOut("%s\n", pht("Done.")); + $console->writeOut("%s\n", pht('Done.')); return 0; } diff --git a/src/applications/feed/story/PhabricatorFeedStory.php b/src/applications/feed/story/PhabricatorFeedStory.php index 51118cc834..40fe2674b5 100644 --- a/src/applications/feed/story/PhabricatorFeedStory.php +++ b/src/applications/feed/story/PhabricatorFeedStory.php @@ -163,7 +163,7 @@ abstract class PhabricatorFeedStory implements PhabricatorPolicyInterface { public function getPrimaryObject() { $phid = $this->getPrimaryObjectPHID(); if (!$phid) { - throw new Exception("Story has no primary object!"); + throw new Exception('Story has no primary object!'); } return $this->getObject($phid); } diff --git a/src/applications/feed/story/PhabricatorFeedStoryAggregate.php b/src/applications/feed/story/PhabricatorFeedStoryAggregate.php index 141e6911a8..c37a39e53d 100644 --- a/src/applications/feed/story/PhabricatorFeedStoryAggregate.php +++ b/src/applications/feed/story/PhabricatorFeedStoryAggregate.php @@ -68,7 +68,7 @@ abstract class PhabricatorFeedStoryAggregate extends PhabricatorFeedStory { final public function getNotificationAggregations() { throw new Exception( - "You can not get aggregations for an aggregate story."); + 'You can not get aggregations for an aggregate story.'); } } diff --git a/src/applications/feed/story/PhabricatorFeedStoryCommit.php b/src/applications/feed/story/PhabricatorFeedStoryCommit.php index d1a7f8593d..25955ffdec 100644 --- a/src/applications/feed/story/PhabricatorFeedStoryCommit.php +++ b/src/applications/feed/story/PhabricatorFeedStoryCommit.php @@ -38,13 +38,13 @@ final class PhabricatorFeedStoryCommit extends PhabricatorFeedStory { if ($author) { $title = pht( - "%s committed %s (authored by %s)", + '%s committed %s (authored by %s)', $committer, $commit, $author); } else { $title = pht( - "%s committed %s", + '%s committed %s', $committer, $commit); } diff --git a/src/applications/files/PhabricatorImageTransformer.php b/src/applications/files/PhabricatorImageTransformer.php index 74297ae5b8..586583c2b3 100644 --- a/src/applications/files/PhabricatorImageTransformer.php +++ b/src/applications/files/PhabricatorImageTransformer.php @@ -388,12 +388,12 @@ final class PhabricatorImageTransformer { $text_height = abs($bbox[3] - $bbox[5]); $text_width = abs($bbox[0] - $bbox[2]); return array( - "doesfit" => ($text_height * 1.05 <= imagesy($img) / 2 + 'doesfit' => ($text_height * 1.05 <= imagesy($img) / 2 && $text_width * 1.05 <= imagesx($img)), - "txtwidth" => $text_width, - "txtheight" => $text_height, - "imgwidth" => imagesx($img), - "imgheight" => imagesy($img), + 'txtwidth' => $text_width, + 'txtheight' => $text_height, + 'imgwidth' => imagesx($img), + 'imgheight' => imagesy($img), ); } diff --git a/src/applications/files/conduit/ConduitAPI_file_download_Method.php b/src/applications/files/conduit/ConduitAPI_file_download_Method.php index 66c7c700fd..e28f21e6e6 100644 --- a/src/applications/files/conduit/ConduitAPI_file_download_Method.php +++ b/src/applications/files/conduit/ConduitAPI_file_download_Method.php @@ -7,7 +7,7 @@ final class ConduitAPI_file_download_Method extends ConduitAPI_file_Method { public function getMethodDescription() { - return "Download a file from the server."; + return 'Download a file from the server.'; } public function defineParamTypes() { diff --git a/src/applications/files/conduit/ConduitAPI_file_info_Method.php b/src/applications/files/conduit/ConduitAPI_file_info_Method.php index 555ec2585a..e316712123 100644 --- a/src/applications/files/conduit/ConduitAPI_file_info_Method.php +++ b/src/applications/files/conduit/ConduitAPI_file_info_Method.php @@ -6,7 +6,7 @@ final class ConduitAPI_file_info_Method extends ConduitAPI_file_Method { public function getMethodDescription() { - return "Get information about a file."; + return 'Get information about a file.'; } public function defineParamTypes() { diff --git a/src/applications/files/conduit/ConduitAPI_file_upload_Method.php b/src/applications/files/conduit/ConduitAPI_file_upload_Method.php index 49e193f8b6..f172b89d62 100644 --- a/src/applications/files/conduit/ConduitAPI_file_upload_Method.php +++ b/src/applications/files/conduit/ConduitAPI_file_upload_Method.php @@ -6,7 +6,7 @@ final class ConduitAPI_file_upload_Method extends ConduitAPI_file_Method { public function getMethodDescription() { - return "Upload a file to the server."; + return 'Upload a file to the server.'; } public function defineParamTypes() { diff --git a/src/applications/files/conduit/ConduitAPI_file_uploadhash_Method.php b/src/applications/files/conduit/ConduitAPI_file_uploadhash_Method.php index c43cb0867d..dd724ce019 100644 --- a/src/applications/files/conduit/ConduitAPI_file_uploadhash_Method.php +++ b/src/applications/files/conduit/ConduitAPI_file_uploadhash_Method.php @@ -6,7 +6,7 @@ final class ConduitAPI_file_uploadhash_Method extends ConduitAPI_file_Method { public function getMethodDescription() { - return "Upload a file to the server using content hash."; + return 'Upload a file to the server using content hash.'; } public function defineParamTypes() { diff --git a/src/applications/files/config/PhabricatorFilesConfigOptions.php b/src/applications/files/config/PhabricatorFilesConfigOptions.php index c942b9254a..c57955caa9 100644 --- a/src/applications/files/config/PhabricatorFilesConfigOptions.php +++ b/src/applications/files/config/PhabricatorFilesConfigOptions.php @@ -7,11 +7,11 @@ final class PhabricatorFilesConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Files"); + return pht('Files'); } public function getDescription() { - return pht("Configure files and file storage."); + return pht('Configure files and file storage.'); } public function getOptions() { @@ -146,14 +146,14 @@ final class PhabricatorFilesConfigOptions ->setSummary(pht('Storage engine selector.')) ->setDescription( pht( - "Phabricator uses a storage engine selector to choose which ". - "storage engine to use when writing file data. If you add new ". - "storage engines or want to provide very custom rules (e.g., ". - "write images to one storage engine and other files to a ". - "different one), you can provide an alternate implementation ". - "here. The default engine will use choose MySQL, Local Disk, and ". - "S3, in that order, if they have valid configurations above and ". - "a file fits within configured limits.")), + 'Phabricator uses a storage engine selector to choose which '. + 'storage engine to use when writing file data. If you add new '. + 'storage engines or want to provide very custom rules (e.g., '. + 'write images to one storage engine and other files to a '. + 'different one), you can provide an alternate implementation '. + 'here. The default engine will use choose MySQL, Local Disk, and '. + 'S3, in that order, if they have valid configurations above and '. + 'a file fits within configured limits.')), $this->newOption('storage.upload-size-limit', 'string', null) ->setSummary( pht('Limit to users in interfaces which allow uploading.')) @@ -173,7 +173,7 @@ final class PhabricatorFilesConfigOptions "limit.\n\n". "Specify this limit in bytes, or using a 'K', 'M', or 'G' ". "suffix.")) - ->addExample('10M', pht("Allow Uploads 10MB or Smaller")), + ->addExample('10M', pht('Allow Uploads 10MB or Smaller')), $this->newOption( 'metamta.files.public-create-email', 'string', diff --git a/src/applications/files/controller/PhabricatorFileInfoController.php b/src/applications/files/controller/PhabricatorFileInfoController.php index 6f6df0f65f..6e6370aa7b 100644 --- a/src/applications/files/controller/PhabricatorFileInfoController.php +++ b/src/applications/files/controller/PhabricatorFileInfoController.php @@ -41,7 +41,7 @@ final class PhabricatorFileInfoController extends PhabricatorFileController { if ($ttl !== null) { $ttl_tag = id(new PHUITagView()) ->setType(PHUITagView::TYPE_OBJECT) - ->setName(pht("Temporary")); + ->setName(pht('Temporary')); $header->addTag($ttl_tag); } diff --git a/src/applications/files/controller/PhabricatorFileTransformController.php b/src/applications/files/controller/PhabricatorFileTransformController.php index 4e2c7b08e6..cdbb6a31c2 100644 --- a/src/applications/files/controller/PhabricatorFileTransformController.php +++ b/src/applications/files/controller/PhabricatorFileTransformController.php @@ -119,7 +119,7 @@ final class PhabricatorFileTransformController $suffix = '60x45'; break; default: - throw new Exception("Unsupported transformation type!"); + throw new Exception('Unsupported transformation type!'); } $path = celerity_get_resource_uri( diff --git a/src/applications/files/engineselector/PhabricatorDefaultFileStorageEngineSelector.php b/src/applications/files/engineselector/PhabricatorDefaultFileStorageEngineSelector.php index 306772c97a..a83261fa60 100644 --- a/src/applications/files/engineselector/PhabricatorDefaultFileStorageEngineSelector.php +++ b/src/applications/files/engineselector/PhabricatorDefaultFileStorageEngineSelector.php @@ -42,10 +42,10 @@ final class PhabricatorDefaultFileStorageEngineSelector // a little vague ("No valid storage engines"). Since this is a default // case, throw a more specific exception. throw new Exception( - "This file exceeds the configured MySQL storage engine filesize ". - "limit, but no other storage engines are configured. Increase the ". - "MySQL storage engine limit or configure a storage engine suitable ". - "for larger files."); + 'This file exceeds the configured MySQL storage engine filesize '. + 'limit, but no other storage engines are configured. Increase the '. + 'MySQL storage engine limit or configure a storage engine suitable '. + 'for larger files.'); } return $engines; diff --git a/src/applications/files/exception/PhabricatorFileUploadException.php b/src/applications/files/exception/PhabricatorFileUploadException.php index 6dcf345026..df7c06ff20 100644 --- a/src/applications/files/exception/PhabricatorFileUploadException.php +++ b/src/applications/files/exception/PhabricatorFileUploadException.php @@ -8,24 +8,24 @@ final class PhabricatorFileUploadException extends Exception { "Uploaded file is too large: file is larger than the ". "'upload_max_filesize' setting in php.ini.", UPLOAD_ERR_FORM_SIZE => - "File is too large.", + 'File is too large.', UPLOAD_ERR_PARTIAL => - "File was only partially transferred, upload did not complete.", + 'File was only partially transferred, upload did not complete.', UPLOAD_ERR_NO_FILE => - "No file was uploaded.", + 'No file was uploaded.', UPLOAD_ERR_NO_TMP_DIR => - "Unable to write file: temporary directory does not exist.", + 'Unable to write file: temporary directory does not exist.', UPLOAD_ERR_CANT_WRITE => - "Unable to write file: failed to write to temporary directory.", + 'Unable to write file: failed to write to temporary directory.', UPLOAD_ERR_EXTENSION => - "Unable to upload: a PHP extension stopped the upload.", + 'Unable to upload: a PHP extension stopped the upload.', -1000 => "Uploaded file exceeds limit in Phabricator ". "'storage.upload-size-limit' configuration.", ); - $message = idx($map, $code, "Upload failed: unknown error."); + $message = idx($map, $code, 'Upload failed: unknown error.'); parent::__construct($message, $code); } } diff --git a/src/applications/files/management/PhabricatorFilesManagementEnginesWorkflow.php b/src/applications/files/management/PhabricatorFilesManagementEnginesWorkflow.php index bdc04fee87..366eb5fbe4 100644 --- a/src/applications/files/management/PhabricatorFilesManagementEnginesWorkflow.php +++ b/src/applications/files/management/PhabricatorFilesManagementEnginesWorkflow.php @@ -15,7 +15,7 @@ final class PhabricatorFilesManagementEnginesWorkflow $engines = PhabricatorFile::buildAllEngines(); if (!$engines) { - throw new Exception("No storage engines are available."); + throw new Exception('No storage engines are available.'); } foreach ($engines as $engine) { diff --git a/src/applications/files/management/PhabricatorFilesManagementMigrateWorkflow.php b/src/applications/files/management/PhabricatorFilesManagementMigrateWorkflow.php index 62946a0079..85eca269bf 100644 --- a/src/applications/files/management/PhabricatorFilesManagementMigrateWorkflow.php +++ b/src/applications/files/management/PhabricatorFilesManagementMigrateWorkflow.php @@ -35,8 +35,8 @@ final class PhabricatorFilesManagementMigrateWorkflow $engine_id = $args->getArg('engine'); if (!$engine_id) { throw new PhutilArgumentUsageException( - "Specify an engine to migrate to with `--engine`. ". - "Use `files engines` to get a list of engines."); + 'Specify an engine to migrate to with `--engine`. '. + 'Use `files engines` to get a list of engines.'); } $engine = PhabricatorFile::buildEngine($engine_id); @@ -44,8 +44,8 @@ final class PhabricatorFilesManagementMigrateWorkflow $iterator = $this->buildIterator($args); if (!$iterator) { throw new PhutilArgumentUsageException( - "Either specify a list of files to migrate, or use `--all` ". - "to migrate all files."); + 'Either specify a list of files to migrate, or use `--all` '. + 'to migrate all files.'); } $is_dry_run = $args->getArg('dry-run'); diff --git a/src/applications/files/management/PhabricatorFilesManagementPurgeWorkflow.php b/src/applications/files/management/PhabricatorFilesManagementPurgeWorkflow.php index d807f906b5..89fab29b69 100644 --- a/src/applications/files/management/PhabricatorFilesManagementPurgeWorkflow.php +++ b/src/applications/files/management/PhabricatorFilesManagementPurgeWorkflow.php @@ -30,8 +30,8 @@ final class PhabricatorFilesManagementPurgeWorkflow $iterator = $this->buildIterator($args); if (!$iterator) { throw new PhutilArgumentUsageException( - "Either specify a list of files to purge, or use `--all` ". - "to purge all files."); + 'Either specify a list of files to purge, or use `--all` '. + 'to purge all files.'); } $is_dry_run = $args->getArg('dry-run'); diff --git a/src/applications/files/management/PhabricatorFilesManagementRebuildWorkflow.php b/src/applications/files/management/PhabricatorFilesManagementRebuildWorkflow.php index b937623db8..912c210628 100644 --- a/src/applications/files/management/PhabricatorFilesManagementRebuildWorkflow.php +++ b/src/applications/files/management/PhabricatorFilesManagementRebuildWorkflow.php @@ -38,8 +38,8 @@ final class PhabricatorFilesManagementRebuildWorkflow $iterator = $this->buildIterator($args); if (!$iterator) { throw new PhutilArgumentUsageException( - "Either specify a list of files to update, or use `--all` ". - "to update all files."); + 'Either specify a list of files to update, or use `--all` '. + 'to update all files.'); } $update = array( @@ -116,7 +116,7 @@ final class PhabricatorFilesManagementRebuildWorkflow } $console->writeOut( - "%s: Updating metadata... ", + '%s: Updating metadata... ', $fid); try { diff --git a/src/applications/files/management/PhabricatorFilesManagementWorkflow.php b/src/applications/files/management/PhabricatorFilesManagementWorkflow.php index a8cd9d6023..43a8f6df18 100644 --- a/src/applications/files/management/PhabricatorFilesManagementWorkflow.php +++ b/src/applications/files/management/PhabricatorFilesManagementWorkflow.php @@ -9,7 +9,7 @@ abstract class PhabricatorFilesManagementWorkflow if ($args->getArg('all')) { if ($names) { throw new PhutilArgumentUsageException( - "Specify either a list of files or `--all`, but not both."); + 'Specify either a list of files or `--all`, but not both.'); } return new LiskMigrationIterator(new PhabricatorFile()); } diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php index dc6ad6d1ad..8de85ee389 100644 --- a/src/applications/files/storage/PhabricatorFile.php +++ b/src/applications/files/storage/PhabricatorFile.php @@ -61,7 +61,7 @@ final class PhabricatorFile extends PhabricatorFileDAO public static function readUploadedFileData($spec) { if (!$spec) { - throw new Exception("No file was uploaded!"); + throw new Exception('No file was uploaded!'); } $err = idx($spec, 'error'); @@ -72,14 +72,14 @@ final class PhabricatorFile extends PhabricatorFileDAO $tmp_name = idx($spec, 'tmp_name'); $is_valid = @is_uploaded_file($tmp_name); if (!$is_valid) { - throw new Exception("File is not an uploaded file."); + throw new Exception('File is not an uploaded file.'); } $file_data = Filesystem::readFile($tmp_name); $file_size = idx($spec, 'size'); if (strlen($file_data) != $file_size) { - throw new Exception("File size disagrees with uploaded size."); + throw new Exception('File size disagrees with uploaded size.'); } self::validateFileSize(strlen($file_data)); @@ -214,7 +214,7 @@ final class PhabricatorFile extends PhabricatorFileDAO assert_instances_of($engines, 'PhabricatorFileStorageEngine'); if (!$engines) { - throw new Exception("No valid storage engines are available!"); + throw new Exception('No valid storage engines are available!'); } $file = new PhabricatorFile(); @@ -248,7 +248,7 @@ final class PhabricatorFile extends PhabricatorFileDAO if (!$data_handle) { throw new PhutilAggregateException( - "All storage engines failed to write file:", + 'All storage engines failed to write file:', $exceptions); } @@ -368,7 +368,7 @@ final class PhabricatorFile extends PhabricatorFileDAO public static function newFromFileDownload($uri, array $params = array()) { // Make sure we're allowed to make a request first if (!PhabricatorEnv::getEnvConfig('security.allow-outbound-http')) { - throw new Exception("Outbound HTTP requests are disabled!"); + throw new Exception('Outbound HTTP requests are disabled!'); } $uri = new PhutilURI($uri); @@ -484,7 +484,7 @@ final class PhabricatorFile extends PhabricatorFileDAO $data = $data; break; default: - throw new Exception("Unknown storage format."); + throw new Exception('Unknown storage format.'); } return $data; @@ -493,7 +493,7 @@ final class PhabricatorFile extends PhabricatorFileDAO public function getViewURI() { if (!$this->getPHID()) { throw new Exception( - "You must save a file before you can generate a view URI."); + 'You must save a file before you can generate a view URI.'); } $name = phutil_escape_uri($this->getName()); @@ -694,12 +694,12 @@ final class PhabricatorFile extends PhabricatorFileDAO public function updateDimensions($save = true) { if (!$this->isViewableImage()) { throw new Exception( - "This file is not a viewable image."); + 'This file is not a viewable image.'); } - if (!function_exists("imagecreatefromstring")) { + if (!function_exists('imagecreatefromstring')) { throw new Exception( - "Cannot retrieve image information."); + 'Cannot retrieve image information.'); } $data = $this->loadFileData(); @@ -707,7 +707,7 @@ final class PhabricatorFile extends PhabricatorFileDAO $img = imagecreatefromstring($data); if ($img === false) { throw new Exception( - "Error when decoding image."); + 'Error when decoding image.'); } $this->metadata[self::METADATA_IMAGE_WIDTH] = imagesx($img); diff --git a/src/applications/flag/conduit/ConduitAPI_flag_delete_Method.php b/src/applications/flag/conduit/ConduitAPI_flag_delete_Method.php index 396dea5f82..7dce64e320 100644 --- a/src/applications/flag/conduit/ConduitAPI_flag_delete_Method.php +++ b/src/applications/flag/conduit/ConduitAPI_flag_delete_Method.php @@ -6,7 +6,7 @@ final class ConduitAPI_flag_delete_Method extends ConduitAPI_flag_Method { public function getMethodDescription() { - return "Clear a flag."; + return 'Clear a flag.'; } public function defineParamTypes() { @@ -39,7 +39,7 @@ final class ConduitAPI_flag_delete_Method extends ConduitAPI_flag_Method { if ($flag->getOwnerPHID() != $request->getUser()->getPHID()) { throw new ConduitException('ERR_WRONG_USER'); } - } elseif ($object) { + } else if ($object) { $flag = id(new PhabricatorFlag())->loadOneWhere( 'objectPHID = %s AND ownerPHID = %s', $object, diff --git a/src/applications/flag/conduit/ConduitAPI_flag_edit_Method.php b/src/applications/flag/conduit/ConduitAPI_flag_edit_Method.php index cb4a98cb98..9f5ed860a6 100644 --- a/src/applications/flag/conduit/ConduitAPI_flag_edit_Method.php +++ b/src/applications/flag/conduit/ConduitAPI_flag_edit_Method.php @@ -6,7 +6,7 @@ final class ConduitAPI_flag_edit_Method extends ConduitAPI_flag_Method { public function getMethodDescription() { - return "Create or modify a flag."; + return 'Create or modify a flag.'; } public function defineParamTypes() { diff --git a/src/applications/flag/conduit/ConduitAPI_flag_query_Method.php b/src/applications/flag/conduit/ConduitAPI_flag_query_Method.php index 56655c4b61..c968061855 100644 --- a/src/applications/flag/conduit/ConduitAPI_flag_query_Method.php +++ b/src/applications/flag/conduit/ConduitAPI_flag_query_Method.php @@ -6,7 +6,7 @@ final class ConduitAPI_flag_query_Method extends ConduitAPI_flag_Method { public function getMethodDescription() { - return "Query flag markers."; + return 'Query flag markers.'; } public function defineParamTypes() { diff --git a/src/applications/flag/controller/PhabricatorFlagEditController.php b/src/applications/flag/controller/PhabricatorFlagEditController.php index 3f65bb058d..b6e2327cd4 100644 --- a/src/applications/flag/controller/PhabricatorFlagEditController.php +++ b/src/applications/flag/controller/PhabricatorFlagEditController.php @@ -45,7 +45,7 @@ final class PhabricatorFlagEditController extends PhabricatorFlagController { $dialog = new AphrontDialogView(); $dialog->setUser($user); - $dialog->setTitle(pht("Flag %s", $type_name)); + $dialog->setTitle(pht('Flag %s', $type_name)); require_celerity_resource('phabricator-flag-css'); @@ -56,7 +56,7 @@ final class PhabricatorFlagEditController extends PhabricatorFlagController { if ($is_new) { $form ->appendChild(hsprintf( - "

%s


", + '

%s


', pht('You can flag this %s if you want to remember to look '. 'at it later.', $type_name))); @@ -85,7 +85,7 @@ final class PhabricatorFlagEditController extends PhabricatorFlagController { $dialog->addCancelButton($handle->getURI()); $dialog->addSubmitButton( - $is_new ? pht("Create Flag") : pht('Save')); + $is_new ? pht('Create Flag') : pht('Save')); return id(new AphrontDialogResponse())->setDialog($dialog); } diff --git a/src/applications/harbormaster/controller/HarbormasterBuildViewController.php b/src/applications/harbormaster/controller/HarbormasterBuildViewController.php index a459240234..ccc408e195 100644 --- a/src/applications/harbormaster/controller/HarbormasterBuildViewController.php +++ b/src/applications/harbormaster/controller/HarbormasterBuildViewController.php @@ -23,7 +23,7 @@ final class HarbormasterBuildViewController return new Aphront404Response(); } - $title = pht("Build %d", $id); + $title = pht('Build %d', $id); $header = id(new PHUIHeaderView()) ->setHeader($title) diff --git a/src/applications/harbormaster/controller/HarbormasterBuildableViewController.php b/src/applications/harbormaster/controller/HarbormasterBuildableViewController.php index a65447a940..8e2cdff3c3 100644 --- a/src/applications/harbormaster/controller/HarbormasterBuildableViewController.php +++ b/src/applications/harbormaster/controller/HarbormasterBuildableViewController.php @@ -36,7 +36,7 @@ final class HarbormasterBuildableViewController $build_list = $this->buildBuildList($buildable); - $title = pht("Buildable %d", $id); + $title = pht('Buildable %d', $id); $header = id(new PHUIHeaderView()) ->setHeader($title) diff --git a/src/applications/harbormaster/controller/HarbormasterPlanEditController.php b/src/applications/harbormaster/controller/HarbormasterPlanEditController.php index 95495e3420..0d2e6ba363 100644 --- a/src/applications/harbormaster/controller/HarbormasterPlanEditController.php +++ b/src/applications/harbormaster/controller/HarbormasterPlanEditController.php @@ -97,7 +97,7 @@ final class HarbormasterPlanEditController } else { $id = $plan->getID(); $crumbs->addTextCrumb( - pht("Plan %d", $id), + pht('Plan %d', $id), $this->getApplicationURI("plan/{$id}/")); $crumbs->addTextCrumb(pht('Edit')); } diff --git a/src/applications/harbormaster/controller/HarbormasterPlanViewController.php b/src/applications/harbormaster/controller/HarbormasterPlanViewController.php index aa4f5d5a81..d8b46b5211 100644 --- a/src/applications/harbormaster/controller/HarbormasterPlanViewController.php +++ b/src/applications/harbormaster/controller/HarbormasterPlanViewController.php @@ -34,7 +34,7 @@ final class HarbormasterPlanViewController ->setTransactions($xactions) ->setShouldTerminate(true); - $title = pht("Plan %d", $id); + $title = pht('Plan %d', $id); $header = id(new PHUIHeaderView()) ->setHeader($title) @@ -48,7 +48,7 @@ final class HarbormasterPlanViewController $this->buildPropertyLists($box, $plan, $actions); $crumbs = $this->buildApplicationCrumbs(); - $crumbs->addTextCrumb(pht("Plan %d", $id)); + $crumbs->addTextCrumb(pht('Plan %d', $id)); list($step_list, $has_any_conflicts) = $this->buildStepList($plan); @@ -122,14 +122,14 @@ final class HarbormasterPlanViewController ->addSigil('harbormaster-build-step-delete') ->setWorkflow(true) ->setRenderNameAsTooltip(true) - ->setName(pht("Delete")) + ->setName(pht('Delete')) ->setHref( - $this->getApplicationURI("step/delete/".$step->getID()."/"))); + $this->getApplicationURI('step/delete/'.$step->getID().'/'))); $step_list->addItem($item); continue; } $item = id(new PHUIObjectItemView()) - ->setObjectName("Step ".$i++) + ->setObjectName('Step '.$i++) ->setHeader($implementation->getName()); $item->addAttribute($implementation->getDescription()); @@ -157,7 +157,7 @@ final class HarbormasterPlanViewController ->setWorkflow(true) ->setDisabled(!$can_edit) ->setHref( - $this->getApplicationURI("step/delete/".$step->getID()."/"))); + $this->getApplicationURI('step/delete/'.$step->getID().'/'))); $inputs = $step->getStepImplementation()->getArtifactInputs(); $outputs = $step->getStepImplementation()->getArtifactOutputs(); diff --git a/src/applications/harbormaster/controller/HarbormasterStepDeleteController.php b/src/applications/harbormaster/controller/HarbormasterStepDeleteController.php index a11d565ba9..0ccd8bd4a1 100644 --- a/src/applications/harbormaster/controller/HarbormasterStepDeleteController.php +++ b/src/applications/harbormaster/controller/HarbormasterStepDeleteController.php @@ -23,7 +23,7 @@ final class HarbormasterStepDeleteController ->withIDs(array($id)) ->executeOne(); if ($step === null) { - throw new Exception("Build step not found!"); + throw new Exception('Build step not found!'); } $plan_id = $step->getBuildPlan()->getID(); diff --git a/src/applications/harbormaster/step/HarbormasterCommandBuildStepImplementation.php b/src/applications/harbormaster/step/HarbormasterCommandBuildStepImplementation.php index a0d481b63b..70e791adc2 100644 --- a/src/applications/harbormaster/step/HarbormasterCommandBuildStepImplementation.php +++ b/src/applications/harbormaster/step/HarbormasterCommandBuildStepImplementation.php @@ -38,8 +38,8 @@ final class HarbormasterCommandBuildStepImplementation $future = $interface->getExecFuture('%C', $command); - $log_stdout = $build->createLog($build_target, "remote", "stdout"); - $log_stderr = $build->createLog($build_target, "remote", "stderr"); + $log_stdout = $build->createLog($build_target, 'remote', 'stdout'); + $log_stderr = $build->createLog($build_target, 'remote', 'stderr'); $start_stdout = $log_stdout->start(); $start_stderr = $log_stderr->start(); diff --git a/src/applications/harbormaster/step/HarbormasterPublishFragmentBuildStepImplementation.php b/src/applications/harbormaster/step/HarbormasterPublishFragmentBuildStepImplementation.php index be007cad0f..e008d5d50b 100644 --- a/src/applications/harbormaster/step/HarbormasterPublishFragmentBuildStepImplementation.php +++ b/src/applications/harbormaster/step/HarbormasterPublishFragmentBuildStepImplementation.php @@ -47,7 +47,7 @@ final class HarbormasterPublishFragmentBuildStepImplementation PhabricatorPolicies::getMostOpenPolicy(), PhabricatorPolicies::POLICY_USER); } else { - if ($file->getMimeType() === "application/zip") { + if ($file->getMimeType() === 'application/zip') { $fragment->updateFromZIP(PhabricatorUser::getOmnipotentUser(), $file); } else { $fragment->updateFromFile(PhabricatorUser::getOmnipotentUser(), $file); diff --git a/src/applications/harbormaster/step/HarbormasterWaitForPreviousBuildStepImplementation.php b/src/applications/harbormaster/step/HarbormasterWaitForPreviousBuildStepImplementation.php index 1c54525064..39fa0754d9 100644 --- a/src/applications/harbormaster/step/HarbormasterWaitForPreviousBuildStepImplementation.php +++ b/src/applications/harbormaster/step/HarbormasterWaitForPreviousBuildStepImplementation.php @@ -28,12 +28,12 @@ final class HarbormasterWaitForPreviousBuildStepImplementation // finished. $plan = $build->getBuildPlan(); - $log = $build->createLog($build_target, "waiting", "blockers"); + $log = $build->createLog($build_target, 'waiting', 'blockers'); $log_start = $log->start(); $blockers = $this->getBlockers($object, $plan, $build); if ($blockers) { - $log->append("Blocked by: ".implode(",", $blockers)."\n"); + $log->append("Blocked by: ".implode(',', $blockers)."\n"); } $log->finalize($log_start); diff --git a/src/applications/harbormaster/storage/build/HarbormasterBuild.php b/src/applications/harbormaster/storage/build/HarbormasterBuild.php index 2048b703ab..bcb56b3274 100644 --- a/src/applications/harbormaster/storage/build/HarbormasterBuild.php +++ b/src/applications/harbormaster/storage/build/HarbormasterBuild.php @@ -176,7 +176,7 @@ final class HarbormasterBuild extends HarbormasterDAO array($name)) ->executeOne(); if ($artifact === null) { - throw new Exception("Artifact not found!"); + throw new Exception('Artifact not found!'); } return $artifact; } diff --git a/src/applications/harbormaster/storage/build/HarbormasterBuildArtifact.php b/src/applications/harbormaster/storage/build/HarbormasterBuildArtifact.php index 4854e64b5d..069e6f6554 100644 --- a/src/applications/harbormaster/storage/build/HarbormasterBuildArtifact.php +++ b/src/applications/harbormaster/storage/build/HarbormasterBuildArtifact.php @@ -60,9 +60,9 @@ final class HarbormasterBuildArtifact extends HarbormasterDAO case self::TYPE_HOST: $leases = id(new DrydockLeaseQuery()) ->setViewer($viewer) - ->withIDs(array($data["drydock-lease"])) + ->withIDs(array($data['drydock-lease'])) ->execute(); - $lease = $leases[$data["drydock-lease"]]; + $lease = $leases[$data['drydock-lease']]; return id(new PHUIObjectItemView()) ->setObjectName(pht('Drydock Lease')) @@ -76,7 +76,7 @@ final class HarbormasterBuildArtifact extends HarbormasterDAO public function loadDrydockLease() { if ($this->getArtifactType() !== self::TYPE_HOST) { throw new Exception( - "`loadDrydockLease` may only be called on host artifacts."); + '`loadDrydockLease` may only be called on host artifacts.'); } $data = $this->getArtifactData(); @@ -86,12 +86,12 @@ final class HarbormasterBuildArtifact extends HarbormasterDAO $lease = id(new DrydockLease())->load( $data['drydock-lease']); if ($lease === null) { - throw new Exception("Associated Drydock lease not found!"); + throw new Exception('Associated Drydock lease not found!'); } $resource = id(new DrydockResource())->load( $lease->getResourceID()); if ($resource === null) { - throw new Exception("Associated Drydock resource not found!"); + throw new Exception('Associated Drydock resource not found!'); } $lease->attachResource($resource); @@ -101,20 +101,20 @@ final class HarbormasterBuildArtifact extends HarbormasterDAO public function loadPhabricatorFile() { if ($this->getArtifactType() !== self::TYPE_FILE) { throw new Exception( - "`loadPhabricatorFile` may only be called on file artifacts."); + '`loadPhabricatorFile` may only be called on file artifacts.'); } $data = $this->getArtifactData(); // The data for TYPE_FILE is an array with a single PHID in it. - $phid = $data["filePHID"]; + $phid = $data['filePHID']; $file = id(new PhabricatorFileQuery()) ->setViewer(PhabricatorUser::getOmnipotentUser()) ->withPHIDs(array($phid)) ->executeOne(); if ($file === null) { - throw new Exception("Associated file not found!"); + throw new Exception('Associated file not found!'); } return $file; } diff --git a/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php b/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php index e998e82abb..f400895d13 100644 --- a/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php +++ b/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php @@ -53,7 +53,7 @@ final class HarbormasterBuildLog extends HarbormasterDAO public function start() { if ($this->getLive()) { - throw new Exception("Live logging has already started for this log."); + throw new Exception('Live logging has already started for this log.'); } $this->setLive(1); @@ -64,7 +64,7 @@ final class HarbormasterBuildLog extends HarbormasterDAO public function append($content) { if (!$this->getLive()) { - throw new Exception("Start logging before appending data to the log."); + throw new Exception('Start logging before appending data to the log.'); } if (strlen($content) === 0) { return; @@ -97,8 +97,8 @@ final class HarbormasterBuildLog extends HarbormasterDAO 'LIMIT 1', $this->getID()); if (count($result) === 0 || - $result[0]["size"] + strlen($content) > self::CHUNK_BYTE_LIMIT || - $result[0]["encoding"] !== self::ENCODING_TEXT) { + $result[0]['size'] + strlen($content) > self::CHUNK_BYTE_LIMIT || + $result[0]['encoding'] !== self::ENCODING_TEXT) { // We must insert a new chunk because the data we are appending // won't fit into the existing one, or we don't have any existing @@ -122,13 +122,13 @@ final class HarbormasterBuildLog extends HarbormasterDAO 'WHERE id = %d', $content, $content, - $result[0]["id"]); + $result[0]['id']); } } public function finalize($start = 0) { if (!$this->getLive()) { - throw new Exception("Start logging before finalizing it."); + throw new Exception('Start logging before finalizing it.'); } // TODO: Encode the log contents in a gzipped format. @@ -157,9 +157,9 @@ final class HarbormasterBuildLog extends HarbormasterDAO 'ORDER BY id ASC', $this->getID()); - $content = ""; + $content = ''; foreach ($result as $row) { - $content .= $row["chunk"]; + $content .= $row['chunk']; } return $content; } diff --git a/src/applications/herald/adapter/HeraldAdapter.php b/src/applications/herald/adapter/HeraldAdapter.php index a246542b02..7cd571aa8a 100644 --- a/src/applications/herald/adapter/HeraldAdapter.php +++ b/src/applications/herald/adapter/HeraldAdapter.php @@ -242,7 +242,7 @@ abstract class HeraldAdapter { self::FIELD_CONTENT_SOURCE => pht('Content Source'), self::FIELD_ALWAYS => pht('Always'), self::FIELD_AUTHOR_PROJECTS => pht("Author's projects"), - self::FIELD_PROJECTS => pht("Projects"), + self::FIELD_PROJECTS => pht('Projects'), self::FIELD_PUSHER => pht('Pusher'), self::FIELD_PUSHER_PROJECTS => pht("Pusher's projects"), self::FIELD_DIFFERENTIAL_REVISION => pht('Differential revision'), @@ -437,25 +437,25 @@ abstract class HeraldAdapter { case self::CONDITION_IS_ANY: if (!is_array($condition_value)) { throw new HeraldInvalidConditionException( - "Expected condition value to be an array."); + 'Expected condition value to be an array.'); } $condition_value = array_fuse($condition_value); return isset($condition_value[$field_value]); case self::CONDITION_IS_NOT_ANY: if (!is_array($condition_value)) { throw new HeraldInvalidConditionException( - "Expected condition value to be an array."); + 'Expected condition value to be an array.'); } $condition_value = array_fuse($condition_value); return !isset($condition_value[$field_value]); case self::CONDITION_INCLUDE_ALL: if (!is_array($field_value)) { throw new HeraldInvalidConditionException( - "Object produced non-array value!"); + 'Object produced non-array value!'); } if (!is_array($condition_value)) { throw new HeraldInvalidConditionException( - "Expected condition value to be an array."); + 'Expected condition value to be an array.'); } $have = array_select_keys(array_fuse($field_value), $condition_value); @@ -486,7 +486,7 @@ abstract class HeraldAdapter { $result = @preg_match($condition_value . 'S', $value); if ($result === false) { throw new HeraldInvalidConditionException( - "Regular expression is not valid!"); + 'Regular expression is not valid!'); } if ($result) { return true; @@ -501,11 +501,11 @@ abstract class HeraldAdapter { $regexp_pair = json_decode($condition_value, true); if (!is_array($regexp_pair)) { throw new HeraldInvalidConditionException( - "Regular expression pair is not valid JSON!"); + 'Regular expression pair is not valid JSON!'); } if (count($regexp_pair) != 2) { throw new HeraldInvalidConditionException( - "Regular expression pair is not a pair!"); + 'Regular expression pair is not a pair!'); } $key_regexp = array_shift($regexp_pair); @@ -515,13 +515,13 @@ abstract class HeraldAdapter { $key_matches = @preg_match($key_regexp, $key); if ($key_matches === false) { throw new HeraldInvalidConditionException( - "First regular expression is invalid!"); + 'First regular expression is invalid!'); } if ($key_matches) { $value_matches = @preg_match($value_regexp, $value); if ($value_matches === false) { throw new HeraldInvalidConditionException( - "Second regular expression is invalid!"); + 'Second regular expression is invalid!'); } if ($value_matches) { return true; @@ -534,7 +534,7 @@ abstract class HeraldAdapter { $rule = $engine->getRule($condition_value); if (!$rule) { throw new HeraldInvalidConditionException( - "Condition references a rule which does not exist!"); + 'Condition references a rule which does not exist!'); } $is_not = ($condition_type == self::CONDITION_NOT_RULE); diff --git a/src/applications/herald/adapter/HeraldCommitAdapter.php b/src/applications/herald/adapter/HeraldCommitAdapter.php index 3d1827882d..c31a38f906 100644 --- a/src/applications/herald/adapter/HeraldCommitAdapter.php +++ b/src/applications/herald/adapter/HeraldCommitAdapter.php @@ -269,7 +269,7 @@ final class HeraldCommitAdapter extends HeraldAdapter { ); $requests = id(new PhabricatorRepositoryAuditRequest()) ->loadAllWhere( - "commitPHID = %s AND auditStatus IN (%Ls)", + 'commitPHID = %s AND auditStatus IN (%Ls)', $this->commit->getPHID(), $status_arr); diff --git a/src/applications/herald/controller/HeraldRuleController.php b/src/applications/herald/controller/HeraldRuleController.php index b770348ef0..ecda679c83 100644 --- a/src/applications/herald/controller/HeraldRuleController.php +++ b/src/applications/herald/controller/HeraldRuleController.php @@ -92,9 +92,9 @@ final class HeraldRuleController extends HeraldController { if ($rule->getConfigVersion() > $local_version) { throw new Exception( pht( - "This rule was created with a newer version of Herald. You can not ". - "view or edit it in this older version. Upgrade your Phabricator ". - "deployment.")); + 'This rule was created with a newer version of Herald. You can not '. + 'view or edit it in this older version. Upgrade your Phabricator '. + 'deployment.')); } // Upgrade rule version to our version, since we might add newly-defined @@ -165,7 +165,7 @@ final class HeraldRuleController extends HeraldController { ->appendChild( id(new AphrontFormMarkupControl()) ->setValue(pht( - "This %s rule triggers for %s.", + 'This %s rule triggers for %s.', phutil_tag('strong', array(), $rule_type_name), phutil_tag('strong', array(), $content_type_name)))) ->appendChild($trigger_object_control) @@ -256,15 +256,15 @@ final class HeraldRuleController extends HeraldController { $errors = array(); if (!strlen($rule->getName())) { - $e_name = pht("Required"); - $errors[] = pht("Rule must have a name."); + $e_name = pht('Required'); + $errors[] = pht('Rule must have a name.'); } $data = json_decode($request->getStr('rule'), true); if (!is_array($data) || !$data['conditions'] || !$data['actions']) { - throw new Exception("Failed to decode rule data."); + throw new Exception('Failed to decode rule data.'); } $conditions = array(); @@ -336,8 +336,8 @@ final class HeraldRuleController extends HeraldController { $rule->saveTransaction(); } catch (AphrontQueryDuplicateKeyException $ex) { - $e_name = pht("Not Unique"); - $errors[] = pht("Rule name is not unique. Choose a unique name."); + $e_name = pht('Not Unique'); + $errors[] = pht('Rule name is not unique. Choose a unique name.'); } } diff --git a/src/applications/herald/controller/HeraldTestConsoleController.php b/src/applications/herald/controller/HeraldTestConsoleController.php index 58eae13c04..6ffa1d92db 100644 --- a/src/applications/herald/controller/HeraldTestConsoleController.php +++ b/src/applications/herald/controller/HeraldTestConsoleController.php @@ -48,7 +48,7 @@ final class HeraldTestConsoleController extends HeraldController { $adapter = id(new HeraldPholioMockAdapter()) ->setMock($object); } else { - throw new Exception("Can not build adapter for object!"); + throw new Exception('Can not build adapter for object!'); } $rules = id(new HeraldRuleQuery()) diff --git a/src/applications/herald/controller/HeraldTranscriptController.php b/src/applications/herald/controller/HeraldTranscriptController.php index 8a44face99..381d766f33 100644 --- a/src/applications/herald/controller/HeraldTranscriptController.php +++ b/src/applications/herald/controller/HeraldTranscriptController.php @@ -60,7 +60,7 @@ final class HeraldTranscriptController extends HeraldController { // table, and then filter this earlier (and thus raise a better error). // For now, just block access so we don't violate policies. throw new Exception( - pht("This transcript has an invalid or inaccessible adapter.")); + pht('This transcript has an invalid or inaccessible adapter.')); } $this->adapter = HeraldAdapter::getAdapterForContentType($object_type); @@ -361,7 +361,7 @@ final class HeraldTranscriptController extends HeraldController { $target[$k] = $handles[$phid]->getName(); } } - $target = implode(", ", $target); + $target = implode(', ', $target); } else { $target = ''; } diff --git a/src/applications/herald/engine/HeraldEngine.php b/src/applications/herald/engine/HeraldEngine.php index 5e62a8e19d..d4fedf1e94 100644 --- a/src/applications/herald/engine/HeraldEngine.php +++ b/src/applications/herald/engine/HeraldEngine.php @@ -79,8 +79,8 @@ final class HeraldEngine { ->setRuleName($rule->getName()) ->setRuleOwner($rule->getAuthorPHID()) ->setReason( - "This rule is only supposed to be repeated a single time, ". - "and it has already been applied."); + 'This rule is only supposed to be repeated a single time, '. + 'and it has already been applied.'); $this->transcript->addRuleTranscript($xscript); $rule_matches = false; } else { @@ -243,40 +243,40 @@ final class HeraldEngine { $local_version = id(new HeraldRule())->getConfigVersion(); if ($rule->getConfigVersion() > $local_version) { $reason = pht( - "Rule could not be processed, it was created with a newer version ". - "of Herald."); + 'Rule could not be processed, it was created with a newer version '. + 'of Herald.'); $result = false; } else if (!$conditions) { $reason = pht( - "Rule failed automatically because it has no conditions."); + 'Rule failed automatically because it has no conditions.'); $result = false; } else if (!$rule->hasValidAuthor()) { $reason = pht( - "Rule failed automatically because its owner is invalid ". - "or disabled."); + 'Rule failed automatically because its owner is invalid '. + 'or disabled.'); $result = false; } else if (!$this->canAuthorViewObject($rule, $object)) { $reason = pht( - "Rule failed automatically because it is a personal rule and its ". - "owner can not see the object."); + 'Rule failed automatically because it is a personal rule and its '. + 'owner can not see the object.'); $result = false; } else if (!$this->canRuleApplyToObject($rule, $object)) { $reason = pht( - "Rule failed automatically because it is an object rule which is ". - "not relevant for this object."); + 'Rule failed automatically because it is an object rule which is '. + 'not relevant for this object.'); $result = false; } else { foreach ($conditions as $condition) { $match = $this->doesConditionMatch($rule, $condition, $object); if (!$all && $match) { - $reason = "Any condition matched."; + $reason = 'Any condition matched.'; $result = true; break; } if ($all && !$match) { - $reason = "Not all conditions matched."; + $reason = 'Not all conditions matched.'; $result = false; break; } @@ -284,10 +284,10 @@ final class HeraldEngine { if ($result === null) { if ($all) { - $reason = "All conditions matched."; + $reason = 'All conditions matched.'; $result = true; } else { - $reason = "No conditions matched."; + $reason = 'No conditions matched.'; $result = false; } } diff --git a/src/applications/herald/storage/HeraldRule.php b/src/applications/herald/storage/HeraldRule.php index 28b0899b09..cdd4c5be7c 100644 --- a/src/applications/herald/storage/HeraldRule.php +++ b/src/applications/herald/storage/HeraldRule.php @@ -128,7 +128,7 @@ final class HeraldRule extends HeraldDAO assert_instances_of($children, 'HeraldDAO'); if (!$this->getID()) { - throw new Exception("Save rule before saving children."); + throw new Exception('Save rule before saving children.'); } foreach ($children as $child) { @@ -245,7 +245,7 @@ final class HeraldRule extends HeraldDAO if ($this->isPersonalRule()) { return pht("A personal rule's owner can always view and edit it."); } else if ($this->isObjectRule()) { - return pht("Object rules inherit the policies of their objects."); + return pht('Object rules inherit the policies of their objects.'); } return null; diff --git a/src/applications/legalpad/mail/LegalpadReplyHandler.php b/src/applications/legalpad/mail/LegalpadReplyHandler.php index 11c78da400..7491dcb86d 100644 --- a/src/applications/legalpad/mail/LegalpadReplyHandler.php +++ b/src/applications/legalpad/mail/LegalpadReplyHandler.php @@ -7,7 +7,7 @@ final class LegalpadReplyHandler extends PhabricatorMailReplyHandler { public function validateMailReceiver($mail_receiver) { if (!($mail_receiver instanceof LegalpadDocument)) { - throw new Exception("Mail receiver is not a LegalpadDocument!"); + throw new Exception('Mail receiver is not a LegalpadDocument!'); } } diff --git a/src/applications/lipsum/generator/PhabricatorTestDataGenerator.php b/src/applications/lipsum/generator/PhabricatorTestDataGenerator.php index 6470f6c26f..45eca56c7c 100644 --- a/src/applications/lipsum/generator/PhabricatorTestDataGenerator.php +++ b/src/applications/lipsum/generator/PhabricatorTestDataGenerator.php @@ -9,20 +9,20 @@ abstract class PhabricatorTestDataGenerator { public function loadOneRandom($classname) { try { return newv($classname, array()) - ->loadOneWhere("1 = 1 ORDER BY RAND() LIMIT 1"); + ->loadOneWhere('1 = 1 ORDER BY RAND() LIMIT 1'); } catch (PhutilMissingSymbolException $ex) { throw new PhutilMissingSymbolException( - "Unable to load symbol ".$classname.": this class does not exit."); + 'Unable to load symbol '.$classname.': this class does not exit.'); } } public function loadPhabrictorUserPHID() { - return $this->loadOneRandom("PhabricatorUser")->getPHID(); + return $this->loadOneRandom('PhabricatorUser')->getPHID(); } public function loadPhabrictorUser() { - return $this->loadOneRandom("PhabricatorUser"); + return $this->loadOneRandom('PhabricatorUser'); } } diff --git a/src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php b/src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php index 1544a0a05a..b79e50df67 100644 --- a/src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php +++ b/src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php @@ -26,13 +26,13 @@ final class PhabricatorLipsumGenerateWorkflow echo "\t".$typetmp."\n"; } echo "\n"; - $prompt = "Are you sure you want to generate lots of test data?"; + $prompt = 'Are you sure you want to generate lots of test data?'; if (!phutil_console_confirm($prompt, $default_no = true)) { return; } $argv = $args->getArg('args'); if (count($argv) == 0 || - (count($argv) == 1 && $argv[0] == "all")) { + (count($argv) == 1 && $argv[0] == 'all')) { $this->infinitelyGenerate($supported_types); } else { $new_supported_types = array(); @@ -56,8 +56,8 @@ final class PhabricatorLipsumGenerateWorkflow echo "None of the input types were supported.\n"; return; } - echo "GENERATING: "; - echo strtoupper(implode(" , ", array_keys($supported_types))); + echo 'GENERATING: '; + echo strtoupper(implode(' , ', array_keys($supported_types))); echo "\n"; while (true) { $type = $supported_types[array_rand($supported_types)]; diff --git a/src/applications/macro/conduit/ConduitAPI_macro_query_Method.php b/src/applications/macro/conduit/ConduitAPI_macro_query_Method.php index 87146d5c62..b5f76ddc80 100644 --- a/src/applications/macro/conduit/ConduitAPI_macro_query_Method.php +++ b/src/applications/macro/conduit/ConduitAPI_macro_query_Method.php @@ -6,7 +6,7 @@ final class ConduitAPI_macro_query_Method extends ConduitAPI_macro_Method { public function getMethodDescription() { - return "Retrieve image macro information."; + return 'Retrieve image macro information.'; } public function defineParamTypes() { diff --git a/src/applications/macro/config/PhabricatorMacroConfigOptions.php b/src/applications/macro/config/PhabricatorMacroConfigOptions.php index 087da3fbec..427405e840 100644 --- a/src/applications/macro/config/PhabricatorMacroConfigOptions.php +++ b/src/applications/macro/config/PhabricatorMacroConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorMacroConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Macro"); + return pht('Macro'); } public function getDescription() { - return pht("Configure Macro."); + return pht('Configure Macro.'); } public function getOptions() { diff --git a/src/applications/macro/controller/PhabricatorMacroMemeController.php b/src/applications/macro/controller/PhabricatorMacroMemeController.php index b0a79e3a4c..91e02fe845 100644 --- a/src/applications/macro/controller/PhabricatorMacroMemeController.php +++ b/src/applications/macro/controller/PhabricatorMacroMemeController.php @@ -31,8 +31,8 @@ final class PhabricatorMacroMemeController $upper_text = strtoupper($upper_text); $lower_text = strtoupper($lower_text); - $mixed_text = md5($upper_text).":".md5($lower_text); - $hash = "meme".hash("sha256", $mixed_text); + $mixed_text = md5($upper_text).':'.md5($lower_text); + $hash = 'meme'.hash('sha256', $mixed_text); $xform = id(new PhabricatorTransformedFile()) ->loadOneWhere('originalphid=%s and transform=%s', $file->getPHID(), $hash); diff --git a/src/applications/macro/mail/PhabricatorMacroReplyHandler.php b/src/applications/macro/mail/PhabricatorMacroReplyHandler.php index b44cbb0570..b447895d7f 100644 --- a/src/applications/macro/mail/PhabricatorMacroReplyHandler.php +++ b/src/applications/macro/mail/PhabricatorMacroReplyHandler.php @@ -4,7 +4,7 @@ final class PhabricatorMacroReplyHandler extends PhabricatorMailReplyHandler { public function validateMailReceiver($mail_receiver) { if (!($mail_receiver instanceof PhabricatorFileImageMacro)) { - throw new Exception("Mail receiver is not a PhabricatorFileImageMacro!"); + throw new Exception('Mail receiver is not a PhabricatorFileImageMacro!'); } } @@ -26,7 +26,7 @@ final class PhabricatorMacroReplyHandler extends PhabricatorMailReplyHandler { if ($this->supportsReplies()) { // TODO: Implement. return null; - return pht("Reply to comment."); + return pht('Reply to comment.'); } else { return null; } diff --git a/src/applications/macro/query/PhabricatorMacroSearchEngine.php b/src/applications/macro/query/PhabricatorMacroSearchEngine.php index 1e95cb6833..0480db4927 100644 --- a/src/applications/macro/query/PhabricatorMacroSearchEngine.php +++ b/src/applications/macro/query/PhabricatorMacroSearchEngine.php @@ -78,7 +78,7 @@ final class PhabricatorMacroSearchEngine $status = $saved_query->getParameter('status'); $names = implode(', ', $saved_query->getParameter('names', array())); $like = $saved_query->getParameter('nameLike'); - $color = $saved_query->getParameter('flagColor', "-1"); + $color = $saved_query->getParameter('flagColor', '-1'); $form ->appendChild( diff --git a/src/applications/maniphest/conduit/ConduitAPI_maniphest_createtask_Method.php b/src/applications/maniphest/conduit/ConduitAPI_maniphest_createtask_Method.php index f306861fb8..6771301321 100644 --- a/src/applications/maniphest/conduit/ConduitAPI_maniphest_createtask_Method.php +++ b/src/applications/maniphest/conduit/ConduitAPI_maniphest_createtask_Method.php @@ -7,7 +7,7 @@ final class ConduitAPI_maniphest_createtask_Method extends ConduitAPI_maniphest_Method { public function getMethodDescription() { - return "Create a new Maniphest task."; + return 'Create a new Maniphest task.'; } public function defineParamTypes() { diff --git a/src/applications/maniphest/conduit/ConduitAPI_maniphest_find_Method.php b/src/applications/maniphest/conduit/ConduitAPI_maniphest_find_Method.php index 76e2588aea..d5ccc8acc3 100644 --- a/src/applications/maniphest/conduit/ConduitAPI_maniphest_find_Method.php +++ b/src/applications/maniphest/conduit/ConduitAPI_maniphest_find_Method.php @@ -17,7 +17,7 @@ final class ConduitAPI_maniphest_find_Method } public function getMethodDescription() { - return "Deprecated alias of maniphest.query"; + return 'Deprecated alias of maniphest.query'; } } diff --git a/src/applications/maniphest/conduit/ConduitAPI_maniphest_gettasktransactions_Method.php b/src/applications/maniphest/conduit/ConduitAPI_maniphest_gettasktransactions_Method.php index dc25cd05ce..61f9c85dcf 100644 --- a/src/applications/maniphest/conduit/ConduitAPI_maniphest_gettasktransactions_Method.php +++ b/src/applications/maniphest/conduit/ConduitAPI_maniphest_gettasktransactions_Method.php @@ -7,7 +7,7 @@ final class ConduitAPI_maniphest_gettasktransactions_Method extends ConduitAPI_maniphest_Method { public function getMethodDescription() { - return "Retrieve Maniphest Task Transactions."; + return 'Retrieve Maniphest Task Transactions.'; } public function defineParamTypes() { diff --git a/src/applications/maniphest/conduit/ConduitAPI_maniphest_info_Method.php b/src/applications/maniphest/conduit/ConduitAPI_maniphest_info_Method.php index a6c14f48f3..da6d4c1f1e 100644 --- a/src/applications/maniphest/conduit/ConduitAPI_maniphest_info_Method.php +++ b/src/applications/maniphest/conduit/ConduitAPI_maniphest_info_Method.php @@ -8,7 +8,7 @@ final class ConduitAPI_maniphest_info_Method public function getMethodDescription() { - return "Retrieve information about a Maniphest task, given its id."; + return 'Retrieve information about a Maniphest task, given its id.'; } public function defineParamTypes() { diff --git a/src/applications/maniphest/conduit/ConduitAPI_maniphest_query_Method.php b/src/applications/maniphest/conduit/ConduitAPI_maniphest_query_Method.php index 6ad94356bc..5a551e3b32 100644 --- a/src/applications/maniphest/conduit/ConduitAPI_maniphest_query_Method.php +++ b/src/applications/maniphest/conduit/ConduitAPI_maniphest_query_Method.php @@ -12,7 +12,7 @@ class ConduitAPI_maniphest_query_Method public function getMethodDescription() { - return "Execute complex searches for Maniphest tasks."; + return 'Execute complex searches for Maniphest tasks.'; } public function defineParamTypes() { diff --git a/src/applications/maniphest/conduit/ConduitAPI_maniphest_querystatuses_Method.php b/src/applications/maniphest/conduit/ConduitAPI_maniphest_querystatuses_Method.php index ab6963b6b3..a752bf957a 100644 --- a/src/applications/maniphest/conduit/ConduitAPI_maniphest_querystatuses_Method.php +++ b/src/applications/maniphest/conduit/ConduitAPI_maniphest_querystatuses_Method.php @@ -4,7 +4,7 @@ final class ConduitAPI_maniphest_querystatuses_Method extends ConduitAPI_maniphest_Method { public function getMethodDescription() { - return "Retrieve information about possible Maniphest Task status values."; + return 'Retrieve information about possible Maniphest Task status values.'; } public function defineParamTypes() { diff --git a/src/applications/maniphest/conduit/ConduitAPI_maniphest_update_Method.php b/src/applications/maniphest/conduit/ConduitAPI_maniphest_update_Method.php index ffe43cbd27..99969d108c 100644 --- a/src/applications/maniphest/conduit/ConduitAPI_maniphest_update_Method.php +++ b/src/applications/maniphest/conduit/ConduitAPI_maniphest_update_Method.php @@ -7,7 +7,7 @@ final class ConduitAPI_maniphest_update_Method extends ConduitAPI_maniphest_Method { public function getMethodDescription() { - return "Update an existing Maniphest task."; + return 'Update an existing Maniphest task.'; } public function defineErrorTypes() { diff --git a/src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php b/src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php index 6b03cae03c..67d05dae22 100644 --- a/src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php +++ b/src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorManiphestConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Maniphest"); + return pht('Maniphest'); } public function getDescription() { - return pht("Configure Maniphest."); + return pht('Configure Maniphest.'); } public function getOptions() { @@ -215,7 +215,7 @@ EOTEXT return array( $this->newOption('maniphest.custom-field-definitions', 'wild', array()) - ->setSummary(pht("Custom Maniphest fields.")) + ->setSummary(pht('Custom Maniphest fields.')) ->setDescription( pht( 'Array of custom fields for Maniphest tasks. For details on '. @@ -228,9 +228,9 @@ EOTEXT pht('Valid Setting')), $this->newOption('maniphest.fields', $custom_field_type, $default_fields) ->setCustomData(id(new ManiphestTask())->getCustomFieldBaseClass()) - ->setDescription(pht("Select and reorder task fields.")), + ->setDescription(pht('Select and reorder task fields.')), $this->newOption('maniphest.priorities', 'wild', $priority_defaults) - ->setSummary(pht("Configure Maniphest priority names.")) + ->setSummary(pht('Configure Maniphest priority names.')) ->setDescription( pht( 'Allows you to edit or override the default priorities available '. @@ -252,7 +252,7 @@ EOTEXT ->setDescription($status_description) ->addExample($status_example, pht('Minimal Valid Config')), $this->newOption('maniphest.default-priority', 'int', 90) - ->setSummary(pht("Default task priority for create flows.")) + ->setSummary(pht('Default task priority for create flows.')) ->setDescription( pht( "What should the default task priority be in create flows? See ". diff --git a/src/applications/maniphest/controller/ManiphestExportController.php b/src/applications/maniphest/controller/ManiphestExportController.php index 1872efc97c..f30b5cb930 100644 --- a/src/applications/maniphest/controller/ManiphestExportController.php +++ b/src/applications/maniphest/controller/ManiphestExportController.php @@ -88,7 +88,7 @@ final class ManiphestExportController extends ManiphestController { ->appendChild( id(new AphrontFormSelectControl()) ->setLabel(pht('Format:')) - ->setName("excel-format") + ->setName('excel-format') ->setOptions($export_formats)); $dialog->appendChild($form); @@ -98,7 +98,7 @@ final class ManiphestExportController extends ManiphestController { return id(new AphrontDialogResponse())->setDialog($dialog); } - $format = idx($formats, $request->getStr("excel-format")); + $format = idx($formats, $request->getStr('excel-format')); if ($format === null) { throw new Exception('Excel format object not found.'); } diff --git a/src/applications/maniphest/controller/ManiphestReportController.php b/src/applications/maniphest/controller/ManiphestReportController.php index e7ba433fbc..1b04a1ad3e 100644 --- a/src/applications/maniphest/controller/ManiphestReportController.php +++ b/src/applications/maniphest/controller/ManiphestReportController.php @@ -245,16 +245,16 @@ final class ManiphestReportController extends ManiphestController { if ($handle) { $inst = pht( - "NOTE: This table reflects tasks currently in ". - "the project. If a task was opened in the past but added to ". - "the project recently, it is counted on the day it was ". - "opened, not the day it was categorized. If a task was part ". - "of this project in the past but no longer is, it is not ". - "counted at all."); - $header = pht("Task Burn Rate for Project %s", $handle->renderLink()); + 'NOTE: This table reflects tasks currently in '. + 'the project. If a task was opened in the past but added to '. + 'the project recently, it is counted on the day it was '. + 'opened, not the day it was categorized. If a task was part '. + 'of this project in the past but no longer is, it is not '. + 'counted at all.'); + $header = pht('Task Burn Rate for Project %s', $handle->renderLink()); $caption = phutil_tag('p', array(), $inst); } else { - $header = pht("Task Burn Rate for All Tasks"); + $header = pht('Task Burn Rate for All Tasks'); $caption = null; } diff --git a/src/applications/maniphest/lipsum/PhabricatorManiphestTaskTestDataGenerator.php b/src/applications/maniphest/lipsum/PhabricatorManiphestTaskTestDataGenerator.php index 7d0d5a8ec6..e4211dc9c9 100644 --- a/src/applications/maniphest/lipsum/PhabricatorManiphestTaskTestDataGenerator.php +++ b/src/applications/maniphest/lipsum/PhabricatorManiphestTaskTestDataGenerator.php @@ -61,7 +61,7 @@ final class PhabricatorManiphestTaskTestDataGenerator public function getProjectPHIDs() { $projects = array(); for ($i = 0; $i < rand(1, 4);$i++) { - $project = $this->loadOneRandom("PhabricatorProject"); + $project = $this->loadOneRandom('PhabricatorProject'); if ($project) { $projects[] = $project->getPHID(); } diff --git a/src/applications/maniphest/mail/ManiphestReplyHandler.php b/src/applications/maniphest/mail/ManiphestReplyHandler.php index 3ab24595dd..8408dd0cee 100644 --- a/src/applications/maniphest/mail/ManiphestReplyHandler.php +++ b/src/applications/maniphest/mail/ManiphestReplyHandler.php @@ -7,7 +7,7 @@ final class ManiphestReplyHandler extends PhabricatorMailReplyHandler { public function validateMailReceiver($mail_receiver) { if (!($mail_receiver instanceof ManiphestTask)) { - throw new Exception("Mail receiver is not a ManiphestTask!"); + throw new Exception('Mail receiver is not a ManiphestTask!'); } } @@ -28,8 +28,8 @@ final class ManiphestReplyHandler extends PhabricatorMailReplyHandler { public function getReplyHandlerInstructions() { if ($this->supportsReplies()) { return pht( - "Reply to comment or attach files, or !close, !claim, ". - "!unsubscribe or !assign ."); + 'Reply to comment or attach files, or !close, !claim, '. + '!unsubscribe or !assign .'); } else { return null; } diff --git a/src/applications/metamta/adapter/PhabricatorMailImplementationSendGridAdapter.php b/src/applications/metamta/adapter/PhabricatorMailImplementationSendGridAdapter.php index 44c8acd2f5..e9e30b31fe 100644 --- a/src/applications/metamta/adapter/PhabricatorMailImplementationSendGridAdapter.php +++ b/src/applications/metamta/adapter/PhabricatorMailImplementationSendGridAdapter.php @@ -147,7 +147,7 @@ final class PhabricatorMailImplementationSendGridAdapter } if ($response['message'] !== 'success') { - $errors = implode(";", $response['errors']); + $errors = implode(';', $response['errors']); throw new Exception("Request failed with errors: {$errors}."); } diff --git a/src/applications/metamta/contentsource/PhabricatorContentSourceView.php b/src/applications/metamta/contentsource/PhabricatorContentSourceView.php index 6a37e3c824..e1a7b8fdaf 100644 --- a/src/applications/metamta/contentsource/PhabricatorContentSourceView.php +++ b/src/applications/metamta/contentsource/PhabricatorContentSourceView.php @@ -24,7 +24,7 @@ final class PhabricatorContentSourceView extends AphrontView { return phutil_tag( 'span', array( - 'class' => "phabricator-content-source-view", + 'class' => 'phabricator-content-source-view', ), "Via {$type}"); } diff --git a/src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php index e103513422..d6a762b75e 100644 --- a/src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php +++ b/src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php @@ -8,7 +8,7 @@ final class PhabricatorMailManagementListInboundWorkflow ->setName('list-inbound') ->setSynopsis('List inbound messages received by Phabricator.') ->setExamples( - "**list-inbound**") + '**list-inbound**') ->setArguments( array( array( @@ -29,7 +29,7 @@ final class PhabricatorMailManagementListInboundWorkflow $args->getArg('limit')); if (!$mails) { - $console->writeErr("%s\n", pht("No received mail.")); + $console->writeErr("%s\n", pht('No received mail.')); return 0; } @@ -45,7 +45,7 @@ final class PhabricatorMailManagementListInboundWorkflow $console->writeOut( "%s\n", sprintf( - "% 8d %-16s %-20s %s", + '% 8d %-16s %-20s %s', $mail->getID(), $mail->getAuthorPHID() ? $handles[$mail->getAuthorPHID()]->getName() diff --git a/src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php index 6d84d15669..14907c0f76 100644 --- a/src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php +++ b/src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php @@ -8,7 +8,7 @@ final class PhabricatorMailManagementListOutboundWorkflow ->setName('list-outbound') ->setSynopsis('List outbound messages sent by Phabricator.') ->setExamples( - "**list-outbound**") + '**list-outbound**') ->setArguments( array( array( @@ -29,7 +29,7 @@ final class PhabricatorMailManagementListOutboundWorkflow $args->getArg('limit')); if (!$mails) { - $console->writeErr("%s\n", pht("No sent mail.")); + $console->writeErr("%s\n", pht('No sent mail.')); return 0; } @@ -37,7 +37,7 @@ final class PhabricatorMailManagementListOutboundWorkflow $console->writeOut( "%s\n", sprintf( - "% 8d %-8s %s", + '% 8d %-8s %s', $mail->getID(), PhabricatorMetaMTAMail::getReadableStatus($mail->getStatus()), $mail->getSubject())); diff --git a/src/applications/metamta/management/PhabricatorMailManagementReceiveTestWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementReceiveTestWorkflow.php index 22eb00e419..ebaf76817c 100644 --- a/src/applications/metamta/management/PhabricatorMailManagementReceiveTestWorkflow.php +++ b/src/applications/metamta/management/PhabricatorMailManagementReceiveTestWorkflow.php @@ -11,7 +11,7 @@ final class PhabricatorMailManagementReceiveTestWorkflow 'Simulate receiving mail. This is primarily useful if you are '. 'developing new mail receivers.')) ->setExamples( - "**receive-test** --as alincoln --to D123 < body.txt") + '**receive-test** --as alincoln --to D123 < body.txt') ->setArguments( array( array( @@ -136,7 +136,7 @@ final class PhabricatorMailManagementReceiveTestWorkflow $console->writeErr( "%s\n\n phabricator/ $ ./bin/mail show-inbound --id %d\n\n", - pht("Mail received! You can view details by running this command:"), + pht('Mail received! You can view details by running this command:'), $received->getID()); } diff --git a/src/applications/metamta/management/PhabricatorMailManagementResendWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementResendWorkflow.php index c586997172..952ec44f33 100644 --- a/src/applications/metamta/management/PhabricatorMailManagementResendWorkflow.php +++ b/src/applications/metamta/management/PhabricatorMailManagementResendWorkflow.php @@ -8,7 +8,7 @@ final class PhabricatorMailManagementResendWorkflow ->setName('resend') ->setSynopsis('Send mail again.') ->setExamples( - "**resend** --id 1 --id 2") + '**resend** --id 1 --id 2') ->setArguments( array( array( @@ -38,7 +38,7 @@ final class PhabricatorMailManagementResendWorkflow $missing = array_diff_key($ids, $messages); if ($missing) { throw new PhutilArgumentUsageException( - "Some specified messages do not exist: ". + 'Some specified messages do not exist: '. implode(', ', array_keys($missing))); } } diff --git a/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php index 4af5d5a79e..763e0d764a 100644 --- a/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php +++ b/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php @@ -11,7 +11,7 @@ final class PhabricatorMailManagementSendTestWorkflow 'Simulate sending mail. This may be useful to test your mail '. 'configuration, or while developing new mail adapters.')) ->setExamples( - "**send-test** --to alincoln --subject hi < body.txt") + '**send-test** --to alincoln --subject hi < body.txt') ->setArguments( array( array( @@ -139,7 +139,7 @@ final class PhabricatorMailManagementSendTestWorkflow $console->writeErr( "%s\n\n phabricator/ $ ./bin/mail show-outbound --id %d\n\n", - pht("Mail sent! You can view details by running this command:"), + pht('Mail sent! You can view details by running this command:'), $mail->getID()); } diff --git a/src/applications/metamta/management/PhabricatorMailManagementShowInboundWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementShowInboundWorkflow.php index 138436a66e..7131187fa7 100644 --- a/src/applications/metamta/management/PhabricatorMailManagementShowInboundWorkflow.php +++ b/src/applications/metamta/management/PhabricatorMailManagementShowInboundWorkflow.php @@ -8,7 +8,7 @@ final class PhabricatorMailManagementShowInboundWorkflow ->setName('show-inbound') ->setSynopsis('Show diagnostic details about inbound mail.') ->setExamples( - "**show-inbound** --id 1 --id 2") + '**show-inbound** --id 1 --id 2') ->setArguments( array( array( @@ -38,7 +38,7 @@ final class PhabricatorMailManagementShowInboundWorkflow $missing = array_diff_key($ids, $messages); if ($missing) { throw new PhutilArgumentUsageException( - "Some specified messages do not exist: ". + 'Some specified messages do not exist: '. implode(', ', array_keys($missing))); } } diff --git a/src/applications/metamta/management/PhabricatorMailManagementShowOutboundWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementShowOutboundWorkflow.php index 31989fa261..e2854a4a27 100644 --- a/src/applications/metamta/management/PhabricatorMailManagementShowOutboundWorkflow.php +++ b/src/applications/metamta/management/PhabricatorMailManagementShowOutboundWorkflow.php @@ -8,7 +8,7 @@ final class PhabricatorMailManagementShowOutboundWorkflow ->setName('show-outbound') ->setSynopsis('Show diagnostic details about outbound mail.') ->setExamples( - "**show-outbound** --id 1 --id 2") + '**show-outbound** --id 1 --id 2') ->setArguments( array( array( @@ -38,7 +38,7 @@ final class PhabricatorMailManagementShowOutboundWorkflow $missing = array_diff_key($ids, $messages); if ($missing) { throw new PhutilArgumentUsageException( - "Some specified messages do not exist: ". + 'Some specified messages do not exist: '. implode(', ', array_keys($missing))); } } diff --git a/src/applications/metamta/parser/__tests__/PhabricatorMetaMTAEmailBodyParserTestCase.php b/src/applications/metamta/parser/__tests__/PhabricatorMetaMTAEmailBodyParserTestCase.php index fd30ce6343..08414f2e97 100644 --- a/src/applications/metamta/parser/__tests__/PhabricatorMetaMTAEmailBodyParserTestCase.php +++ b/src/applications/metamta/parser/__tests__/PhabricatorMetaMTAEmailBodyParserTestCase.php @@ -8,7 +8,7 @@ final class PhabricatorMetaMTAEmailBodyParserTestCase foreach ($bodies as $body) { $parser = new PhabricatorMetaMTAEmailBodyParser(); $stripped = $parser->stripTextBody($body); - $this->assertEqual("OKAY", $stripped); + $this->assertEqual('OKAY', $stripped); } } @@ -42,7 +42,7 @@ EOEMAIL; $parser = new PhabricatorMetaMTAEmailBodyParser(); $stripped = $parser->stripTextBody($body); - $this->assertEqual("On which horse shall you ride?", $stripped); + $this->assertEqual('On which horse shall you ride?', $stripped); } private function getEmailBodiesWithFullCommands() { diff --git a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php index 6e1b5132da..ded773c79a 100644 --- a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php +++ b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php @@ -332,7 +332,7 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO { if (!$force_send) { if ($this->getStatus() != self::STATUS_QUEUE) { - throw new Exception("Trying to send an already-sent mail!"); + throw new Exception('Trying to send an already-sent mail!'); } } @@ -411,7 +411,7 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO { list($header_key, $header_value) = $pair; // NOTE: If we have \n in a header, SES rejects the email. - $header_value = str_replace("\n", " ", $header_value); + $header_value = str_replace("\n", ' ', $header_value); $mailer->addHeader($header_key, $header_value); } @@ -554,8 +554,8 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO { if (!$add_to && !$add_cc) { $this->setStatus(self::STATUS_VOID); $this->setMessage( - "Message has no valid recipients: all To/Cc are disabled, invalid, ". - "or configured not to receive this mail."); + 'Message has no valid recipients: all To/Cc are disabled, invalid, '. + 'or configured not to receive this mail.'); return $this->save(); } @@ -651,10 +651,10 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO { public static function getReadableStatus($status_code) { static $readable = array( - self::STATUS_QUEUE => "Queued for Delivery", - self::STATUS_FAIL => "Delivery Failed", - self::STATUS_SENT => "Sent", - self::STATUS_VOID => "Void", + self::STATUS_QUEUE => 'Queued for Delivery', + self::STATUS_FAIL => 'Delivery Failed', + self::STATUS_SENT => 'Sent', + self::STATUS_VOID => 'Void', ); $status_code = coalesce($status_code, '?'); return idx($readable, $status_code, $status_code); diff --git a/src/applications/metamta/storage/__tests__/PhabricatorMetaMTAMailTestCase.php b/src/applications/metamta/storage/__tests__/PhabricatorMetaMTAMailTestCase.php index 6337c4764f..d3575097d5 100644 --- a/src/applications/metamta/storage/__tests__/PhabricatorMetaMTAMailTestCase.php +++ b/src/applications/metamta/storage/__tests__/PhabricatorMetaMTAMailTestCase.php @@ -164,8 +164,8 @@ final class PhabricatorMetaMTAMailTestCase extends PhabricatorTestCase { $expect_references = true; } - $case = ""; + $case = ''; $this->assertTrue( isset($dict['Thread-Index']), diff --git a/src/applications/metamta/view/__tests__/PhabricatorMetaMTAMailBodyTestCase.php b/src/applications/metamta/view/__tests__/PhabricatorMetaMTAMailBodyTestCase.php index 1d5b1e047a..f7579fc89a 100644 --- a/src/applications/metamta/view/__tests__/PhabricatorMetaMTAMailBodyTestCase.php +++ b/src/applications/metamta/view/__tests__/PhabricatorMetaMTAMailBodyTestCase.php @@ -66,10 +66,10 @@ EOTEXT; $env->overrideEnvConfig('metamta.reply.show-hints', $reply_hints); $body = new PhabricatorMetaMTAMailBody(); - $body->addRawSection("salmon"); - $body->addTextSection("HEADER", "bass\ntrout\n"); - $body->addHeraldSection("/xscript/"); - $body->addReplySection("pike"); + $body->addRawSection('salmon'); + $body->addTextSection('HEADER', "bass\ntrout\n"); + $body->addHeraldSection('/xscript/'); + $body->addReplySection('pike'); $this->assertEqual($expect, $body->render()); } diff --git a/src/applications/notification/PhabricatorNotificationQuery.php b/src/applications/notification/PhabricatorNotificationQuery.php index 3fa20923d5..c056d6f6f2 100644 --- a/src/applications/notification/PhabricatorNotificationQuery.php +++ b/src/applications/notification/PhabricatorNotificationQuery.php @@ -47,7 +47,7 @@ final class PhabricatorNotificationQuery protected function loadPage() { if (!$this->userPHID) { - throw new Exception("Call setUser() before executing the query"); + throw new Exception('Call setUser() before executing the query'); } $story_table = new PhabricatorFeedStoryData(); @@ -57,11 +57,11 @@ final class PhabricatorNotificationQuery $data = queryfx_all( $conn, - "SELECT story.*, notif.hasViewed FROM %T notif + 'SELECT story.*, notif.hasViewed FROM %T notif JOIN %T story ON notif.chronologicalKey = story.chronologicalKey %Q ORDER BY notif.chronologicalKey DESC - %Q", + %Q', $notification_table->getTableName(), $story_table->getTableName(), $this->buildWhereClause($conn), diff --git a/src/applications/notification/controller/PhabricatorNotificationClearController.php b/src/applications/notification/controller/PhabricatorNotificationClearController.php index 06a99d9f76..7bf598a81a 100644 --- a/src/applications/notification/controller/PhabricatorNotificationClearController.php +++ b/src/applications/notification/controller/PhabricatorNotificationClearController.php @@ -29,8 +29,8 @@ final class PhabricatorNotificationClearController if ($is_serious) { $dialog->appendChild( pht( - "All unread notifications will be marked as read. You can not ". - "undo this action.")); + 'All unread notifications will be marked as read. You can not '. + 'undo this action.')); } else { $dialog->appendChild( pht( diff --git a/src/applications/notification/controller/PhabricatorNotificationStatusController.php b/src/applications/notification/controller/PhabricatorNotificationStatusController.php index 92954e2c86..18fb1845b9 100644 --- a/src/applications/notification/controller/PhabricatorNotificationStatusController.php +++ b/src/applications/notification/controller/PhabricatorNotificationStatusController.php @@ -9,7 +9,7 @@ final class PhabricatorNotificationStatusController $status = $this->renderServerStatus($status); } catch (Exception $ex) { $status = new AphrontErrorView(); - $status->setTitle("Notification Server Issue"); + $status->setTitle('Notification Server Issue'); $status->appendChild(hsprintf( 'Unable to determine server status. This probably means the server '. 'is not in great shape. The specific issue encountered was:'. @@ -66,7 +66,7 @@ final class PhabricatorNotificationStatusController ->setTag('a') ->setWorkflow(true) ->setText(pht('Send Test Notification')) - ->setHref($this->getApplicationURI("test/")) + ->setHref($this->getApplicationURI('test/')) ->setIcon($test_icon); $header = id(new PHUIHeaderView()) diff --git a/src/applications/notification/storage/PhabricatorFeedStoryNotification.php b/src/applications/notification/storage/PhabricatorFeedStoryNotification.php index 182e08e2a3..47846418c4 100644 --- a/src/applications/notification/storage/PhabricatorFeedStoryNotification.php +++ b/src/applications/notification/storage/PhabricatorFeedStoryNotification.php @@ -25,11 +25,11 @@ final class PhabricatorFeedStoryNotification extends PhabricatorFeedDAO { queryfx( $conn, - "UPDATE %T + 'UPDATE %T SET hasViewed = 1 WHERE userPHID = %s AND primaryObjectPHID = %s - AND hasViewed = 0", + AND hasViewed = 0', $notification_table->getTableName(), $user->getPHID(), $object_phid); diff --git a/src/applications/owners/config/PhabricatorOwnersConfigOptions.php b/src/applications/owners/config/PhabricatorOwnersConfigOptions.php index 2554c0310f..27333211e0 100644 --- a/src/applications/owners/config/PhabricatorOwnersConfigOptions.php +++ b/src/applications/owners/config/PhabricatorOwnersConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorOwnersConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Owners"); + return pht('Owners'); } public function getDescription() { - return pht("Configure Owners."); + return pht('Configure Owners.'); } public function getOptions() { diff --git a/src/applications/owners/controller/PhabricatorOwnersDetailController.php b/src/applications/owners/controller/PhabricatorOwnersDetailController.php index 957df24e3c..ad4466a430 100644 --- a/src/applications/owners/controller/PhabricatorOwnersDetailController.php +++ b/src/applications/owners/controller/PhabricatorOwnersDetailController.php @@ -224,7 +224,7 @@ final class PhabricatorOwnersDetailController $nav, ), array( - 'title' => pht("Package %s", $package->getName()), + 'title' => pht('Package %s', $package->getName()), 'device' => true, )); } diff --git a/src/applications/owners/mail/OwnersPackageReplyHandler.php b/src/applications/owners/mail/OwnersPackageReplyHandler.php index e530ee41ed..5f2c7c5f12 100644 --- a/src/applications/owners/mail/OwnersPackageReplyHandler.php +++ b/src/applications/owners/mail/OwnersPackageReplyHandler.php @@ -3,7 +3,7 @@ final class OwnersPackageReplyHandler extends PhabricatorMailReplyHandler { public function validateMailReceiver($mail_receiver) { if (!($mail_receiver instanceof PhabricatorOwnersPackage)) { - throw new Exception("Receiver is not a PhabricatorOwnersPackage!"); + throw new Exception('Receiver is not a PhabricatorOwnersPackage!'); } } diff --git a/src/applications/owners/mail/PackageDeleteMail.php b/src/applications/owners/mail/PackageDeleteMail.php index c7ced65b3e..8d992b3fb8 100644 --- a/src/applications/owners/mail/PackageDeleteMail.php +++ b/src/applications/owners/mail/PackageDeleteMail.php @@ -3,7 +3,7 @@ final class PackageDeleteMail extends PackageMail { protected function getVerb() { - return "Deleted"; + return 'Deleted'; } protected function isNewThread() { diff --git a/src/applications/passphrase/keys/PassphraseAbstractKey.php b/src/applications/passphrase/keys/PassphraseAbstractKey.php index cf532d3fac..da56de15af 100644 --- a/src/applications/passphrase/keys/PassphraseAbstractKey.php +++ b/src/applications/passphrase/keys/PassphraseAbstractKey.php @@ -6,7 +6,7 @@ abstract class PassphraseAbstractKey extends Phobject { protected function requireCredential() { if (!$this->credential) { - throw new Exception(pht("Credential is required!")); + throw new Exception(pht('Credential is required!')); } return $this->credential; } diff --git a/src/applications/passphrase/view/PassphraseCredentialControl.php b/src/applications/passphrase/view/PassphraseCredentialControl.php index 980e572330..4e1493d458 100644 --- a/src/applications/passphrase/view/PassphraseCredentialControl.php +++ b/src/applications/passphrase/view/PassphraseCredentialControl.php @@ -41,7 +41,7 @@ final class PassphraseCredentialControl extends AphrontFormControl { $options_map = array(); foreach ($this->options as $option) { $options_map[$option->getPHID()] = pht( - "%s %s", + '%s %s', 'K'.$option->getID(), $option->getName()); } diff --git a/src/applications/paste/conduit/ConduitAPI_paste_info_Method.php b/src/applications/paste/conduit/ConduitAPI_paste_info_Method.php index 2e5956f05e..7e3797019f 100644 --- a/src/applications/paste/conduit/ConduitAPI_paste_info_Method.php +++ b/src/applications/paste/conduit/ConduitAPI_paste_info_Method.php @@ -14,7 +14,7 @@ final class ConduitAPI_paste_info_Method extends ConduitAPI_paste_Method { } public function getMethodDescription() { - return "Retrieve an array of information about a paste."; + return 'Retrieve an array of information about a paste.'; } public function defineParamTypes() { diff --git a/src/applications/paste/conduit/ConduitAPI_paste_query_Method.php b/src/applications/paste/conduit/ConduitAPI_paste_query_Method.php index 7f5ad4ff83..c839d562dc 100644 --- a/src/applications/paste/conduit/ConduitAPI_paste_query_Method.php +++ b/src/applications/paste/conduit/ConduitAPI_paste_query_Method.php @@ -6,7 +6,7 @@ final class ConduitAPI_paste_query_Method extends ConduitAPI_paste_Method { public function getMethodDescription() { - return "Query Pastes."; + return 'Query Pastes.'; } public function defineParamTypes() { diff --git a/src/applications/paste/lipsum/PhabricatorPasteTestDataGenerator.php b/src/applications/paste/lipsum/PhabricatorPasteTestDataGenerator.php index 1caf410ad9..2e7061e279 100644 --- a/src/applications/paste/lipsum/PhabricatorPasteTestDataGenerator.php +++ b/src/applications/paste/lipsum/PhabricatorPasteTestDataGenerator.php @@ -5,8 +5,8 @@ final class PhabricatorPasteTestDataGenerator // Better Support for this in the future public $supportedLanguages = array( - "Java" => "java", - "PHP" => "php"); + 'Java' => 'java', + 'PHP' => 'php'); public function generate() { $authorphid = $this->loadPhabrictorUserPHID(); @@ -37,7 +37,7 @@ final class PhabricatorPasteTestDataGenerator private function loadPhabrictorPastePHID() { $random = rand(0, 1); if ($random == 1) { - $paste = id($this->loadOneRandom("PhabricatorPaste")); + $paste = id($this->loadOneRandom('PhabricatorPaste')); if ($paste) { return $paste->getPHID(); } @@ -55,15 +55,15 @@ final class PhabricatorPasteTestDataGenerator $title = preg_replace('/\s+/', '', $title); if ($language == null || !in_array($language, array_keys($this->supportedLanguages))) { - return $title.".txt"; + return $title.'.txt'; } else { - return $title.".".$this->supportedLanguages[$language]; + return $title.'.'.$this->supportedLanguages[$language]; } } public function generateLanguage() { $supplemented_lang = $this->supportedLanguages; - $supplemented_lang["lipsum"] = "txt"; + $supplemented_lang['lipsum'] = 'txt'; return array_rand($supplemented_lang); } @@ -73,7 +73,7 @@ final class PhabricatorPasteTestDataGenerator return id(new PhutilLipsumContextFreeGrammar()) ->generateSeveral(rand(30, 40)); } else { - $cfg_class = "Phutil".$language."CodeSnippetContextFreeGrammar"; + $cfg_class = 'Phutil'.$language.'CodeSnippetContextFreeGrammar'; return newv($cfg_class, array())->generate(); } } diff --git a/src/applications/paste/view/PasteEmbedView.php b/src/applications/paste/view/PasteEmbedView.php index fa3295e2cb..7c429a2792 100644 --- a/src/applications/paste/view/PasteEmbedView.php +++ b/src/applications/paste/view/PasteEmbedView.php @@ -28,7 +28,7 @@ final class PasteEmbedView extends AphrontView { public function render() { if (!$this->paste) { - throw new Exception("Call setPaste() before render()!"); + throw new Exception('Call setPaste() before render()!'); } $lines = phutil_split_lines($this->paste->getContent()); diff --git a/src/applications/people/conduit/ConduitAPI_user_addstatus_Method.php b/src/applications/people/conduit/ConduitAPI_user_addstatus_Method.php index 75b394b2ac..123ccea09d 100644 --- a/src/applications/people/conduit/ConduitAPI_user_addstatus_Method.php +++ b/src/applications/people/conduit/ConduitAPI_user_addstatus_Method.php @@ -8,7 +8,7 @@ final class ConduitAPI_user_addstatus_Method } public function getMethodDescription() { - return pht("Add status information to the logged-in user."); + return pht('Add status information to the logged-in user.'); } public function getMethodStatusDescription() { diff --git a/src/applications/people/conduit/ConduitAPI_user_disable_Method.php b/src/applications/people/conduit/ConduitAPI_user_disable_Method.php index 6de78dcbac..cca8ae00c6 100644 --- a/src/applications/people/conduit/ConduitAPI_user_disable_Method.php +++ b/src/applications/people/conduit/ConduitAPI_user_disable_Method.php @@ -7,7 +7,7 @@ final class ConduitAPI_user_disable_Method extends ConduitAPI_user_Method { public function getMethodDescription() { - return "Permanently disable specified users (admin only)."; + return 'Permanently disable specified users (admin only).'; } public function defineParamTypes() { diff --git a/src/applications/people/conduit/ConduitAPI_user_enable_Method.php b/src/applications/people/conduit/ConduitAPI_user_enable_Method.php index 0c601cb0fe..ad0b8b8144 100644 --- a/src/applications/people/conduit/ConduitAPI_user_enable_Method.php +++ b/src/applications/people/conduit/ConduitAPI_user_enable_Method.php @@ -7,7 +7,7 @@ final class ConduitAPI_user_enable_Method extends ConduitAPI_user_Method { public function getMethodDescription() { - return "Re-enable specified users (admin only)."; + return 'Re-enable specified users (admin only).'; } public function defineParamTypes() { diff --git a/src/applications/people/conduit/ConduitAPI_user_info_Method.php b/src/applications/people/conduit/ConduitAPI_user_info_Method.php index 9397162b1d..a514ab7478 100644 --- a/src/applications/people/conduit/ConduitAPI_user_info_Method.php +++ b/src/applications/people/conduit/ConduitAPI_user_info_Method.php @@ -15,7 +15,7 @@ final class ConduitAPI_user_info_Method } public function getMethodDescription() { - return "Retrieve information about a user by PHID."; + return 'Retrieve information about a user by PHID.'; } public function defineParamTypes() { diff --git a/src/applications/people/conduit/ConduitAPI_user_query_Method.php b/src/applications/people/conduit/ConduitAPI_user_query_Method.php index 8906106946..1464dd0f82 100644 --- a/src/applications/people/conduit/ConduitAPI_user_query_Method.php +++ b/src/applications/people/conduit/ConduitAPI_user_query_Method.php @@ -7,7 +7,7 @@ final class ConduitAPI_user_query_Method extends ConduitAPI_user_Method { public function getMethodDescription() { - return "Query users."; + return 'Query users.'; } public function defineParamTypes() { diff --git a/src/applications/people/conduit/ConduitAPI_user_removestatus_Method.php b/src/applications/people/conduit/ConduitAPI_user_removestatus_Method.php index 6a5fa664b3..6d741d6a3e 100644 --- a/src/applications/people/conduit/ConduitAPI_user_removestatus_Method.php +++ b/src/applications/people/conduit/ConduitAPI_user_removestatus_Method.php @@ -7,7 +7,7 @@ final class ConduitAPI_user_removestatus_Method extends ConduitAPI_user_Method { } public function getMethodDescription() { - return pht("Delete status information of the logged-in user."); + return pht('Delete status information of the logged-in user.'); } public function getMethodStatusDescription() { diff --git a/src/applications/people/conduit/ConduitAPI_user_whoami_Method.php b/src/applications/people/conduit/ConduitAPI_user_whoami_Method.php index dba0dbecb0..aaf0429705 100644 --- a/src/applications/people/conduit/ConduitAPI_user_whoami_Method.php +++ b/src/applications/people/conduit/ConduitAPI_user_whoami_Method.php @@ -7,7 +7,7 @@ final class ConduitAPI_user_whoami_Method extends ConduitAPI_user_Method { public function getMethodDescription() { - return "Retrieve information about the logged-in user."; + return 'Retrieve information about the logged-in user.'; } public function defineParamTypes() { diff --git a/src/applications/people/config/PhabricatorUserConfigOptions.php b/src/applications/people/config/PhabricatorUserConfigOptions.php index 5c83312fcc..e0c8cc4e86 100644 --- a/src/applications/people/config/PhabricatorUserConfigOptions.php +++ b/src/applications/people/config/PhabricatorUserConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorUserConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("User Profiles"); + return pht('User Profiles'); } public function getDescription() { - return pht("User profiles configuration."); + return pht('User profiles configuration.'); } public function getOptions() { @@ -33,11 +33,11 @@ final class PhabricatorUserConfigOptions return array( $this->newOption('user.fields', $custom_field_type, $default) ->setCustomData(id(new PhabricatorUser())->getCustomFieldBaseClass()) - ->setDescription(pht("Select and reorder user profile fields.")), + ->setDescription(pht('Select and reorder user profile fields.')), $this->newOption('user.custom-field-definitions', 'map', array()) - ->setDescription(pht("Add new simple fields to user profiles.")), + ->setDescription(pht('Add new simple fields to user profiles.')), $this->newOption('user.require-real-name', 'bool', true) - ->setDescription(pht("Always require real name for user profiles.")) + ->setDescription(pht('Always require real name for user profiles.')) ->setBoolOptions( array( pht('Make real names required'), diff --git a/src/applications/people/controller/PhabricatorPeopleLdapController.php b/src/applications/people/controller/PhabricatorPeopleLdapController.php index 280971bf06..48ba2f36da 100644 --- a/src/applications/people/controller/PhabricatorPeopleLdapController.php +++ b/src/applications/people/controller/PhabricatorPeopleLdapController.php @@ -73,13 +73,13 @@ final class PhabricatorPeopleLdapController $notice_view = new AphrontErrorView(); $notice_view->setSeverity(AphrontErrorView::SEVERITY_NOTICE); - $notice_view->setTitle(pht("Import Successful")); + $notice_view->setTitle(pht('Import Successful')); $notice_view->setErrors(array( - pht("Successfully imported users from LDAP"), + pht('Successfully imported users from LDAP'), )); $list = new PHUIObjectItemListView(); - $list->setNoDataString(pht("No users imported?")); + $list->setNoDataString(pht('No users imported?')); foreach ($usernames as $username) { $user = new PhabricatorUser(); @@ -133,7 +133,7 @@ final class PhabricatorPeopleLdapController $ldap_provider = PhabricatorAuthProviderLDAP::getLDAPProvider(); if (!$ldap_provider) { - throw new Exception("No LDAP provider enabled!"); + throw new Exception('No LDAP provider enabled!'); } $ldap_adapter = $ldap_provider->getAdapter(); diff --git a/src/applications/people/controller/PhabricatorPeopleNewController.php b/src/applications/people/controller/PhabricatorPeopleNewController.php index 5769c3aca7..489ccda730 100644 --- a/src/applications/people/controller/PhabricatorPeopleNewController.php +++ b/src/applications/people/controller/PhabricatorPeopleNewController.php @@ -56,7 +56,7 @@ final class PhabricatorPeopleNewController $user->setRealName($request->getStr('realname')); if (!strlen($user->getUsername())) { - $errors[] = pht("Username is required."); + $errors[] = pht('Username is required.'); $e_username = pht('Required'); } else if (!PhabricatorUser::validateUsername($user->getUsername())) { $errors[] = PhabricatorUser::describeValidUsername(); diff --git a/src/applications/people/editor/PhabricatorUserEditor.php b/src/applications/people/editor/PhabricatorUserEditor.php index 21724b6e08..4f2c5ed8a7 100644 --- a/src/applications/people/editor/PhabricatorUserEditor.php +++ b/src/applications/people/editor/PhabricatorUserEditor.php @@ -26,11 +26,11 @@ final class PhabricatorUserEditor extends PhabricatorEditor { PhabricatorUserEmail $email) { if ($user->getID()) { - throw new Exception("User has already been created!"); + throw new Exception('User has already been created!'); } if ($email->getID()) { - throw new Exception("Email has already been created!"); + throw new Exception('Email has already been created!'); } if (!PhabricatorUser::validateUsername($user->getUsername())) { @@ -84,7 +84,7 @@ final class PhabricatorUserEditor extends PhabricatorEditor { PhabricatorUser $user, PhabricatorUserEmail $email = null) { if (!$user->getID()) { - throw new Exception("User has not been created yet!"); + throw new Exception('User has not been created yet!'); } $user->openTransaction(); @@ -113,7 +113,7 @@ final class PhabricatorUserEditor extends PhabricatorEditor { PhutilOpaqueEnvelope $envelope) { if (!$user->getID()) { - throw new Exception("User has not been created yet!"); + throw new Exception('User has not been created yet!'); } $user->openTransaction(); @@ -139,7 +139,7 @@ final class PhabricatorUserEditor extends PhabricatorEditor { $actor = $this->requireActor(); if (!$user->getID()) { - throw new Exception("User has not been created yet!"); + throw new Exception('User has not been created yet!'); } if (!PhabricatorUser::validateUsername($username)) { @@ -185,7 +185,7 @@ final class PhabricatorUserEditor extends PhabricatorEditor { $actor = $this->requireActor(); if (!$user->getID()) { - throw new Exception("User has not been created yet!"); + throw new Exception('User has not been created yet!'); } $user->openTransaction(); @@ -223,7 +223,7 @@ final class PhabricatorUserEditor extends PhabricatorEditor { $actor = $this->requireActor(); if (!$user->getID()) { - throw new Exception("User has not been created yet!"); + throw new Exception('User has not been created yet!'); } $user->openTransaction(); @@ -262,7 +262,7 @@ final class PhabricatorUserEditor extends PhabricatorEditor { $actor = $this->requireActor(); if (!$user->getID()) { - throw new Exception("User has not been created yet!"); + throw new Exception('User has not been created yet!'); } $user->openTransaction(); @@ -301,7 +301,7 @@ final class PhabricatorUserEditor extends PhabricatorEditor { $actor = $this->requireActor(); if (!$user->getID()) { - throw new Exception("User has not been created yet!"); + throw new Exception('User has not been created yet!'); } $user->openTransaction(); @@ -346,10 +346,10 @@ final class PhabricatorUserEditor extends PhabricatorEditor { $actor = $this->requireActor(); if (!$user->getID()) { - throw new Exception("User has not been created yet!"); + throw new Exception('User has not been created yet!'); } if ($email->getID()) { - throw new Exception("Email has already been created!"); + throw new Exception('Email has already been created!'); } // Use changePrimaryEmail() to change primary email. @@ -396,10 +396,10 @@ final class PhabricatorUserEditor extends PhabricatorEditor { $actor = $this->requireActor(); if (!$user->getID()) { - throw new Exception("User has not been created yet!"); + throw new Exception('User has not been created yet!'); } if (!$email->getID()) { - throw new Exception("Email has not been created yet!"); + throw new Exception('Email has not been created yet!'); } $user->openTransaction(); @@ -412,7 +412,7 @@ final class PhabricatorUserEditor extends PhabricatorEditor { throw new Exception("Can't remove primary email!"); } if ($email->getUserPHID() != $user->getPHID()) { - throw new Exception("Email not owned by user!"); + throw new Exception('Email not owned by user!'); } $email->delete(); @@ -440,10 +440,10 @@ final class PhabricatorUserEditor extends PhabricatorEditor { $actor = $this->requireActor(); if (!$user->getID()) { - throw new Exception("User has not been created yet!"); + throw new Exception('User has not been created yet!'); } if (!$email->getID()) { - throw new Exception("Email has not been created yet!"); + throw new Exception('Email has not been created yet!'); } $user->openTransaction(); @@ -453,15 +453,15 @@ final class PhabricatorUserEditor extends PhabricatorEditor { $email->reload(); if ($email->getUserPHID() != $user->getPHID()) { - throw new Exception("User does not own email!"); + throw new Exception('User does not own email!'); } if ($email->getIsPrimary()) { - throw new Exception("Email is already primary!"); + throw new Exception('Email is already primary!'); } if (!$email->getIsVerified()) { - throw new Exception("Email is not verified!"); + throw new Exception('Email is not verified!'); } $old_primary = $user->loadPrimaryEmail(); diff --git a/src/applications/people/lipsum/PhabricatorPeopleTestDataGenerator.php b/src/applications/people/lipsum/PhabricatorPeopleTestDataGenerator.php index 03faf81ac3..410d46ae12 100644 --- a/src/applications/people/lipsum/PhabricatorPeopleTestDataGenerator.php +++ b/src/applications/people/lipsum/PhabricatorPeopleTestDataGenerator.php @@ -40,9 +40,9 @@ final class PhabricatorPeopleTestDataGenerator $name = strtolower($random_real_name); $name = preg_replace('/[^a-z]/s' , ' ', $name); $name = preg_replace('/\s+/', ' ', $name); - $words = explode(" ", $name); + $words = explode(' ', $name); $random = rand(0, 4); - $reduced = ""; + $reduced = ''; if ($random == 0) { foreach ($words as $w) { if ($w == end($words)) { @@ -52,7 +52,7 @@ final class PhabricatorPeopleTestDataGenerator $reduced .= $w[0]; } } - } elseif ($random == 1) { + } else if ($random == 1) { foreach ($words as $w) { if ($w == $words[0]) { $reduced .= $w; @@ -61,7 +61,7 @@ final class PhabricatorPeopleTestDataGenerator $reduced .= $w[0]; } } - } elseif ($random == 2) { + } else if ($random == 2) { foreach ($words as $w) { if ($w == $words[0] || $w == end($words)) { $reduced .= $w; @@ -70,22 +70,22 @@ final class PhabricatorPeopleTestDataGenerator $reduced .= $w[0]; } } - } elseif ($random == 3) { + } else if ($random == 3) { foreach ($words as $w) { if ($w == $words[0] || $w == end($words)) { $reduced .= $w; } else { - $reduced .= $w[0]."."; + $reduced .= $w[0].'.'; } } - } elseif ($random == 4) { + } else if ($random == 4) { foreach ($words as $w) { if ($w == $words[0] || $w == end($words)) { $reduced .= $w; } else { - $reduced .= $w[0]."_"; + $reduced .= $w[0].'_'; } } } @@ -98,8 +98,8 @@ final class PhabricatorPeopleTestDataGenerator } protected function generateEmail($username) { - $default_email_domain = "example.com"; - $email = $username."@".$default_email_domain; + $default_email_domain = 'example.com'; + $email = $username.'@'.$default_email_domain; return $email; } } diff --git a/src/applications/people/storage/PhabricatorUser.php b/src/applications/people/storage/PhabricatorUser.php index 94b59fed75..38c9b421a8 100644 --- a/src/applications/people/storage/PhabricatorUser.php +++ b/src/applications/people/storage/PhabricatorUser.php @@ -125,8 +125,8 @@ final class PhabricatorUser public function setPassword(PhutilOpaqueEnvelope $envelope) { if (!$this->getPHID()) { throw new Exception( - "You can not set a password for an unsaved user because their PHID ". - "is a salt component in the password hash."); + 'You can not set a password for an unsaved user because their PHID '. + 'is a salt component in the password hash.'); } if (!strlen($envelope->openEnvelope())) { @@ -326,7 +326,7 @@ final class PhabricatorUser } break; default: - throw new Exception("Unknown CSRF token format!"); + throw new Exception('Unknown CSRF token format!'); } } @@ -371,7 +371,7 @@ final class PhabricatorUser public function loadPrimaryEmailAddress() { $email = $this->loadPrimaryEmail(); if (!$email) { - throw new Exception("User has no primary email address!"); + throw new Exception('User has no primary email address!'); } return $email->getAddress(); } diff --git a/src/applications/phame/conduit/ConduitAPI_phame_query_Method.php b/src/applications/phame/conduit/ConduitAPI_phame_query_Method.php index 9f84ec0ded..2cf9d18bac 100644 --- a/src/applications/phame/conduit/ConduitAPI_phame_query_Method.php +++ b/src/applications/phame/conduit/ConduitAPI_phame_query_Method.php @@ -6,7 +6,7 @@ final class ConduitAPI_phame_query_Method extends ConduitAPI_phame_Method { public function getMethodDescription() { - return "Query phame blogs."; + return 'Query phame blogs.'; } public function getMethodStatus() { diff --git a/src/applications/phame/conduit/ConduitAPI_phame_queryposts_Method.php b/src/applications/phame/conduit/ConduitAPI_phame_queryposts_Method.php index 2c6d8cc683..3df67eb188 100644 --- a/src/applications/phame/conduit/ConduitAPI_phame_queryposts_Method.php +++ b/src/applications/phame/conduit/ConduitAPI_phame_queryposts_Method.php @@ -6,7 +6,7 @@ final class ConduitAPI_phame_queryposts_Method extends ConduitAPI_phame_Method { public function getMethodDescription() { - return "Query phame posts."; + return 'Query phame posts.'; } public function getMethodStatus() { diff --git a/src/applications/phame/config/PhabricatorPhameConfigOptions.php b/src/applications/phame/config/PhabricatorPhameConfigOptions.php index 1ec6f2aeae..dd5a7a3da4 100644 --- a/src/applications/phame/config/PhabricatorPhameConfigOptions.php +++ b/src/applications/phame/config/PhabricatorPhameConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorPhameConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Phame"); + return pht('Phame'); } public function getDescription() { - return pht("Configure Phame blogs."); + return pht('Configure Phame blogs.'); } public function getOptions() { diff --git a/src/applications/phame/skins/PhameSkinSpecification.php b/src/applications/phame/skins/PhameSkinSpecification.php index 326200dc98..5acd9e57b2 100644 --- a/src/applications/phame/skins/PhameSkinSpecification.php +++ b/src/applications/phame/skins/PhameSkinSpecification.php @@ -105,7 +105,7 @@ final class PhameSkinSpecification { $spec->addPhutilLibrary($path.DIRECTORY_SEPARATOR.'src'); break; default: - throw new Exception("Unknown skin type!"); + throw new Exception('Unknown skin type!'); } $spec->setType($type); diff --git a/src/applications/phame/storage/PhameBlog.php b/src/applications/phame/storage/PhameBlog.php index d3fb89ef51..3d752fc721 100644 --- a/src/applications/phame/storage/PhameBlog.php +++ b/src/applications/phame/storage/PhameBlog.php @@ -46,8 +46,8 @@ final class PhameBlog extends PhameDAO if (!$spec) { throw new Exception( - "This blog has an invalid skin, and the default skin failed to ". - "load."); + 'This blog has an invalid skin, and the default skin failed to '. + 'load.'); } $skin = newv($spec->getSkinClass(), array($request)); diff --git a/src/applications/phid/conduit/ConduitAPI_phid_info_Method.php b/src/applications/phid/conduit/ConduitAPI_phid_info_Method.php index df68c1845f..01910c503f 100644 --- a/src/applications/phid/conduit/ConduitAPI_phid_info_Method.php +++ b/src/applications/phid/conduit/ConduitAPI_phid_info_Method.php @@ -15,7 +15,7 @@ final class ConduitAPI_phid_info_Method } public function getMethodDescription() { - return "Retrieve information about an arbitrary PHID."; + return 'Retrieve information about an arbitrary PHID.'; } public function defineParamTypes() { diff --git a/src/applications/phid/conduit/ConduitAPI_phid_lookup_Method.php b/src/applications/phid/conduit/ConduitAPI_phid_lookup_Method.php index 6a1e03b2fc..9e09fc1534 100644 --- a/src/applications/phid/conduit/ConduitAPI_phid_lookup_Method.php +++ b/src/applications/phid/conduit/ConduitAPI_phid_lookup_Method.php @@ -7,7 +7,7 @@ final class ConduitAPI_phid_lookup_Method extends ConduitAPI_phid_Method { public function getMethodDescription() { - return "Look up objects by name."; + return 'Look up objects by name.'; } public function defineParamTypes() { diff --git a/src/applications/phid/conduit/ConduitAPI_phid_query_Method.php b/src/applications/phid/conduit/ConduitAPI_phid_query_Method.php index f5a8404626..4dd6e3f4ec 100644 --- a/src/applications/phid/conduit/ConduitAPI_phid_query_Method.php +++ b/src/applications/phid/conduit/ConduitAPI_phid_query_Method.php @@ -7,7 +7,7 @@ final class ConduitAPI_phid_query_Method extends ConduitAPI_phid_Method { public function getMethodDescription() { - return "Retrieve information about arbitrary PHIDs."; + return 'Retrieve information about arbitrary PHIDs.'; } public function defineParamTypes() { diff --git a/src/applications/phid/query/PhabricatorObjectQuery.php b/src/applications/phid/query/PhabricatorObjectQuery.php index a786d4f72d..8709cca7c7 100644 --- a/src/applications/phid/query/PhabricatorObjectQuery.php +++ b/src/applications/phid/query/PhabricatorObjectQuery.php @@ -78,7 +78,7 @@ final class PhabricatorObjectQuery public function getNamedResults() { if ($this->namedResults === null) { - throw new Exception("Call execute() before getNamedResults()!"); + throw new Exception('Call execute() before getNamedResults()!'); } return $this->namedResults; } diff --git a/src/applications/phid/query/__tests__/PhabricatorObjectListQueryTestCase.php b/src/applications/phid/query/__tests__/PhabricatorObjectListQueryTestCase.php index 419e47672c..e7347d5dbc 100644 --- a/src/applications/phid/query/__tests__/PhabricatorObjectListQueryTestCase.php +++ b/src/applications/phid/query/__tests__/PhabricatorObjectListQueryTestCase.php @@ -26,13 +26,13 @@ final class PhabricatorObjectListQueryTestCase extends PhabricatorTestCase { $result = $this->parseObjectList("@{$name}, {$name}"); $this->assertEqual(array($phid), $result); - $result = $this->parseObjectList(""); + $result = $this->parseObjectList(''); $this->assertEqual(array(), $result); // Expect failure when loading a user if objects must be of type "DUCK". $caught = null; try { - $result = $this->parseObjectList("{$name}", array("DUCK")); + $result = $this->parseObjectList("{$name}", array('DUCK')); } catch (Exception $ex) { $caught = $ex; } @@ -42,7 +42,7 @@ final class PhabricatorObjectListQueryTestCase extends PhabricatorTestCase { // Expect failure when loading an invalid object. $caught = null; try { - $result = $this->parseObjectList("invalid"); + $result = $this->parseObjectList('invalid'); } catch (Exception $ex) { $caught = $ex; } diff --git a/src/applications/phid/storage/PhabricatorPHID.php b/src/applications/phid/storage/PhabricatorPHID.php index 9c9018645b..43896045b9 100644 --- a/src/applications/phid/storage/PhabricatorPHID.php +++ b/src/applications/phid/storage/PhabricatorPHID.php @@ -9,7 +9,7 @@ final class PhabricatorPHID { public static function generateNewPHID($type, $subtype = null) { if (!$type) { - throw new Exception("Can not generate PHID with no type."); + throw new Exception('Can not generate PHID with no type.'); } if ($subtype === null) { diff --git a/src/applications/phid/type/PhabricatorPHIDType.php b/src/applications/phid/type/PhabricatorPHIDType.php index cbb7d0237a..e1d1647eb2 100644 --- a/src/applications/phid/type/PhabricatorPHIDType.php +++ b/src/applications/phid/type/PhabricatorPHIDType.php @@ -114,7 +114,7 @@ abstract class PhabricatorPHIDType { public function loadNamedObjects( PhabricatorObjectQuery $query, array $names) { - throw new Exception("Not implemented!"); + throw new Exception('Not implemented!'); } diff --git a/src/applications/pholio/config/PhabricatorPholioConfigOptions.php b/src/applications/pholio/config/PhabricatorPholioConfigOptions.php index 708f623874..1f31095c70 100644 --- a/src/applications/pholio/config/PhabricatorPholioConfigOptions.php +++ b/src/applications/pholio/config/PhabricatorPholioConfigOptions.php @@ -7,11 +7,11 @@ final class PhabricatorPholioConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Pholio"); + return pht('Pholio'); } public function getDescription() { - return pht("Configure Pholio."); + return pht('Configure Pholio.'); } public function getOptions() { diff --git a/src/applications/pholio/controller/PholioInlineSaveController.php b/src/applications/pholio/controller/PholioInlineSaveController.php index 300e39be70..d08ba69754 100644 --- a/src/applications/pholio/controller/PholioInlineSaveController.php +++ b/src/applications/pholio/controller/PholioInlineSaveController.php @@ -30,7 +30,7 @@ final class PholioInlineSaveController extends PholioController { $new_content = $request->getStr('text'); if (!strlen($new_content)) { - throw new Exception("Content must not be empty."); + throw new Exception('Content must not be empty.'); } $draft = id(new PholioTransactionComment()); diff --git a/src/applications/pholio/lipsum/PhabricatorPholioMockTestDataGenerator.php b/src/applications/pholio/lipsum/PhabricatorPholioMockTestDataGenerator.php index 0f0299d280..655ec5d956 100644 --- a/src/applications/pholio/lipsum/PhabricatorPholioMockTestDataGenerator.php +++ b/src/applications/pholio/lipsum/PhabricatorPholioMockTestDataGenerator.php @@ -88,8 +88,8 @@ final class PhabricatorPholioMockTestDataGenerator } public function generateImages() { - $images = newv("PhabricatorFile", array()) - ->loadAllWhere("mimeType = %s", "image/jpeg"); + $images = newv('PhabricatorFile', array()) + ->loadAllWhere('mimeType = %s', 'image/jpeg'); $rand_images = array(); $quantity = rand(2, 10); $quantity = min($quantity, count($images)); diff --git a/src/applications/pholio/mail/PholioReplyHandler.php b/src/applications/pholio/mail/PholioReplyHandler.php index 46efa2dc90..c3743a8ee9 100644 --- a/src/applications/pholio/mail/PholioReplyHandler.php +++ b/src/applications/pholio/mail/PholioReplyHandler.php @@ -7,7 +7,7 @@ final class PholioReplyHandler extends PhabricatorMailReplyHandler { public function validateMailReceiver($mail_receiver) { if (!($mail_receiver instanceof PholioMock)) { - throw new Exception("Mail receiver is not a PholioMock!"); + throw new Exception('Mail receiver is not a PholioMock!'); } } @@ -29,7 +29,7 @@ final class PholioReplyHandler extends PhabricatorMailReplyHandler { if ($this->supportsReplies()) { // TODO: Implement. return null; - return pht("Reply to comment."); + return pht('Reply to comment.'); } else { return null; } diff --git a/src/applications/pholio/view/PholioInlineCommentEditView.php b/src/applications/pholio/view/PholioInlineCommentEditView.php index d36c788019..f4a1242ba8 100644 --- a/src/applications/pholio/view/PholioInlineCommentEditView.php +++ b/src/applications/pholio/view/PholioInlineCommentEditView.php @@ -33,10 +33,10 @@ final class PholioInlineCommentEditView extends AphrontView { public function render() { if (!$this->uri) { - throw new Exception("Call setSubmitURI() before render()!"); + throw new Exception('Call setSubmitURI() before render()!'); } if (!$this->user) { - throw new Exception("Call setUser() before render()!"); + throw new Exception('Call setUser() before render()!'); } $content = phabricator_form( diff --git a/src/applications/pholio/view/PholioInlineCommentSaveView.php b/src/applications/pholio/view/PholioInlineCommentSaveView.php index 6f79c81f42..5d271c451d 100644 --- a/src/applications/pholio/view/PholioInlineCommentSaveView.php +++ b/src/applications/pholio/view/PholioInlineCommentSaveView.php @@ -26,10 +26,10 @@ final class PholioInlineCommentSaveView extends AphrontView { public function render() { if (!$this->uri) { - throw new Exception("Call setSubmitURI() before render()!"); + throw new Exception('Call setSubmitURI() before render()!'); } if (!$this->user) { - throw new Exception("Call setUser() before render()!"); + throw new Exception('Call setUser() before render()!'); } $content = phabricator_form( diff --git a/src/applications/pholio/view/PholioInlineCommentView.php b/src/applications/pholio/view/PholioInlineCommentView.php index d59c6e847c..4e2310e9e6 100644 --- a/src/applications/pholio/view/PholioInlineCommentView.php +++ b/src/applications/pholio/view/PholioInlineCommentView.php @@ -21,7 +21,7 @@ final class PholioInlineCommentView extends AphrontView { public function setInlineComment(PholioTransactionComment $inline_comment) { if ($inline_comment->getImageID() === null) { - throw new Exception("Comment provided is not inline comment"); + throw new Exception('Comment provided is not inline comment'); } $this->inlineComment = $inline_comment; @@ -30,16 +30,16 @@ final class PholioInlineCommentView extends AphrontView { public function render() { if (!$this->inlineComment) { - throw new Exception("Call setInlineComment() before render()!"); + throw new Exception('Call setInlineComment() before render()!'); } if ($this->user === null) { - throw new Exception("Call setUser() before render()!"); + throw new Exception('Call setUser() before render()!'); } if ($this->engine === null) { - throw new Exception("Call setEngine() before render()!"); + throw new Exception('Call setEngine() before render()!'); } if ($this->handle === null) { - throw new Exception("Call setHandle() before render()!"); + throw new Exception('Call setHandle() before render()!'); } $actions = null; diff --git a/src/applications/pholio/view/PholioMockEmbedView.php b/src/applications/pholio/view/PholioMockEmbedView.php index cdabc1272e..d932dd6482 100644 --- a/src/applications/pholio/view/PholioMockEmbedView.php +++ b/src/applications/pholio/view/PholioMockEmbedView.php @@ -20,7 +20,7 @@ final class PholioMockEmbedView extends AphrontView { public function render() { if (!$this->mock) { - throw new Exception("Call setMock() before render()!"); + throw new Exception('Call setMock() before render()!'); } require_celerity_resource('pholio-css'); diff --git a/src/applications/pholio/view/PholioMockImagesView.php b/src/applications/pholio/view/PholioMockImagesView.php index 0622d0a2a6..6583f6806b 100644 --- a/src/applications/pholio/view/PholioMockImagesView.php +++ b/src/applications/pholio/view/PholioMockImagesView.php @@ -56,7 +56,7 @@ final class PholioMockImagesView extends AphrontView { public function render() { if (!$this->mock) { - throw new Exception("Call setMock() before render()!"); + throw new Exception('Call setMock() before render()!'); } $mock = $this->mock; diff --git a/src/applications/pholio/view/PholioTransactionView.php b/src/applications/pholio/view/PholioTransactionView.php index 5ba716f638..f4428262ea 100644 --- a/src/applications/pholio/view/PholioTransactionView.php +++ b/src/applications/pholio/view/PholioTransactionView.php @@ -59,7 +59,7 @@ final class PholioTransactionView $inlines[] = $xaction; break; default: - throw new Exception("Unknown grouped transaction type!"); + throw new Exception('Unknown grouped transaction type!'); } } diff --git a/src/applications/phortune/controller/PhortuneAccountBuyController.php b/src/applications/phortune/controller/PhortuneAccountBuyController.php index de0c6ae859..ed399a5f0a 100644 --- a/src/applications/phortune/controller/PhortuneAccountBuyController.php +++ b/src/applications/phortune/controller/PhortuneAccountBuyController.php @@ -144,7 +144,7 @@ final class PhortuneAccountBuyController $form ->appendChild( id(new AphrontFormSubmitControl()) - ->setValue(pht("Submit Payment")) + ->setValue(pht('Submit Payment')) ->setDisabled(!$methods)); } diff --git a/src/applications/phortune/controller/PhortuneController.php b/src/applications/phortune/controller/PhortuneController.php index 93bb99a1fe..66ba0e6549 100644 --- a/src/applications/phortune/controller/PhortuneController.php +++ b/src/applications/phortune/controller/PhortuneController.php @@ -13,7 +13,7 @@ abstract class PhortuneController extends PhabricatorController { } else if (count($accounts) == 1) { return head($accounts); } else { - throw new Exception("TODO: No account selection yet."); + throw new Exception('TODO: No account selection yet.'); } } diff --git a/src/applications/phortune/controller/PhortunePaymentMethodEditController.php b/src/applications/phortune/controller/PhortunePaymentMethodEditController.php index 4a82a219c5..8eeced43b4 100644 --- a/src/applications/phortune/controller/PhortunePaymentMethodEditController.php +++ b/src/applications/phortune/controller/PhortunePaymentMethodEditController.php @@ -27,8 +27,8 @@ final class PhortunePaymentMethodEditController $providers = PhortunePaymentProvider::getProvidersForAddPaymentMethod(); if (!$providers) { throw new Exception( - "There are no payment providers enabled that can add payment ". - "methods."); + 'There are no payment providers enabled that can add payment '. + 'methods.'); } $provider_key = $request->getStr('providerKey'); diff --git a/src/applications/phortune/controller/PhortuneProviderController.php b/src/applications/phortune/controller/PhortuneProviderController.php index b59a6831c4..483551f780 100644 --- a/src/applications/phortune/controller/PhortuneProviderController.php +++ b/src/applications/phortune/controller/PhortuneProviderController.php @@ -31,7 +31,7 @@ final class PhortuneProviderController extends PhortuneController { $provider = PhortunePaymentProvider::getProviderByDigest($this->digest); if (!$provider) { - throw new Exception("Invalid payment provider digest!"); + throw new Exception('Invalid payment provider digest!'); } if (!$provider->canRespondToControllerAction($this->getAction())) { diff --git a/src/applications/phortune/currency/PhortuneCurrency.php b/src/applications/phortune/currency/PhortuneCurrency.php index 68bc3d0be1..978bc282f7 100644 --- a/src/applications/phortune/currency/PhortuneCurrency.php +++ b/src/applications/phortune/currency/PhortuneCurrency.php @@ -54,7 +54,7 @@ final class PhortuneCurrency { public static function newFromUSDCents($cents) { if (!is_int($cents)) { - throw new Exception("USDCents value is not an integer!"); + throw new Exception('USDCents value is not an integer!'); } $obj = new PhortuneCurrency(); @@ -75,7 +75,7 @@ final class PhortuneCurrency { case 'USD': return sprintf('%.02f', $this->value / 100); default: - throw new Exception("Unsupported currency!"); + throw new Exception('Unsupported currency!'); } } diff --git a/src/applications/phortune/option/PhabricatorPhortuneConfigOptions.php b/src/applications/phortune/option/PhabricatorPhortuneConfigOptions.php index 02bc1d468b..6f9c4df6c4 100644 --- a/src/applications/phortune/option/PhabricatorPhortuneConfigOptions.php +++ b/src/applications/phortune/option/PhabricatorPhortuneConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorPhortuneConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Phortune"); + return pht('Phortune'); } public function getDescription() { - return pht("Configure payments and billing."); + return pht('Configure payments and billing.'); } public function getOptions() { diff --git a/src/applications/phortune/provider/PhortunePaypalPaymentProvider.php b/src/applications/phortune/provider/PhortunePaypalPaymentProvider.php index a56cc5112f..55c9b82b97 100644 --- a/src/applications/phortune/provider/PhortunePaypalPaymentProvider.php +++ b/src/applications/phortune/provider/PhortunePaypalPaymentProvider.php @@ -25,7 +25,7 @@ final class PhortunePaypalPaymentProvider extends PhortunePaymentProvider { } public function getPaymentMethodProviderDescription() { - return "Paypal"; + return 'Paypal'; } @@ -37,7 +37,7 @@ final class PhortunePaypalPaymentProvider extends PhortunePaymentProvider { protected function executeCharge( PhortunePaymentMethod $payment_method, PhortuneCharge $charge) { - throw new Exception("!"); + throw new Exception('!'); } private function getPaypalAPIUsername() { diff --git a/src/applications/phortune/provider/PhortuneStripePaymentProvider.php b/src/applications/phortune/provider/PhortuneStripePaymentProvider.php index eee9e11b8a..f7042c1927 100644 --- a/src/applications/phortune/provider/PhortuneStripePaymentProvider.php +++ b/src/applications/phortune/provider/PhortuneStripePaymentProvider.php @@ -52,7 +52,7 @@ final class PhortuneStripePaymentProvider extends PhortunePaymentProvider { $stripe_charge = Stripe_Charge::create($params, $secret_key); $id = $stripe_charge->id; if (!$id) { - throw new Exception("Stripe charge call did not return an ID!"); + throw new Exception('Stripe charge call did not return an ID!'); } $charge->setMetadataValue('stripe.chargeID', $id); diff --git a/src/applications/phortune/provider/PhortuneWePayPaymentProvider.php b/src/applications/phortune/provider/PhortuneWePayPaymentProvider.php index 927feeba52..b496cf91ce 100644 --- a/src/applications/phortune/provider/PhortuneWePayPaymentProvider.php +++ b/src/applications/phortune/provider/PhortuneWePayPaymentProvider.php @@ -26,7 +26,7 @@ final class PhortuneWePayPaymentProvider extends PhortunePaymentProvider { } public function getPaymentMethodProviderDescription() { - return "WePay"; + return 'WePay'; } @@ -38,7 +38,7 @@ final class PhortuneWePayPaymentProvider extends PhortunePaymentProvider { protected function executeCharge( PhortunePaymentMethod $payment_method, PhortuneCharge $charge) { - throw new Exception("!"); + throw new Exception('!'); } private function getWePayClientID() { diff --git a/src/applications/phpast/controller/PhabricatorXHPASTViewPanelController.php b/src/applications/phpast/controller/PhabricatorXHPASTViewPanelController.php index 0e43c418f1..53a93b1382 100644 --- a/src/applications/phpast/controller/PhabricatorXHPASTViewPanelController.php +++ b/src/applications/phpast/controller/PhabricatorXHPASTViewPanelController.php @@ -11,7 +11,7 @@ abstract class PhabricatorXHPASTViewPanelController $this->storageTree = id(new PhabricatorXHPASTViewParseTree()) ->load($this->id); if (!$this->storageTree) { - throw new Exception("No such AST!"); + throw new Exception('No such AST!'); } } diff --git a/src/applications/phragment/conduit/ConduitAPI_phragment_getpatch_Method.php b/src/applications/phragment/conduit/ConduitAPI_phragment_getpatch_Method.php index 495a92c14e..b7563d6c87 100644 --- a/src/applications/phragment/conduit/ConduitAPI_phragment_getpatch_Method.php +++ b/src/applications/phragment/conduit/ConduitAPI_phragment_getpatch_Method.php @@ -11,7 +11,7 @@ final class ConduitAPI_phragment_getpatch_Method } public function getMethodDescription() { - return pht("Retrieve the patches to apply for a given set of files."); + return pht('Retrieve the patches to apply for a given set of files.'); } public function defineParamTypes() { @@ -137,8 +137,8 @@ final class ConduitAPI_phragment_getpatch_Method // of files so we can draw diffs on them. $hashes = array(); foreach ($patches as $patch) { - if ($patch["hashOld"] !== PhragmentPatchUtil::EMPTY_HASH) { - $hashes[] = $patch["hashOld"]; + if ($patch['hashOld'] !== PhragmentPatchUtil::EMPTY_HASH) { + $hashes[] = $patch['hashOld']; } } $old_files = array(); @@ -150,7 +150,7 @@ final class ConduitAPI_phragment_getpatch_Method } $old_files = mpull($old_files, null, 'getContentHash'); foreach ($patches as $key => $patch) { - if ($patch["hashOld"] !== PhragmentPatchUtil::EMPTY_HASH) { + if ($patch['hashOld'] !== PhragmentPatchUtil::EMPTY_HASH) { if (array_key_exists($patch['hashOld'], $old_files)) { $patches[$key]['fileOld'] = $old_files[$patch['hashOld']]; } else { diff --git a/src/applications/phragment/conduit/ConduitAPI_phragment_queryfragments_Method.php b/src/applications/phragment/conduit/ConduitAPI_phragment_queryfragments_Method.php index d08c6c42ec..7d5f6cff59 100644 --- a/src/applications/phragment/conduit/ConduitAPI_phragment_queryfragments_Method.php +++ b/src/applications/phragment/conduit/ConduitAPI_phragment_queryfragments_Method.php @@ -11,7 +11,7 @@ final class ConduitAPI_phragment_queryfragments_Method } public function getMethodDescription() { - return pht("Query fragments based on their paths."); + return pht('Query fragments based on their paths.'); } public function defineParamTypes() { diff --git a/src/applications/phragment/controller/PhragmentBrowseController.php b/src/applications/phragment/controller/PhragmentBrowseController.php index f4f5d9ad54..e40a1426a4 100644 --- a/src/applications/phragment/controller/PhragmentBrowseController.php +++ b/src/applications/phragment/controller/PhragmentBrowseController.php @@ -9,7 +9,7 @@ final class PhragmentBrowseController extends PhragmentController { } public function willProcessRequest(array $data) { - $this->dblob = idx($data, "dblob", ""); + $this->dblob = idx($data, 'dblob', ''); } public function processRequest() { diff --git a/src/applications/phragment/controller/PhragmentController.php b/src/applications/phragment/controller/PhragmentController.php index 0b875ea35c..586c28f4ae 100644 --- a/src/applications/phragment/controller/PhragmentController.php +++ b/src/applications/phragment/controller/PhragmentController.php @@ -94,7 +94,7 @@ abstract class PhragmentController extends PhabricatorController { $fragment, PhabricatorPolicyCapability::CAN_EDIT); - $zip_uri = $this->getApplicationURI("zip/".$fragment->getPath()); + $zip_uri = $this->getApplicationURI('zip/'.$fragment->getPath()); $actions = id(new PhabricatorActionListView()) ->setUser($viewer) @@ -116,7 +116,7 @@ abstract class PhragmentController extends PhabricatorController { $actions->addAction( id(new PhabricatorActionView()) ->setName(pht('Update Fragment')) - ->setHref($this->getApplicationURI("update/".$fragment->getPath())) + ->setHref($this->getApplicationURI('update/'.$fragment->getPath())) ->setDisabled(!$can_edit) ->setWorkflow(!$can_edit) ->setIcon('fa-refresh')); @@ -124,7 +124,7 @@ abstract class PhragmentController extends PhabricatorController { $actions->addAction( id(new PhabricatorActionView()) ->setName(pht('Convert to File')) - ->setHref($this->getApplicationURI("update/".$fragment->getPath())) + ->setHref($this->getApplicationURI('update/'.$fragment->getPath())) ->setDisabled(!$can_edit) ->setWorkflow(!$can_edit) ->setIcon('fa-file-o')); @@ -132,7 +132,7 @@ abstract class PhragmentController extends PhabricatorController { $actions->addAction( id(new PhabricatorActionView()) ->setName(pht('Set Fragment Policies')) - ->setHref($this->getApplicationURI("policy/".$fragment->getPath())) + ->setHref($this->getApplicationURI('policy/'.$fragment->getPath())) ->setDisabled(!$can_edit) ->setWorkflow(!$can_edit) ->setIcon('fa-asterisk')); @@ -140,20 +140,20 @@ abstract class PhragmentController extends PhabricatorController { $actions->addAction( id(new PhabricatorActionView()) ->setName(pht('View Child Fragments')) - ->setHref($this->getApplicationURI("browse/".$fragment->getPath())) + ->setHref($this->getApplicationURI('browse/'.$fragment->getPath())) ->setIcon('fa-search-plus')); } else { $actions->addAction( id(new PhabricatorActionView()) ->setName(pht('View History')) - ->setHref($this->getApplicationURI("history/".$fragment->getPath())) + ->setHref($this->getApplicationURI('history/'.$fragment->getPath())) ->setIcon('fa-list')); } $actions->addAction( id(new PhabricatorActionView()) ->setName(pht('Create Snapshot')) ->setHref($this->getApplicationURI( - "snapshot/create/".$fragment->getPath())) + 'snapshot/create/'.$fragment->getPath())) ->setDisabled(!$can_edit) ->setWorkflow(!$can_edit) ->setIcon('fa-files-o')); @@ -161,7 +161,7 @@ abstract class PhragmentController extends PhabricatorController { id(new PhabricatorActionView()) ->setName(pht('Promote Snapshot to Here')) ->setHref($this->getApplicationURI( - "snapshot/promote/latest/".$fragment->getPath())) + 'snapshot/promote/latest/'.$fragment->getPath())) ->setWorkflow(true) ->setDisabled(!$can_edit) ->setIcon('fa-arrow-circle-up')); @@ -202,7 +202,7 @@ abstract class PhragmentController extends PhabricatorController { } function renderConfigurationWarningIfRequired() { - $alt = PhabricatorEnv::getEnvConfig("security.alternate-file-domain"); + $alt = PhabricatorEnv::getEnvConfig('security.alternate-file-domain'); if ($alt === null) { return id(new AphrontErrorView()) ->setTitle(pht('security.alternate-file-domain must be configured!')) @@ -226,7 +226,7 @@ abstract class PhragmentController extends PhabricatorController { * the info page to viewers who are not logged in). */ function isCorrectlyConfigured() { - $alt = PhabricatorEnv::getEnvConfig("security.alternate-file-domain"); + $alt = PhabricatorEnv::getEnvConfig('security.alternate-file-domain'); return $alt !== null; } diff --git a/src/applications/phragment/controller/PhragmentCreateController.php b/src/applications/phragment/controller/PhragmentCreateController.php index 5640913374..e07bb14145 100644 --- a/src/applications/phragment/controller/PhragmentCreateController.php +++ b/src/applications/phragment/controller/PhragmentCreateController.php @@ -5,7 +5,7 @@ final class PhragmentCreateController extends PhragmentController { private $dblob; public function willProcessRequest(array $data) { - $this->dblob = idx($data, "dblob", ""); + $this->dblob = idx($data, 'dblob', ''); } public function processRequest() { diff --git a/src/applications/phragment/controller/PhragmentHistoryController.php b/src/applications/phragment/controller/PhragmentHistoryController.php index 396a2a38bf..205f9eec02 100644 --- a/src/applications/phragment/controller/PhragmentHistoryController.php +++ b/src/applications/phragment/controller/PhragmentHistoryController.php @@ -9,7 +9,7 @@ final class PhragmentHistoryController extends PhragmentController { } public function willProcessRequest(array $data) { - $this->dblob = idx($data, "dblob", ""); + $this->dblob = idx($data, 'dblob', ''); } public function processRequest() { @@ -75,9 +75,9 @@ final class PhragmentHistoryController extends PhragmentController { ->setIcon('fa-refresh') ->setRenderNameAsTooltip(true) ->setWorkflow(true) - ->setName(pht("Revert to Here")) + ->setName(pht('Revert to Here')) ->setHref($this->getApplicationURI( - "revert/".$version->getID()."/".$current->getPath()))); + 'revert/'.$version->getID().'/'.$current->getPath()))); } $disabled = !isset($files[$version->getFilePHID()]); @@ -85,7 +85,7 @@ final class PhragmentHistoryController extends PhragmentController { ->setIcon('fa-download') ->setDisabled($disabled || !$this->isCorrectlyConfigured()) ->setRenderNameAsTooltip(true) - ->setName(pht("Download")); + ->setName(pht('Download')); if (!$disabled && $this->isCorrectlyConfigured()) { $action->setHref($files[$version->getFilePHID()] ->getDownloadURI($version->getURI())); diff --git a/src/applications/phragment/controller/PhragmentPatchController.php b/src/applications/phragment/controller/PhragmentPatchController.php index b3f6b6bfa7..8d7b497f21 100644 --- a/src/applications/phragment/controller/PhragmentPatchController.php +++ b/src/applications/phragment/controller/PhragmentPatchController.php @@ -10,8 +10,8 @@ final class PhragmentPatchController extends PhragmentController { } public function willProcessRequest(array $data) { - $this->aid = idx($data, "aid", 0); - $this->bid = idx($data, "bid", 0); + $this->aid = idx($data, 'aid', 0); + $this->bid = idx($data, 'bid', 0); } public function processRequest() { @@ -22,7 +22,7 @@ final class PhragmentPatchController extends PhragmentController { // a patch of an empty file to the version specified by "bid". $ids = array($this->aid, $this->bid); - if ($this->aid === "x") { + if ($this->aid === 'x') { $ids = array($this->bid); } @@ -32,7 +32,7 @@ final class PhragmentPatchController extends PhragmentController { ->execute(); $version_a = null; - if ($this->aid !== "x") { + if ($this->aid !== 'x') { $version_a = idx($versions, $this->aid, null); if ($version_a === null) { return new Aphront404Response(); diff --git a/src/applications/phragment/controller/PhragmentPolicyController.php b/src/applications/phragment/controller/PhragmentPolicyController.php index b135e23f5d..dc8da7119a 100644 --- a/src/applications/phragment/controller/PhragmentPolicyController.php +++ b/src/applications/phragment/controller/PhragmentPolicyController.php @@ -5,7 +5,7 @@ final class PhragmentPolicyController extends PhragmentController { private $dblob; public function willProcessRequest(array $data) { - $this->dblob = idx($data, "dblob", ""); + $this->dblob = idx($data, 'dblob', ''); } public function processRequest() { diff --git a/src/applications/phragment/controller/PhragmentRevertController.php b/src/applications/phragment/controller/PhragmentRevertController.php index b9943a6a6e..ccf5d3299e 100644 --- a/src/applications/phragment/controller/PhragmentRevertController.php +++ b/src/applications/phragment/controller/PhragmentRevertController.php @@ -47,7 +47,7 @@ final class PhragmentRevertController extends PhragmentController { ->executeOne(); if ($file === null) { throw new Exception( - "The file associated with this version was not found."); + 'The file associated with this version was not found.'); } } @@ -77,8 +77,8 @@ final class PhragmentRevertController extends PhragmentController { ->addSubmitButton(pht('Revert')) ->addCancelButton(pht('Cancel')) ->appendParagraph(pht( - "Reverting this fragment to version %d will create a new version of ". - "the fragment. It will not delete any version history.", + 'Reverting this fragment to version %d will create a new version of '. + 'the fragment. It will not delete any version history.', $version->getSequence(), $version->getSequence())); return id(new AphrontDialogResponse())->setDialog($dialog); diff --git a/src/applications/phragment/controller/PhragmentSnapshotCreateController.php b/src/applications/phragment/controller/PhragmentSnapshotCreateController.php index a689b9951b..579885f5f3 100644 --- a/src/applications/phragment/controller/PhragmentSnapshotCreateController.php +++ b/src/applications/phragment/controller/PhragmentSnapshotCreateController.php @@ -5,7 +5,7 @@ final class PhragmentSnapshotCreateController extends PhragmentController { private $dblob; public function willProcessRequest(array $data) { - $this->dblob = idx($data, "dblob", ""); + $this->dblob = idx($data, 'dblob', ''); } public function processRequest() { @@ -79,7 +79,7 @@ final class PhragmentSnapshotCreateController extends PhragmentController { } } - $fragment_sequence = "-"; + $fragment_sequence = '-'; if ($fragment->getLatestVersion() !== null) { $fragment_sequence = $fragment->getLatestVersion()->getSequence(); } @@ -98,7 +98,7 @@ final class PhragmentSnapshotCreateController extends PhragmentController { phutil_tag('td', array(), $fragment->getPath()), phutil_tag('td', array(), $fragment_sequence))); foreach ($children as $child) { - $sequence = "-"; + $sequence = '-'; if ($child->getLatestVersion() !== null) { $sequence = $child->getLatestVersion()->getSequence(); } @@ -123,8 +123,8 @@ final class PhragmentSnapshotCreateController extends PhragmentController { 'p', array(), pht( - "The snapshot will contain the following fragments at ". - "the specified versions: ")), + 'The snapshot will contain the following fragments at '. + 'the specified versions: ')), $table)); $form = id(new AphrontFormView()) diff --git a/src/applications/phragment/controller/PhragmentSnapshotDeleteController.php b/src/applications/phragment/controller/PhragmentSnapshotDeleteController.php index 902e51e1d0..4c94e5d284 100644 --- a/src/applications/phragment/controller/PhragmentSnapshotDeleteController.php +++ b/src/applications/phragment/controller/PhragmentSnapshotDeleteController.php @@ -45,8 +45,8 @@ final class PhragmentSnapshotDeleteController extends PhragmentController { ->addSubmitButton(pht('Delete')) ->addCancelButton(pht('Cancel')) ->appendParagraph(pht( - "Deleting this snapshot is a permanent operation. You can not ". - "recover the state of the snapshot.")); + 'Deleting this snapshot is a permanent operation. You can not '. + 'recover the state of the snapshot.')); return id(new AphrontDialogResponse())->setDialog($dialog); } diff --git a/src/applications/phragment/controller/PhragmentSnapshotPromoteController.php b/src/applications/phragment/controller/PhragmentSnapshotPromoteController.php index 9876c69e35..fe08f9901c 100644 --- a/src/applications/phragment/controller/PhragmentSnapshotPromoteController.php +++ b/src/applications/phragment/controller/PhragmentSnapshotPromoteController.php @@ -80,7 +80,7 @@ final class PhragmentSnapshotPromoteController extends PhragmentController { id(new AphrontDialogView()) ->setTitle(pht('No snapshots to promote')) ->appendParagraph(pht( - "There are no snapshots available to promote.")) + 'There are no snapshots available to promote.')) ->setUser($request->getUser()) ->addCancelButton(pht('Cancel'))); } @@ -172,7 +172,7 @@ final class PhragmentSnapshotPromoteController extends PhragmentController { if ($this->id === null) { // The user is promoting a snapshot to the latest version. $dialog->appendParagraph(pht( - "Select the snapshot you want to promote to the latest version:")); + 'Select the snapshot you want to promote to the latest version:')); } else { // The user is promoting a snapshot to another snapshot. $dialog->appendParagraph(pht( diff --git a/src/applications/phragment/controller/PhragmentSnapshotViewController.php b/src/applications/phragment/controller/PhragmentSnapshotViewController.php index 26d2a9f171..1062bca7d7 100644 --- a/src/applications/phragment/controller/PhragmentSnapshotViewController.php +++ b/src/applications/phragment/controller/PhragmentSnapshotViewController.php @@ -9,7 +9,7 @@ final class PhragmentSnapshotViewController extends PhragmentController { } public function willProcessRequest(array $data) { - $this->id = idx($data, "id", ""); + $this->id = idx($data, 'id', ''); } public function processRequest() { @@ -100,8 +100,8 @@ final class PhragmentSnapshotViewController extends PhragmentController { ->setUser($viewer); $zip_uri = $this->getApplicationURI( - "zip@".$snapshot->getName(). - "/".$snapshot->getPrimaryFragment()->getPath()); + 'zip@'.$snapshot->getName(). + '/'.$snapshot->getPrimaryFragment()->getPath()); $can_edit = PhabricatorPolicyFilter::hasCapability( $viewer, @@ -122,7 +122,7 @@ final class PhragmentSnapshotViewController extends PhragmentController { id(new PhabricatorActionView()) ->setName(pht('Delete Snapshot')) ->setHref($this->getApplicationURI( - "snapshot/delete/".$snapshot->getID()."/")) + 'snapshot/delete/'.$snapshot->getID().'/')) ->setDisabled(!$can_edit) ->setWorkflow(true) ->setIcon('fa-times')); @@ -130,7 +130,7 @@ final class PhragmentSnapshotViewController extends PhragmentController { id(new PhabricatorActionView()) ->setName(pht('Promote Another Snapshot to Here')) ->setHref($this->getApplicationURI( - "snapshot/promote/".$snapshot->getID()."/")) + 'snapshot/promote/'.$snapshot->getID().'/')) ->setDisabled(!$can_edit) ->setWorkflow(true) ->setIcon('fa-arrow-up')); diff --git a/src/applications/phragment/controller/PhragmentUpdateController.php b/src/applications/phragment/controller/PhragmentUpdateController.php index f14d16e2fa..d63f227697 100644 --- a/src/applications/phragment/controller/PhragmentUpdateController.php +++ b/src/applications/phragment/controller/PhragmentUpdateController.php @@ -5,7 +5,7 @@ final class PhragmentUpdateController extends PhragmentController { private $dblob; public function willProcessRequest(array $data) { - $this->dblob = idx($data, "dblob", ""); + $this->dblob = idx($data, 'dblob', ''); } public function processRequest() { @@ -34,7 +34,7 @@ final class PhragmentUpdateController extends PhragmentController { // If the file is a ZIP archive (has application/zip mimetype) // then we extract the zip and apply versions for each of the // individual fragments, creating and deleting files as needed. - if ($file->getMimeType() === "application/zip") { + if ($file->getMimeType() === 'application/zip') { $fragment->updateFromZIP($viewer, $file); } else { $fragment->updateFromFile($viewer, $file); diff --git a/src/applications/phragment/controller/PhragmentVersionController.php b/src/applications/phragment/controller/PhragmentVersionController.php index 0373f55e83..98ed79d425 100644 --- a/src/applications/phragment/controller/PhragmentVersionController.php +++ b/src/applications/phragment/controller/PhragmentVersionController.php @@ -9,7 +9,7 @@ final class PhragmentVersionController extends PhragmentController { } public function willProcessRequest(array $data) { - $this->id = idx($data, "id", 0); + $this->id = idx($data, 'id', 0); } public function processRequest() { @@ -48,7 +48,7 @@ final class PhragmentVersionController extends PhragmentController { $header = id(new PHUIHeaderView()) ->setHeader(pht( - "%s at version %d", + '%s at version %d', $version->getFragment()->getName(), $version->getSequence())) ->setPolicyObject($version) @@ -114,7 +114,7 @@ final class PhragmentVersionController extends PhragmentController { 'patch/'.$previous_version->getID().'/'.$version->getID()); $item->addAction(id(new PHUIListItemView()) ->setIcon('fa-file-o') - ->setName(pht("Get Patch")) + ->setName(pht('Get Patch')) ->setHref($this->isCorrectlyConfigured() ? $patch_uri : null) ->setDisabled(!$this->isCorrectlyConfigured())); $list->addItem($item); @@ -125,7 +125,7 @@ final class PhragmentVersionController extends PhragmentController { $item->addAttribute('Prior to any content (empty file)'); $item->addAction(id(new PHUIListItemView()) ->setIcon('fa-file-o') - ->setName(pht("Get Patch")) + ->setName(pht('Get Patch')) ->setHref($this->getApplicationURI( 'patch/x/'.$version->getID()))); $list->addItem($item); diff --git a/src/applications/phragment/controller/PhragmentZIPController.php b/src/applications/phragment/controller/PhragmentZIPController.php index add1fe74d0..ab1f204dc9 100644 --- a/src/applications/phragment/controller/PhragmentZIPController.php +++ b/src/applications/phragment/controller/PhragmentZIPController.php @@ -12,8 +12,8 @@ final class PhragmentZIPController extends PhragmentController { } public function willProcessRequest(array $data) { - $this->dblob = idx($data, "dblob", ""); - $this->snapshot = idx($data, "snapshot", null); + $this->dblob = idx($data, 'dblob', ''); + $this->snapshot = idx($data, 'snapshot', null); } public function processRequest() { @@ -68,7 +68,7 @@ final class PhragmentZIPController extends PhragmentController { } if (!$zip->open((string)$temp, ZipArchive::CREATE)) { - throw new Exception("Unable to create ZIP archive!"); + throw new Exception('Unable to create ZIP archive!'); } $mappings = $this->getFragmentMappings($fragment, $fragment->getPath()); diff --git a/src/applications/phragment/phid/PhragmentPHIDTypeFragment.php b/src/applications/phragment/phid/PhragmentPHIDTypeFragment.php index df7fdfec1e..0a5484911e 100644 --- a/src/applications/phragment/phid/PhragmentPHIDTypeFragment.php +++ b/src/applications/phragment/phid/PhragmentPHIDTypeFragment.php @@ -35,7 +35,7 @@ final class PhragmentPHIDTypeFragment $fragment = $objects[$phid]; $handle->setName(pht( - "Fragment %s: %s", + 'Fragment %s: %s', $fragment->getID(), $fragment->getName())); $handle->setURI($fragment->getURI()); diff --git a/src/applications/phragment/phid/PhragmentPHIDTypeFragmentVersion.php b/src/applications/phragment/phid/PhragmentPHIDTypeFragmentVersion.php index 640c4aaf61..b667625709 100644 --- a/src/applications/phragment/phid/PhragmentPHIDTypeFragmentVersion.php +++ b/src/applications/phragment/phid/PhragmentPHIDTypeFragmentVersion.php @@ -35,7 +35,7 @@ final class PhragmentPHIDTypeFragmentVersion $version = $objects[$phid]; $handle->setName(pht( - "Fragment Version %d: %s", + 'Fragment Version %d: %s', $version->getSequence(), $version->getFragment()->getName())); $handle->setURI($version->getURI()); diff --git a/src/applications/phragment/storage/PhragmentFragment.php b/src/applications/phragment/storage/PhragmentFragment.php index c18ef3ff84..49e49713e4 100644 --- a/src/applications/phragment/storage/PhragmentFragment.php +++ b/src/applications/phragment/storage/PhragmentFragment.php @@ -85,7 +85,7 @@ final class PhragmentFragment extends PhragmentDAO return $fragment; } - if ($file->getMimeType() === "application/zip") { + if ($file->getMimeType() === 'application/zip') { $fragment->updateFromZIP($viewer, $file); } else { $fragment->updateFromFile($viewer, $file); @@ -130,7 +130,7 @@ final class PhragmentFragment extends PhragmentDAO PhabricatorUser $viewer, PhabricatorFile $file) { - if ($file->getMimeType() !== "application/zip") { + if ($file->getMimeType() !== 'application/zip') { throw new Exception("File must have mimetype 'application/zip'"); } @@ -149,7 +149,7 @@ final class PhragmentFragment extends PhragmentDAO $temp = new TempFile(); Filesystem::writeFile($temp, $file->loadFileData()); if (!$zip->open($temp)) { - throw new Exception("Unable to open ZIP"); + throw new Exception('Unable to open ZIP'); } // Get all of the paths and their data from the ZIP. @@ -182,7 +182,7 @@ final class PhragmentFragment extends PhragmentDAO continue; } $directory = dirname($path_key); - while ($directory !== ".") { + while ($directory !== '.') { if (!array_key_exists($directory, $mappings)) { $mappings[$directory] = null; } diff --git a/src/applications/phragment/util/PhragmentPatchUtil.php b/src/applications/phragment/util/PhragmentPatchUtil.php index c395a14e35..5319ba6034 100644 --- a/src/applications/phragment/util/PhragmentPatchUtil.php +++ b/src/applications/phragment/util/PhragmentPatchUtil.php @@ -2,7 +2,7 @@ final class PhragmentPatchUtil extends Phobject { - const EMPTY_HASH = "0000000000000000000000000000000000000000"; + const EMPTY_HASH = '0000000000000000000000000000000000000000'; /** * Calculate the DiffMatchPatch patch between two Phabricator files. @@ -26,8 +26,8 @@ final class PhragmentPatchUtil extends Phobject { $new_hash = $new->getContentHash(); } - $old_content = ""; - $new_content = ""; + $old_content = ''; + $new_content = ''; if ($old_hash === $new_hash) { return null; @@ -36,13 +36,13 @@ final class PhragmentPatchUtil extends Phobject { if ($old_hash !== self::EMPTY_HASH) { $old_content = $old->loadFileData(); } else { - $old_content = ""; + $old_content = ''; } if ($new_hash !== self::EMPTY_HASH) { $new_content = $new->loadFileData(); } else { - $new_content = ""; + $new_content = ''; } $dmp = new diff_match_patch(); diff --git a/src/applications/phrequent/config/PhabricatorPhrequentConfigOptions.php b/src/applications/phrequent/config/PhabricatorPhrequentConfigOptions.php index 7ec707eaa8..c6f8f0cc6c 100644 --- a/src/applications/phrequent/config/PhabricatorPhrequentConfigOptions.php +++ b/src/applications/phrequent/config/PhabricatorPhrequentConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorPhrequentConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Phrequent"); + return pht('Phrequent'); } public function getDescription() { - return pht("Configure Phrequent."); + return pht('Configure Phrequent.'); } public function getOptions() { diff --git a/src/applications/phrequent/controller/PhrequentTrackController.php b/src/applications/phrequent/controller/PhrequentTrackController.php index 29751559e6..0dd5219d7a 100644 --- a/src/applications/phrequent/controller/PhrequentTrackController.php +++ b/src/applications/phrequent/controller/PhrequentTrackController.php @@ -81,7 +81,7 @@ final class PhrequentTrackController $form = new PHUIFormLayoutView(); $form ->appendChild(hsprintf( - "

%s


", $inner_text)); + '

%s


', $inner_text)); $form->appendChild($epoch_control); diff --git a/src/applications/phrequent/query/PhrequentSearchEngine.php b/src/applications/phrequent/query/PhrequentSearchEngine.php index abf92b8cbe..79002b70a3 100644 --- a/src/applications/phrequent/query/PhrequentSearchEngine.php +++ b/src/applications/phrequent/query/PhrequentSearchEngine.php @@ -186,7 +186,7 @@ final class PhrequentSearchEngine ->addSigil('phrequent-stop-tracking') ->setWorkflow(true) ->setRenderNameAsTooltip(true) - ->setName(pht("Stop")) + ->setName(pht('Stop')) ->setHref( '/phrequent/track/stop/'. $usertime->getObjectPHID().'/')); diff --git a/src/applications/phriction/conduit/ConduitAPI_phriction_edit_Method.php b/src/applications/phriction/conduit/ConduitAPI_phriction_edit_Method.php index 9208d68252..70a984d308 100644 --- a/src/applications/phriction/conduit/ConduitAPI_phriction_edit_Method.php +++ b/src/applications/phriction/conduit/ConduitAPI_phriction_edit_Method.php @@ -4,7 +4,7 @@ final class ConduitAPI_phriction_edit_Method extends ConduitAPI_phriction_Method { public function getMethodDescription() { - return "Update a Phriction document."; + return 'Update a Phriction document.'; } public function defineParamTypes() { diff --git a/src/applications/phriction/config/PhabricatorPhrictionConfigOptions.php b/src/applications/phriction/config/PhabricatorPhrictionConfigOptions.php index cfa9b0a889..a39710df79 100644 --- a/src/applications/phriction/config/PhabricatorPhrictionConfigOptions.php +++ b/src/applications/phriction/config/PhabricatorPhrictionConfigOptions.php @@ -4,18 +4,18 @@ final class PhabricatorPhrictionConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Phriction"); + return pht('Phriction'); } public function getDescription() { - return pht("Options related to Phriction (wiki)."); + return pht('Options related to Phriction (wiki).'); } public function getOptions() { return array( $this->newOption( 'metamta.phriction.subject-prefix', 'string', '[Phriction]') - ->setDescription(pht("Subject prefix for Phriction email.")), + ->setDescription(pht('Subject prefix for Phriction email.')), ); } diff --git a/src/applications/phriction/controller/PhrictionDiffController.php b/src/applications/phriction/controller/PhrictionDiffController.php index 559e478423..96f17950ed 100644 --- a/src/applications/phriction/controller/PhrictionDiffController.php +++ b/src/applications/phriction/controller/PhrictionDiffController.php @@ -114,7 +114,7 @@ final class PhrictionDiffController pht('History'), PhrictionDocument::getSlugURI($slug, 'history')); - $title = pht("Version %s vs %s", $l, $r); + $title = pht('Version %s vs %s', $l, $r); $header = id(new PHUIHeaderView()) ->setHeader($title); diff --git a/src/applications/phriction/controller/PhrictionDocumentController.php b/src/applications/phriction/controller/PhrictionDocumentController.php index dbb25bc9e2..6a06f314c7 100644 --- a/src/applications/phriction/controller/PhrictionDocumentController.php +++ b/src/applications/phriction/controller/PhrictionDocumentController.php @@ -289,7 +289,7 @@ final class PhrictionDocumentController } else if ($age == 1) { $when = pht('Yesterday'); } else { - $when = pht("%d Days Ago", $age); + $when = pht('%d Days Ago', $age); } $view->addProperty(pht('Last Updated'), $when); diff --git a/src/applications/phriction/controller/PhrictionHistoryController.php b/src/applications/phriction/controller/PhrictionHistoryController.php index 9ee8352e36..cf29b6afe6 100644 --- a/src/applications/phriction/controller/PhrictionHistoryController.php +++ b/src/applications/phriction/controller/PhrictionHistoryController.php @@ -83,7 +83,7 @@ final class PhrictionHistoryController $color = 'green'; break; default: - throw new Exception("Unknown change type!"); + throw new Exception('Unknown change type!'); break; } diff --git a/src/applications/phriction/controller/PhrictionMoveController.php b/src/applications/phriction/controller/PhrictionMoveController.php index bf74755263..f855fa6be3 100644 --- a/src/applications/phriction/controller/PhrictionMoveController.php +++ b/src/applications/phriction/controller/PhrictionMoveController.php @@ -70,7 +70,7 @@ final class PhrictionMoveController if (isset($disallowed_statuses[$document->getStatus()])) { $error_dialog = id(new AphrontDialogView()) ->setUser($user) - ->setTitle("Can not move page!") + ->setTitle('Can not move page!') ->appendChild(pht('An already moved or deleted document '. 'can not be moved again.')) ->addCancelButton($cancel_uri); diff --git a/src/applications/phriction/editor/PhrictionDocumentEditor.php b/src/applications/phriction/editor/PhrictionDocumentEditor.php index b78f0ede35..f095abd97c 100644 --- a/src/applications/phriction/editor/PhrictionDocumentEditor.php +++ b/src/applications/phriction/editor/PhrictionDocumentEditor.php @@ -293,15 +293,15 @@ final class PhrictionDocumentEditor extends PhabricatorEditor { private function getChangeTypeDescription($const, $title) { $map = array( PhrictionChangeType::CHANGE_EDIT => - pht("Phriction Document %s was edited.", $title), + pht('Phriction Document %s was edited.', $title), PhrictionChangeType::CHANGE_DELETE => - pht("Phriction Document %s was deleted.", $title), + pht('Phriction Document %s was deleted.', $title), PhrictionChangeType::CHANGE_MOVE_HERE => - pht("Phriction Document %s was moved here.", $title), + pht('Phriction Document %s was moved here.', $title), PhrictionChangeType::CHANGE_MOVE_AWAY => - pht("Phriction Document %s was moved away.", $title), + pht('Phriction Document %s was moved away.', $title), PhrictionChangeType::CHANGE_STUB => - pht("Phriction Document %s was created through child.", $title), + pht('Phriction Document %s was created through child.', $title), ); return idx($map, $const, pht('Something magical occurred.')); } diff --git a/src/applications/policy/__tests__/PhabricatorPolicyTestCase.php b/src/applications/policy/__tests__/PhabricatorPolicyTestCase.php index d54ca73651..dca7711566 100644 --- a/src/applications/policy/__tests__/PhabricatorPolicyTestCase.php +++ b/src/applications/policy/__tests__/PhabricatorPolicyTestCase.php @@ -175,7 +175,7 @@ final class PhabricatorPolicyTestCase extends PhabricatorTestCase { * Test that invalid policies reject viewers of all types. */ public function testRejectInvalidPolicy() { - $invalid_policy = "the duck goes quack"; + $invalid_policy = 'the duck goes quack'; $object = $this->buildObject($invalid_policy); $this->expectVisibility( @@ -194,7 +194,7 @@ final class PhabricatorPolicyTestCase extends PhabricatorTestCase { * policies. */ public function testInvalidPolicyVisibleByOmnipotentUser() { - $invalid_policy = "the cow goes moo"; + $invalid_policy = 'the cow goes moo'; $object = $this->buildObject($invalid_policy); $results = array( diff --git a/src/applications/policy/config/PhabricatorPolicyConfigOptions.php b/src/applications/policy/config/PhabricatorPolicyConfigOptions.php index b174560065..03328a6c4d 100644 --- a/src/applications/policy/config/PhabricatorPolicyConfigOptions.php +++ b/src/applications/policy/config/PhabricatorPolicyConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorPolicyConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Policy"); + return pht('Policy'); } public function getDescription() { - return pht("Options relating to object visibility."); + return pht('Options relating to object visibility.'); } public function getOptions() { @@ -18,7 +18,7 @@ final class PhabricatorPolicyConfigOptions array( pht('Allow Public Visibility'), pht('Require Login'))) - ->setSummary(pht("Allow users to set object visibility to public.")) + ->setSummary(pht('Allow users to set object visibility to public.')) ->setDescription( pht( "Phabricator allows you to set the visibility of objects (like ". diff --git a/src/applications/policy/controller/PhabricatorPolicyEditController.php b/src/applications/policy/controller/PhabricatorPolicyEditController.php index e48057305d..3560f4beac 100644 --- a/src/applications/policy/controller/PhabricatorPolicyEditController.php +++ b/src/applications/policy/controller/PhabricatorPolicyEditController.php @@ -54,7 +54,7 @@ final class PhabricatorPolicyEditController $data = $request->getStr('rules'); $data = @json_decode($data, true); if (!is_array($data)) { - throw new Exception("Failed to JSON decode rule data!"); + throw new Exception('Failed to JSON decode rule data!'); } $rule_data = array(); @@ -178,7 +178,7 @@ final class PhabricatorPolicyEditController id(new AphrontFormMarkupControl()) ->setLabel(pht('If No Rules Match')) ->setValue(pht( - "%s all other users.", + '%s all other users.', $default_select))); $form = phutil_tag( diff --git a/src/applications/policy/management/PhabricatorPolicyManagementShowWorkflow.php b/src/applications/policy/management/PhabricatorPolicyManagementShowWorkflow.php index be832aa128..e6d2741bfa 100644 --- a/src/applications/policy/management/PhabricatorPolicyManagementShowWorkflow.php +++ b/src/applications/policy/management/PhabricatorPolicyManagementShowWorkflow.php @@ -8,7 +8,7 @@ final class PhabricatorPolicyManagementShowWorkflow ->setName('show') ->setSynopsis('Show policy information about an object.') ->setExamples( - "**show** D123") + '**show** D123') ->setArguments( array( array( @@ -26,12 +26,12 @@ final class PhabricatorPolicyManagementShowWorkflow if (!$obj_names) { throw new PhutilArgumentUsageException( pht( - "Specify the name of an object to show policy information for.")); + 'Specify the name of an object to show policy information for.')); } else if (count($obj_names) > 1) { throw new PhutilArgumentUsageException( pht( - "Specify the name of exactly one object to show policy information ". - "for.")); + 'Specify the name of exactly one object to show policy information '. + 'for.')); } $object = id(new PhabricatorObjectQuery()) diff --git a/src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php b/src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php index 7d0768801f..22e4984528 100644 --- a/src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php +++ b/src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php @@ -10,7 +10,7 @@ final class PhabricatorPolicyManagementUnlockWorkflow 'Unlock an object by setting its policies to allow anyone to view '. 'and edit it.') ->setExamples( - "**unlock** D123") + '**unlock** D123') ->setArguments( array( array( @@ -28,11 +28,11 @@ final class PhabricatorPolicyManagementUnlockWorkflow if (!$obj_names) { throw new PhutilArgumentUsageException( pht( - "Specify the name of an object to unlock.")); + 'Specify the name of an object to unlock.')); } else if (count($obj_names) > 1) { throw new PhutilArgumentUsageException( pht( - "Specify the name of exactly one object to unlock.")); + 'Specify the name of exactly one object to unlock.')); } $object = id(new PhabricatorObjectQuery()) diff --git a/src/applications/policy/query/PhabricatorPolicyQuery.php b/src/applications/policy/query/PhabricatorPolicyQuery.php index ac2c600305..88f8d7a422 100644 --- a/src/applications/policy/query/PhabricatorPolicyQuery.php +++ b/src/applications/policy/query/PhabricatorPolicyQuery.php @@ -56,8 +56,8 @@ final class PhabricatorPolicyQuery public function loadPage() { if ($this->object && $this->phids) { throw new Exception( - "You can not issue a policy query with both setObject() and ". - "setPHIDs()."); + 'You can not issue a policy query with both setObject() and '. + 'setPHIDs().'); } else if ($this->object) { $phids = $this->loadObjectPolicyPHIDs(); } else { diff --git a/src/applications/ponder/controller/PonderQuestionViewController.php b/src/applications/ponder/controller/PonderQuestionViewController.php index 5da76e9265..10e8e82c02 100644 --- a/src/applications/ponder/controller/PonderQuestionViewController.php +++ b/src/applications/ponder/controller/PonderQuestionViewController.php @@ -41,7 +41,7 @@ final class PonderQuestionViewController extends PonderController { $answer_add_panel ->setQuestion($question) ->setUser($user) - ->setActionURI("/ponder/answer/add/"); + ->setActionURI('/ponder/answer/add/'); } $header = id(new PHUIHeaderView()) diff --git a/src/applications/ponder/editor/PonderVoteEditor.php b/src/applications/ponder/editor/PonderVoteEditor.php index a47726535a..c1448d2b7a 100644 --- a/src/applications/ponder/editor/PonderVoteEditor.php +++ b/src/applications/ponder/editor/PonderVoteEditor.php @@ -25,7 +25,7 @@ final class PonderVoteEditor extends PhabricatorEditor { public function saveVote() { $actor = $this->requireActor(); if (!$this->votable) { - throw new Exception("Must set votable before saving vote"); + throw new Exception('Must set votable before saving vote'); } $votable = $this->votable; diff --git a/src/applications/ponder/mail/PonderQuestionReplyHandler.php b/src/applications/ponder/mail/PonderQuestionReplyHandler.php index d788996110..f5923f39dd 100644 --- a/src/applications/ponder/mail/PonderQuestionReplyHandler.php +++ b/src/applications/ponder/mail/PonderQuestionReplyHandler.php @@ -4,7 +4,7 @@ final class PonderQuestionReplyHandler extends PhabricatorMailReplyHandler { public function validateMailReceiver($mail_receiver) { if (!($mail_receiver instanceof PonderQuestion)) { - throw new Exception("Mail receiver is not a PonderQuestion!"); + throw new Exception('Mail receiver is not a PonderQuestion!'); } } diff --git a/src/applications/ponder/storage/PonderAnswer.php b/src/applications/ponder/storage/PonderAnswer.php index f21d22e055..b281961c3f 100644 --- a/src/applications/ponder/storage/PonderAnswer.php +++ b/src/applications/ponder/storage/PonderAnswer.php @@ -160,11 +160,11 @@ final class PonderAnswer extends PonderDAO public function describeAutomaticCapability($capability) { $out = array(); - $out[] = pht("The author of an answer can always view and edit it."); + $out[] = pht('The author of an answer can always view and edit it.'); switch ($capability) { case PhabricatorPolicyCapability::CAN_VIEW: $out[] = pht( - "The user who asks a question can always view the answers."); + 'The user who asks a question can always view the answers.'); break; } return $out; diff --git a/src/applications/ponder/storage/PonderQuestion.php b/src/applications/ponder/storage/PonderQuestion.php index ed21352ce6..6788f4fa1c 100644 --- a/src/applications/ponder/storage/PonderQuestion.php +++ b/src/applications/ponder/storage/PonderQuestion.php @@ -48,7 +48,7 @@ final class PonderQuestion extends PonderDAO } public function attachRelated() { - $this->answers = $this->loadRelatives(new PonderAnswer(), "questionID"); + $this->answers = $this->loadRelatives(new PonderAnswer(), 'questionID'); $qa_phids = mpull($this->answers, 'getPHID') + array($this->getPHID()); if ($qa_phids) { diff --git a/src/applications/project/conduit/ConduitAPI_project_query_Method.php b/src/applications/project/conduit/ConduitAPI_project_query_Method.php index b433741401..40785eb007 100644 --- a/src/applications/project/conduit/ConduitAPI_project_query_Method.php +++ b/src/applications/project/conduit/ConduitAPI_project_query_Method.php @@ -6,7 +6,7 @@ final class ConduitAPI_project_query_Method extends ConduitAPI_project_Method { public function getMethodDescription() { - return "Execute searches for Projects."; + return 'Execute searches for Projects.'; } public function defineParamTypes() { diff --git a/src/applications/project/config/PhabricatorProjectConfigOptions.php b/src/applications/project/config/PhabricatorProjectConfigOptions.php index 83907a9269..149ba13dc0 100644 --- a/src/applications/project/config/PhabricatorProjectConfigOptions.php +++ b/src/applications/project/config/PhabricatorProjectConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorProjectConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Projects"); + return pht('Projects'); } public function getDescription() { - return pht("Configure Projects."); + return pht('Configure Projects.'); } public function getOptions() { @@ -29,14 +29,14 @@ final class PhabricatorProjectConfigOptions ->setSummary(pht('Custom Projects fields.')) ->setDescription( pht( - "Array of custom fields for Projects.")) + 'Array of custom fields for Projects.')) ->addExample( '{"mycompany:motto": {"name": "Project Motto", '. '"type": "string"}}', pht('Valid Setting')), $this->newOption('projects.fields', $custom_field_type, $default_fields) ->setCustomData(id(new PhabricatorProject())->getCustomFieldBaseClass()) - ->setDescription(pht("Select and reorder project fields.")), + ->setDescription(pht('Select and reorder project fields.')), ); } diff --git a/src/applications/project/storage/PhabricatorProject.php b/src/applications/project/storage/PhabricatorProject.php index e7c56f2e04..94b2e7e12a 100644 --- a/src/applications/project/storage/PhabricatorProject.php +++ b/src/applications/project/storage/PhabricatorProject.php @@ -86,9 +86,9 @@ final class PhabricatorProject extends PhabricatorProjectDAO public function describeAutomaticCapability($capability) { switch ($capability) { case PhabricatorPolicyCapability::CAN_VIEW: - return pht("Members of a project can always view it."); + return pht('Members of a project can always view it.'); case PhabricatorPolicyCapability::CAN_JOIN: - return pht("Users who can edit a project can always join it."); + return pht('Users who can edit a project can always join it.'); } return null; } diff --git a/src/applications/releeph/commitfinder/ReleephCommitFinder.php b/src/applications/releeph/commitfinder/ReleephCommitFinder.php index e1d569d92f..00821cdd65 100644 --- a/src/applications/releeph/commitfinder/ReleephCommitFinder.php +++ b/src/applications/releeph/commitfinder/ReleephCommitFinder.php @@ -60,7 +60,7 @@ final class ReleephCommitFinder { $callsign = $matches['callsign']; if ($callsign != $repository->getCallsign()) { throw new ReleephCommitFinderException(sprintf( - "%s is in a different repository to this Releeph project (%s).", + '%s is in a different repository to this Releeph project (%s).', $partial_string, $repository->getCallsign())); } else { diff --git a/src/applications/releeph/conduit/ConduitAPI_releeph_getbranches_Method.php b/src/applications/releeph/conduit/ConduitAPI_releeph_getbranches_Method.php index ca99b1e137..a741196311 100644 --- a/src/applications/releeph/conduit/ConduitAPI_releeph_getbranches_Method.php +++ b/src/applications/releeph/conduit/ConduitAPI_releeph_getbranches_Method.php @@ -4,7 +4,7 @@ final class ConduitAPI_releeph_getbranches_Method extends ConduitAPI_releeph_Method { public function getMethodDescription() { - return "Return information about all active Releeph branches."; + return 'Return information about all active Releeph branches.'; } public function defineParamTypes() { diff --git a/src/applications/releeph/conduit/ConduitAPI_releeph_projectinfo_Method.php b/src/applications/releeph/conduit/ConduitAPI_releeph_projectinfo_Method.php index 950e629530..23fe38cf02 100644 --- a/src/applications/releeph/conduit/ConduitAPI_releeph_projectinfo_Method.php +++ b/src/applications/releeph/conduit/ConduitAPI_releeph_projectinfo_Method.php @@ -5,8 +5,8 @@ final class ConduitAPI_releeph_projectinfo_Method public function getMethodDescription() { return - "Fetch information about all Releeph projects ". - "for a given Arcanist project."; + 'Fetch information about all Releeph projects '. + 'for a given Arcanist project.'; } public function defineParamTypes() { @@ -21,7 +21,7 @@ final class ConduitAPI_releeph_projectinfo_Method public function defineErrorTypes() { return array( - "ERR_UNKNOWN_ARC" => + 'ERR_UNKNOWN_ARC' => "The given Arcanist project name doesn't exist in the ". "installation of Phabricator you are accessing.", ); @@ -33,7 +33,7 @@ final class ConduitAPI_releeph_projectinfo_Method $arc_project = id(new PhabricatorRepositoryArcanistProject()) ->loadOneWhere('name = %s', $arc_project_name); if (!$arc_project) { - throw id(new ConduitException("ERR_UNKNOWN_ARC")) + throw id(new ConduitException('ERR_UNKNOWN_ARC')) ->setErrorDescription( "Unknown Arcanist project '{$arc_project_name}': ". "are you using the correct Conduit URI?"); diff --git a/src/applications/releeph/conduit/ConduitAPI_releeph_queryrequests_Method.php b/src/applications/releeph/conduit/ConduitAPI_releeph_queryrequests_Method.php index 44767e6b6b..b0b77340b5 100644 --- a/src/applications/releeph/conduit/ConduitAPI_releeph_queryrequests_Method.php +++ b/src/applications/releeph/conduit/ConduitAPI_releeph_queryrequests_Method.php @@ -5,7 +5,7 @@ final class ConduitAPI_releeph_queryrequests_Method public function getMethodDescription() { return - "Return information about all Releeph requests linked to the given ids."; + 'Return information about all Releeph requests linked to the given ids.'; } public function defineParamTypes() { diff --git a/src/applications/releeph/conduit/ConduitAPI_releeph_request_Method.php b/src/applications/releeph/conduit/ConduitAPI_releeph_request_Method.php index 88ae176c79..f0be4d07ae 100644 --- a/src/applications/releeph/conduit/ConduitAPI_releeph_request_Method.php +++ b/src/applications/releeph/conduit/ConduitAPI_releeph_request_Method.php @@ -4,7 +4,7 @@ final class ConduitAPI_releeph_request_Method extends ConduitAPI_releeph_Method { public function getMethodDescription() { - return "Request a commit or diff to be picked to a branch."; + return 'Request a commit or diff to be picked to a branch.'; } public function defineParamTypes() { @@ -21,8 +21,8 @@ final class ConduitAPI_releeph_request_Method public function defineErrorTypes() { return array( - "ERR_BRANCH" => 'Unknown Releeph branch.', - "ERR_FIELD_PARSE" => 'Unable to parse a Releeph field.', + 'ERR_BRANCH' => 'Unknown Releeph branch.', + 'ERR_FIELD_PARSE' => 'Unable to parse a Releeph field.', ); } @@ -41,7 +41,7 @@ final class ConduitAPI_releeph_request_Method ->executeOne(); if (!$releeph_branch) { - throw id(new ConduitException("ERR_BRANCH"))->setErrorDescription( + throw id(new ConduitException('ERR_BRANCH'))->setErrorDescription( "No ReleephBranch found with PHID {$branch_phid}!"); } diff --git a/src/applications/releeph/conduit/work/ConduitAPI_releephwork_canpush_Method.php b/src/applications/releeph/conduit/work/ConduitAPI_releephwork_canpush_Method.php index c0b4d4b1c1..15bd190bcb 100644 --- a/src/applications/releeph/conduit/work/ConduitAPI_releephwork_canpush_Method.php +++ b/src/applications/releeph/conduit/work/ConduitAPI_releephwork_canpush_Method.php @@ -8,7 +8,7 @@ final class ConduitAPI_releephwork_canpush_Method } public function getMethodDescription() { - return "Return whether the conduit user is allowed to push."; + return 'Return whether the conduit user is allowed to push.'; } public function defineParamTypes() { diff --git a/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getauthorinfo_Method.php b/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getauthorinfo_Method.php index 62b594c781..04d3b80b82 100644 --- a/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getauthorinfo_Method.php +++ b/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getauthorinfo_Method.php @@ -8,7 +8,7 @@ final class ConduitAPI_releephwork_getauthorinfo_Method } public function getMethodDescription() { - return "Return a string to use as the VCS author."; + return 'Return a string to use as the VCS author.'; } public function defineParamTypes() { diff --git a/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getbranch_Method.php b/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getbranch_Method.php index 96aacdde26..020b1440b7 100644 --- a/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getbranch_Method.php +++ b/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getbranch_Method.php @@ -8,7 +8,7 @@ final class ConduitAPI_releephwork_getbranch_Method } public function getMethodDescription() { - return "Return information to help checkout / cut a Releeph branch."; + return 'Return information to help checkout / cut a Releeph branch.'; } public function defineParamTypes() { diff --git a/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getbranchcommitmessage_Method.php b/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getbranchcommitmessage_Method.php index a5cc3d8b52..d93da01a34 100644 --- a/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getbranchcommitmessage_Method.php +++ b/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getbranchcommitmessage_Method.php @@ -8,7 +8,7 @@ final class ConduitAPI_releephwork_getbranchcommitmessage_Method } public function getMethodDescription() { - return "Get a commit message for committing a Releeph branch."; + return 'Get a commit message for committing a Releeph branch.'; } public function defineParamTypes() { @@ -60,7 +60,7 @@ final class ConduitAPI_releephwork_getbranchcommitmessage_Method $commit_message[] = $h_branch->getFullName(); $commit_message[] = $h_branch->getURI(); - $commit_message[] = "Cut Point: ".$handles[$cut_phid]->getName(); + $commit_message[] = 'Cut Point: '.$handles[$cut_phid]->getName(); $cut_point_pr_commit = id(new PhabricatorRepositoryCommit()) ->loadOneWhere('phid = %s', $cut_phid); @@ -69,10 +69,10 @@ final class ConduitAPI_releephwork_getbranchcommitmessage_Method $cut_point_pr_commit->getEpoch()); $commit_message[] = "Cut Point Date: {$cut_point_commit_date}"; - $commit_message[] = "Created By: ".$handles[$creator_phid]->getName(); + $commit_message[] = 'Created By: '.$handles[$creator_phid]->getName(); $project_uri = $project->getURI(); - $commit_message[] = "Project: ".$h_project->getName()." ".$project_uri; + $commit_message[] = 'Project: '.$h_project->getName().' '.$project_uri; /** * Required for 090-limit_new_branch_creations.sh in diff --git a/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getcommitmessage_Method.php b/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getcommitmessage_Method.php index 632af4b8b7..4e2ddb7bec 100644 --- a/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getcommitmessage_Method.php +++ b/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getcommitmessage_Method.php @@ -9,8 +9,8 @@ final class ConduitAPI_releephwork_getcommitmessage_Method public function getMethodDescription() { return - "Get commit message components for building ". - "a ReleephRequest commit message."; + 'Get commit message components for building '. + 'a ReleephRequest commit message.'; } public function defineParamTypes() { diff --git a/src/applications/releeph/conduit/work/ConduitAPI_releephwork_nextrequest_Method.php b/src/applications/releeph/conduit/work/ConduitAPI_releephwork_nextrequest_Method.php index f39a02568d..7082aaba28 100644 --- a/src/applications/releeph/conduit/work/ConduitAPI_releephwork_nextrequest_Method.php +++ b/src/applications/releeph/conduit/work/ConduitAPI_releephwork_nextrequest_Method.php @@ -12,8 +12,8 @@ final class ConduitAPI_releephwork_nextrequest_Method public function getMethodDescription() { return - "Return info required to cut a branch, ". - "and pick and revert ReleephRequests"; + 'Return info required to cut a branch, '. + 'and pick and revert ReleephRequests'; } public function defineParamTypes() { @@ -99,7 +99,7 @@ final class ConduitAPI_releephwork_nextrequest_Method $action = 'revert'; $commit_id = $releeph_request->getCommitIdentifier(); $commit_phid = $releeph_request->getCommitPHID(); - } elseif ($needs_pick) { + } else if ($needs_pick) { $releeph_request = head($needs_pick); $action = 'pick'; $commit = $releeph_request->loadPhabricatorRepositoryCommit(); diff --git a/src/applications/releeph/conduit/work/ConduitAPI_releephwork_record_Method.php b/src/applications/releeph/conduit/work/ConduitAPI_releephwork_record_Method.php index 61f0362940..bea2b28e0e 100644 --- a/src/applications/releeph/conduit/work/ConduitAPI_releephwork_record_Method.php +++ b/src/applications/releeph/conduit/work/ConduitAPI_releephwork_record_Method.php @@ -21,8 +21,8 @@ final class ConduitAPI_releephwork_record_Method * reverted. */ public function getMethodDescription() { - return "Record whether we committed a pick or revert ". - "to the upstream repository."; + return 'Record whether we committed a pick or revert '. + 'to the upstream repository.'; } public function defineParamTypes() { diff --git a/src/applications/releeph/conduit/work/ConduitAPI_releephwork_recordpickstatus_Method.php b/src/applications/releeph/conduit/work/ConduitAPI_releephwork_recordpickstatus_Method.php index f351fd107d..77b794303f 100644 --- a/src/applications/releeph/conduit/work/ConduitAPI_releephwork_recordpickstatus_Method.php +++ b/src/applications/releeph/conduit/work/ConduitAPI_releephwork_recordpickstatus_Method.php @@ -8,7 +8,7 @@ final class ConduitAPI_releephwork_recordpickstatus_Method } public function getMethodDescription() { - return "Record whether a pick or revert was successful or not."; + return 'Record whether a pick or revert was successful or not.'; } public function defineParamTypes() { diff --git a/src/applications/releeph/config/PhabricatorApplicationReleephConfigOptions.php b/src/applications/releeph/config/PhabricatorApplicationReleephConfigOptions.php index 316cc5c1b7..9054122d29 100644 --- a/src/applications/releeph/config/PhabricatorApplicationReleephConfigOptions.php +++ b/src/applications/releeph/config/PhabricatorApplicationReleephConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorApplicationReleephConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Releeph"); + return pht('Releeph'); } public function getDescription() { - return pht("Options for configuring Releeph, the release branch tool."); + return pht('Options for configuring Releeph, the release branch tool.'); } public function getOptions() { @@ -47,15 +47,15 @@ final class PhabricatorApplicationReleephConfigOptions ->setSummary(pht('Enable the Releeph application.')) ->setDescription( pht( - "Releeph, a tool for managing release branches, will eventually ". - "fit in to the Phabricator suite as a general purpose tool. ". - "However Releeph is currently unstable in multiple ways that may ". - "not migrate properly for you: the code is still in alpha stage ". - "of design, the storage format is likely to change in unexpected ". - "ways, and the workflows presented are very specific to a core ". - "set of alpha testers at Facebook. For the time being you are ". - "strongly discouraged from relying on Releeph being at all ". - "stable.")), + 'Releeph, a tool for managing release branches, will eventually '. + 'fit in to the Phabricator suite as a general purpose tool. '. + 'However Releeph is currently unstable in multiple ways that may '. + 'not migrate properly for you: the code is still in alpha stage '. + 'of design, the storage format is likely to change in unexpected '. + 'ways, and the workflows presented are very specific to a core '. + 'set of alpha testers at Facebook. For the time being you are '. + 'strongly discouraged from relying on Releeph being at all '. + 'stable.')), $this->newOption('releeph.fields', $custom_field_type, $default) ->setCustomData('ReleephFieldSpecification'), $this->newOption( @@ -64,9 +64,9 @@ final class PhabricatorApplicationReleephConfigOptions 'releases/%P/%p-%Y%m%d-%v') ->setDescription( pht( - "The default branch template for new branches in unconfigured ". - "Releeph projects. This is also configurable on a per-project ". - "basis.")), + 'The default branch template for new branches in unconfigured '. + 'Releeph projects. This is also configurable on a per-project '. + 'basis.')), ); } diff --git a/src/applications/releeph/controller/product/ReleephProductEditController.php b/src/applications/releeph/controller/product/ReleephProductEditController.php index b49ded67de..bd852dcd50 100644 --- a/src/applications/releeph/controller/product/ReleephProductEditController.php +++ b/src/applications/releeph/controller/product/ReleephProductEditController.php @@ -71,7 +71,7 @@ final class ReleephProductEditController extends ReleephProductController { 'getName', 'getID'); if (in_array($product_name, $other_releeph_product_names)) { - $errors[] = pht("Releeph product name %s is already taken", + $errors[] = pht('Releeph product name %s is already taken', $product_name); } @@ -162,8 +162,8 @@ final class ReleephProductEditController extends ReleephProductController { ->setValue($pick_failure_instructions) ->setName('pickFailureInstructions') ->setCaption( - pht("Instructions for pick failures, which will be used " . - "in emails generated by failed picks"))) + pht('Instructions for pick failures, which will be used ' . + 'in emails generated by failed picks'))) ->appendChild( id(new AphrontFormTextAreaControl()) ->setLabel(pht('Tests paths')) diff --git a/src/applications/releeph/controller/request/ReleephRequestDifferentialCreateController.php b/src/applications/releeph/controller/request/ReleephRequestDifferentialCreateController.php index 5c93ab1252..e0f3eef1bd 100644 --- a/src/applications/releeph/controller/request/ReleephRequestDifferentialCreateController.php +++ b/src/applications/releeph/controller/request/ReleephRequestDifferentialCreateController.php @@ -44,8 +44,8 @@ final class ReleephRequestDifferentialCreateController mpull($projects, 'getID')); if (!$branches) { throw new Exception(sprintf( - "D%d could be in the Releeph project(s) %s, ". - "but this project / none of these projects have open branches.", + 'D%d could be in the Releeph project(s) %s, '. + 'but this project / none of these projects have open branches.', $this->revision->getID(), implode(', ', mpull($projects, 'getName')))); } @@ -69,9 +69,9 @@ final class ReleephRequestDifferentialCreateController ->addCancelButton('/D'.$request->getStr('D')); $dialog->appendChild( - pht("This differential revision changes code that is associated ". - "with multiple Releeph branches. ". - "Please select the branch where you would like this code to be picked.")); + pht('This differential revision changes code that is associated '. + 'with multiple Releeph branches. '. + 'Please select the branch where you would like this code to be picked.')); foreach ($branch_groups as $project_id => $branches) { $project = idx($projects, $project_id); diff --git a/src/applications/releeph/controller/request/ReleephRequestEditController.php b/src/applications/releeph/controller/request/ReleephRequestEditController.php index e161d94395..608ae83780 100644 --- a/src/applications/releeph/controller/request/ReleephRequestEditController.php +++ b/src/applications/releeph/controller/request/ReleephRequestEditController.php @@ -93,7 +93,7 @@ final class ReleephRequestEditController extends ReleephBranchController { if ($request_identifier === ReleephRequestTypeaheadControl::PLACEHOLDER) { - $errors[] = "No commit ID was provided."; + $errors[] = 'No commit ID was provided.'; $e_request_identifier = 'Required'; } else { $pr_commit = null; @@ -206,7 +206,7 @@ final class ReleephRequestEditController extends ReleephBranchController { $notice_messages = array( 'You are editing an existing pick request!', hsprintf( - "Requested %s by %s", + 'Requested %s by %s', $age_string, $handles[$pull->getRequestUserPHID()]->renderLink()) ); diff --git a/src/applications/releeph/controller/request/ReleephRequestViewController.php b/src/applications/releeph/controller/request/ReleephRequestViewController.php index 0a39224a5f..9644f6f025 100644 --- a/src/applications/releeph/controller/request/ReleephRequestViewController.php +++ b/src/applications/releeph/controller/request/ReleephRequestViewController.php @@ -73,7 +73,7 @@ final class ReleephRequestViewController $pull->getPHID()); $title = hsprintf( - "%s %s", + '%s %s', $pull->getMonogram(), $pull->getSummaryForDisplay()); diff --git a/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php b/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php index 5ae00fb4e6..d6572a3550 100644 --- a/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php +++ b/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php @@ -217,8 +217,8 @@ final class DifferentialReleephRequestFieldSpecification { $lists[] = implode(', ', $rq_ids).' in '.$branch_name; } throw new DifferentialFieldParseException( - "Commit message references multiple Releeph requests, ". - "but the requests are in different branches: ". + 'Commit message references multiple Releeph requests, '. + 'but the requests are in different branches: '. implode('; ', $lists)); } } @@ -353,9 +353,9 @@ final class DifferentialReleephRequestFieldSpecification { if ($in_branch && $ex_branch) { $error = sprintf( - "CONFUSION: commit %s in %s contains %d path change(s) that were ". - "part of a Releeph branch, but also has %d path change(s) not ". - "part of a Releeph branch!", + 'CONFUSION: commit %s in %s contains %d path change(s) that were '. + 'part of a Releeph branch, but also has %d path change(s) not '. + 'part of a Releeph branch!', $commit->getCommitIdentifier(), $repo->getCallsign(), count($in_branch), diff --git a/src/applications/releeph/editor/ReleephRequestTransactionalEditor.php b/src/applications/releeph/editor/ReleephRequestTransactionalEditor.php index 775766cc96..39df9ea89e 100644 --- a/src/applications/releeph/editor/ReleephRequestTransactionalEditor.php +++ b/src/applications/releeph/editor/ReleephRequestTransactionalEditor.php @@ -253,7 +253,7 @@ final class ReleephRequestTransactionalEditor } } - $name = sprintf("RQ%s: %s", $rq->getID(), $rq->getSummaryForDisplay()); + $name = sprintf('RQ%s: %s', $rq->getID(), $rq->getSummaryForDisplay()); $body->addTextSection( pht('RELEEPH REQUEST'), $name."\n". diff --git a/src/applications/releeph/field/specification/ReleephDiffSizeFieldSpecification.php b/src/applications/releeph/field/specification/ReleephDiffSizeFieldSpecification.php index b0e1e44bf9..9430c1145e 100644 --- a/src/applications/releeph/field/specification/ReleephDiffSizeFieldSpecification.php +++ b/src/applications/releeph/field/specification/ReleephDiffSizeFieldSpecification.php @@ -70,7 +70,7 @@ final class ReleephDiffSizeFieldSpecification ' + tests'); } - $blurb = hsprintf("%s%s.", + $blurb = hsprintf('%s%s.', pht('%d line(s)', $mr_changes['code']['lines']).' and '. pht('%d path(s)', count($mr_changes['code']['paths'])).' over '. pht('%d diff(s)', count($diffs)), diff --git a/src/applications/releeph/field/specification/ReleephIntentFieldSpecification.php b/src/applications/releeph/field/specification/ReleephIntentFieldSpecification.php index 481454e4ec..bae7da14c2 100644 --- a/src/applications/releeph/field/specification/ReleephIntentFieldSpecification.php +++ b/src/applications/releeph/field/specification/ReleephIntentFieldSpecification.php @@ -83,11 +83,11 @@ final class ReleephIntentFieldSpecification } public function renderLabelForCommitMessage() { - return "Approved By"; + return 'Approved By'; } public function renderLabelForRevertMessage() { - return "Rejected By"; + return 'Rejected By'; } public function renderValueForCommitMessage() { diff --git a/src/applications/releeph/field/specification/ReleephLevelFieldSpecification.php b/src/applications/releeph/field/specification/ReleephLevelFieldSpecification.php index 59899641fe..70ae446f95 100644 --- a/src/applications/releeph/field/specification/ReleephLevelFieldSpecification.php +++ b/src/applications/releeph/field/specification/ReleephLevelFieldSpecification.php @@ -43,7 +43,7 @@ abstract class ReleephLevelFieldSpecification if ($this->error) { $control->setError($this->error); - } elseif ($this->getDefaultLevel()) { + } else if ($this->getDefaultLevel()) { $control->setError(true); } diff --git a/src/applications/releeph/field/specification/ReleephReasonFieldSpecification.php b/src/applications/releeph/field/specification/ReleephReasonFieldSpecification.php index 32e40c86a8..d8312283ce 100644 --- a/src/applications/releeph/field/specification/ReleephReasonFieldSpecification.php +++ b/src/applications/releeph/field/specification/ReleephReasonFieldSpecification.php @@ -47,7 +47,7 @@ final class ReleephReasonFieldSpecification $this->error = 'Required'; throw new ReleephFieldParseException( $this, - "You must give a reason for your request."); + 'You must give a reason for your request.'); } } diff --git a/src/applications/releeph/field/specification/ReleephRequestorFieldSpecification.php b/src/applications/releeph/field/specification/ReleephRequestorFieldSpecification.php index abcd9bfb8a..03fb88e955 100644 --- a/src/applications/releeph/field/specification/ReleephRequestorFieldSpecification.php +++ b/src/applications/releeph/field/specification/ReleephRequestorFieldSpecification.php @@ -35,7 +35,7 @@ final class ReleephRequestorFieldSpecification } public function renderLabelForCommitMessage() { - return "Requested By"; + return 'Requested By'; } public function renderValueForCommitMessage() { diff --git a/src/applications/releeph/mail/ReleephRequestReplyHandler.php b/src/applications/releeph/mail/ReleephRequestReplyHandler.php index f402fa0711..ec231b63c5 100644 --- a/src/applications/releeph/mail/ReleephRequestReplyHandler.php +++ b/src/applications/releeph/mail/ReleephRequestReplyHandler.php @@ -4,7 +4,7 @@ final class ReleephRequestReplyHandler extends PhabricatorMailReplyHandler { public function validateMailReceiver($mail_receiver) { if (!($mail_receiver instanceof ReleephRequest)) { - throw new Exception("Mail receiver is not a ReleephRequest!"); + throw new Exception('Mail receiver is not a ReleephRequest!'); } } diff --git a/src/applications/releeph/storage/ReleephRequest.php b/src/applications/releeph/storage/ReleephRequest.php index 487f1de7cb..07af37534b 100644 --- a/src/applications/releeph/storage/ReleephRequest.php +++ b/src/applications/releeph/storage/ReleephRequest.php @@ -131,10 +131,10 @@ final class ReleephRequest extends ReleephDAO // was once in the branch. if ($has_been_in_branch) { return ReleephRequestStatus::STATUS_REVERTED; - } elseif ($this->getPusherIntent() === ReleephRequest::INTENT_PASS) { + } else if ($this->getPusherIntent() === ReleephRequest::INTENT_PASS) { // Otherwise, if it has never been in the branch, explicitly say why: return ReleephRequestStatus::STATUS_REJECTED; - } elseif ($this->getRequestorIntent() === ReleephRequest::INTENT_WANT) { + } else if ($this->getRequestorIntent() === ReleephRequest::INTENT_WANT) { return ReleephRequestStatus::STATUS_REQUESTED; } else { return ReleephRequestStatus::STATUS_ABANDONED; diff --git a/src/applications/releeph/storage/ReleephRequestTransaction.php b/src/applications/releeph/storage/ReleephRequestTransaction.php index 5a7ba969cd..63cd215154 100644 --- a/src/applications/releeph/storage/ReleephRequestTransaction.php +++ b/src/applications/releeph/storage/ReleephRequestTransaction.php @@ -256,7 +256,7 @@ final class ReleephRequestTransaction // ReleephSummaryFieldSpecification is usually blank when an RQ is created, // creating a transaction change from null to "". Hide these! if ($type === ReleephRequestTransaction::TYPE_EDIT_FIELD) { - if ($this->getOldValue() === null && $this->getNewValue() === "") { + if ($this->getOldValue() === null && $this->getNewValue() === '') { return true; } } diff --git a/src/applications/releeph/view/branch/ReleephBranchTemplate.php b/src/applications/releeph/view/branch/ReleephBranchTemplate.php index 5cda1bb334..4672fc020b 100644 --- a/src/applications/releeph/view/branch/ReleephBranchTemplate.php +++ b/src/applications/releeph/view/branch/ReleephBranchTemplate.php @@ -174,9 +174,9 @@ final class ReleephBranchTemplate { $part_error = null; if (preg_match('{^\.}', $part) || preg_match('{\.$}', $part)) { $errors[] = "Path components cannot begin or end with '.'"; - } elseif (preg_match('{^(?!\w)}', $part)) { - $errors[] = "Path components must begin with an alphanumeric"; - } elseif (!preg_match('{^\w ([\w-_%\.]* [\w-_%])?$}x', $part)) { + } else if (preg_match('{^(?!\w)}', $part)) { + $errors[] = 'Path components must begin with an alphanumeric'; + } else if (!preg_match('{^\w ([\w-_%\.]* [\w-_%])?$}x', $part)) { $errors[] = "Path components may only contain alphanumerics ". "or '-', '_', or '.'"; diff --git a/src/applications/repository/PhabricatorRepositoryConfigOptions.php b/src/applications/repository/PhabricatorRepositoryConfigOptions.php index cae49f60db..db362ea033 100644 --- a/src/applications/repository/PhabricatorRepositoryConfigOptions.php +++ b/src/applications/repository/PhabricatorRepositoryConfigOptions.php @@ -19,13 +19,13 @@ final class PhabricatorRepositoryConfigOptions $this->newOption('repository.default-local-path', 'string', '/var/repo/') ->setLocked(true) ->setSummary( - pht("Default location to store local copies of repositories.")) + pht('Default location to store local copies of repositories.')) ->setDescription( pht( - "The default location in which to store working copies and other ". - "data about repositories. Phabricator will control and manage ". - "data here, so you should **not** choose an existing directory ". - "full of data you care about.")), + 'The default location in which to store working copies and other '. + 'data about repositories. Phabricator will control and manage '. + 'data here, so you should **not** choose an existing directory '. + 'full of data you care about.')), ); } diff --git a/src/applications/repository/application/PhabricatorApplicationRepositories.php b/src/applications/repository/application/PhabricatorApplicationRepositories.php index e2caea3527..7f24630622 100644 --- a/src/applications/repository/application/PhabricatorApplicationRepositories.php +++ b/src/applications/repository/application/PhabricatorApplicationRepositories.php @@ -18,7 +18,7 @@ final class PhabricatorApplicationRepositories extends PhabricatorApplication { } public function getTitleGlyph() { - return "rX"; + return 'rX'; } public function getApplicationGroup() { diff --git a/src/applications/repository/conduit/ConduitAPI_repository_create_Method.php b/src/applications/repository/conduit/ConduitAPI_repository_create_Method.php index 5829351807..b18f935929 100644 --- a/src/applications/repository/conduit/ConduitAPI_repository_create_Method.php +++ b/src/applications/repository/conduit/ConduitAPI_repository_create_Method.php @@ -11,11 +11,11 @@ final class ConduitAPI_repository_create_Method } public function getMethodStatusDescription() { - return "Repository methods are new and subject to change."; + return 'Repository methods are new and subject to change.'; } public function getMethodDescription() { - return "Create a new repository (Admin Only)."; + return 'Create a new repository (Admin Only).'; } public function defineParamTypes() { diff --git a/src/applications/repository/conduit/ConduitAPI_repository_query_Method.php b/src/applications/repository/conduit/ConduitAPI_repository_query_Method.php index 9f17b02c9e..4562724527 100644 --- a/src/applications/repository/conduit/ConduitAPI_repository_query_Method.php +++ b/src/applications/repository/conduit/ConduitAPI_repository_query_Method.php @@ -8,11 +8,11 @@ final class ConduitAPI_repository_query_Method } public function getMethodStatusDescription() { - return pht("Repository methods are new and subject to change."); + return pht('Repository methods are new and subject to change.'); } public function getMethodDescription() { - return pht("Query repositories."); + return pht('Query repositories.'); } public function defineParamTypes() { diff --git a/src/applications/repository/controller/PhabricatorRepositoryController.php b/src/applications/repository/controller/PhabricatorRepositoryController.php index 6ba863f39d..748ea3713e 100644 --- a/src/applications/repository/controller/PhabricatorRepositoryController.php +++ b/src/applications/repository/controller/PhabricatorRepositoryController.php @@ -13,7 +13,7 @@ abstract class PhabricatorRepositoryController extends PhabricatorController { $page->setApplicationName('Repositories'); $page->setBaseURI('/repository/'); $page->setTitle(idx($data, 'title')); - $page->setGlyph("rX"); + $page->setGlyph('rX'); $page->appendChild($view); diff --git a/src/applications/repository/daemon/PhabricatorGitGraphStream.php b/src/applications/repository/daemon/PhabricatorGitGraphStream.php index 9133983677..911e30cb52 100644 --- a/src/applications/repository/daemon/PhabricatorGitGraphStream.php +++ b/src/applications/repository/daemon/PhabricatorGitGraphStream.php @@ -16,7 +16,7 @@ final class PhabricatorGitGraphStream $this->repository = $repository; $future = $repository->getLocalCommandFuture( - "log --format=%s %s --", + 'log --format=%s %s --', '%H%x01%P%x01%ct', $start_commit); diff --git a/src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php b/src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php index 5b7233ce5c..18b54a3c59 100644 --- a/src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php +++ b/src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php @@ -110,16 +110,16 @@ final class PhabricatorRepositoryDiscoveryEngine $this->log(pht('Examining branch "%s", at "%s".', $name, $commit)); if (!$repository->shouldTrackBranch($name)) { - $this->log(pht("Skipping, branch is untracked.")); + $this->log(pht('Skipping, branch is untracked.')); continue; } if ($this->isKnownCommit($commit)) { - $this->log(pht("Skipping, HEAD is known.")); + $this->log(pht('Skipping, HEAD is known.')); continue; } - $this->log(pht("Looking for new commits.")); + $this->log(pht('Looking for new commits.')); $branch_refs = $this->discoverStreamAncestry( new PhabricatorGitGraphStream($repository, $commit), @@ -158,7 +158,7 @@ final class PhabricatorRepositoryDiscoveryEngine $remote_uri = $matches[1]; $expect_remote = $repository->getRemoteURI(); - if ($remote_uri == "origin") { + if ($remote_uri == 'origin') { // If a remote does not exist, git pretends it does and prints out a // made up remote where the URI is the same as the remote name. This is // definitely not correct. @@ -368,16 +368,16 @@ final class PhabricatorRepositoryDiscoveryEngine $this->log(pht('Examining branch "%s" head "%s".', $name, $commit)); if (!$repository->shouldTrackBranch($name)) { - $this->log(pht("Skipping, branch is untracked.")); + $this->log(pht('Skipping, branch is untracked.')); continue; } if ($this->isKnownCommit($commit)) { - $this->log(pht("Skipping, this head is a known commit.")); + $this->log(pht('Skipping, this head is a known commit.')); continue; } - $this->log(pht("Looking for new commits.")); + $this->log(pht('Looking for new commits.')); $branch_refs = $this->discoverStreamAncestry( new PhabricatorMercurialGraphStream($repository, $commit), diff --git a/src/applications/repository/engine/PhabricatorRepositoryEngine.php b/src/applications/repository/engine/PhabricatorRepositoryEngine.php index ce8fb183a8..307738ef98 100644 --- a/src/applications/repository/engine/PhabricatorRepositoryEngine.php +++ b/src/applications/repository/engine/PhabricatorRepositoryEngine.php @@ -23,7 +23,7 @@ abstract class PhabricatorRepositoryEngine { */ protected function getRepository() { if ($this->repository === null) { - throw new Exception("Call setRepository() to provide a repository!"); + throw new Exception('Call setRepository() to provide a repository!'); } return $this->repository; diff --git a/src/applications/repository/graphcache/PhabricatorRepositoryGraphCache.php b/src/applications/repository/graphcache/PhabricatorRepositoryGraphCache.php index 5cebece394..6039c78e87 100644 --- a/src/applications/repository/graphcache/PhabricatorRepositoryGraphCache.php +++ b/src/applications/repository/graphcache/PhabricatorRepositoryGraphCache.php @@ -123,7 +123,7 @@ final class PhabricatorRepositoryGraphCache { // Walk past the parent information. $parent_id = null; - for ($ii = 0; ; ++$ii) { + for ($ii = 0;; ++$ii) { if ($items[$ii] === null) { break; } diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementCacheWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementCacheWorkflow.php index 82de8492ec..7888ca824d 100644 --- a/src/applications/repository/management/PhabricatorRepositoryManagementCacheWorkflow.php +++ b/src/applications/repository/management/PhabricatorRepositoryManagementCacheWorkflow.php @@ -7,7 +7,7 @@ final class PhabricatorRepositoryManagementCacheWorkflow $this ->setName('cache') ->setExamples( - "**cache** [__options__] --commit __commit__ --path __path__") + '**cache** [__options__] --commit __commit__ --path __path__') ->setSynopsis(pht('Manage the repository graph cache.')) ->setArguments( array( diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementDiscoverWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementDiscoverWorkflow.php index 6fac505543..fbf6873db1 100644 --- a/src/applications/repository/management/PhabricatorRepositoryManagementDiscoverWorkflow.php +++ b/src/applications/repository/management/PhabricatorRepositoryManagementDiscoverWorkflow.php @@ -31,7 +31,7 @@ final class PhabricatorRepositoryManagementDiscoverWorkflow if (!$repos) { throw new PhutilArgumentUsageException( - "Specify one or more repositories to discover, by callsign."); + 'Specify one or more repositories to discover, by callsign.'); } $console = PhutilConsole::getConsole(); diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php index 12eec7eec8..b3983d2c0c 100644 --- a/src/applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php +++ b/src/applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php @@ -32,7 +32,7 @@ final class PhabricatorRepositoryManagementEditWorkflow if (!$repos) { throw new PhutilArgumentUsageException( - "Specify one or more repositories to edit, by callsign."); + 'Specify one or more repositories to edit, by callsign.'); } $console = PhutilConsole::getConsole(); @@ -47,7 +47,7 @@ final class PhabricatorRepositoryManagementEditWorkflow $username = $args->getArg('as'); if (!$username) { throw new PhutilArgumentUsageException( - pht("Specify a user to edit as with --as .")); + pht('Specify a user to edit as with --as .')); } $actor = id(new PhabricatorPeopleQuery()) @@ -75,7 +75,7 @@ final class PhabricatorRepositoryManagementEditWorkflow if (!$xactions) { throw new PhutilArgumentUsageException( - pht("Specify one or more fields to edit!")); + pht('Specify one or more fields to edit!')); } $content_source = PhabricatorContentSource::newConsoleSource(); diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementImportingWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementImportingWorkflow.php index 7892ea5b59..47dc47728f 100644 --- a/src/applications/repository/management/PhabricatorRepositoryManagementImportingWorkflow.php +++ b/src/applications/repository/management/PhabricatorRepositoryManagementImportingWorkflow.php @@ -28,8 +28,8 @@ final class PhabricatorRepositoryManagementImportingWorkflow if (!$repos) { throw new PhutilArgumentUsageException( - "Specify one or more repositories to find importing commits for, ". - "by callsign."); + 'Specify one or more repositories to find importing commits for, '. + 'by callsign.'); } $repos = mpull($repos, null, 'getID'); @@ -52,7 +52,7 @@ final class PhabricatorRepositoryManagementImportingWorkflow $repo = $repos[$row['repositoryID']]; $identifier = $row['commitIdentifier']; - $console->writeOut("%s", 'r'.$repo->getCallsign().$identifier); + $console->writeOut('%s', 'r'.$repo->getCallsign().$identifier); if (!$args->getArg('simple')) { $status = $row['importStatus']; @@ -70,7 +70,7 @@ final class PhabricatorRepositoryManagementImportingWorkflow $need[] = 'Herald'; } - $console->writeOut(" %s", implode(', ', $need)); + $console->writeOut(' %s', implode(', ', $need)); } $console->writeOut("\n"); diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementLookupUsersWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementLookupUsersWorkflow.php index 82fb82b3e0..dc2781ea05 100644 --- a/src/applications/repository/management/PhabricatorRepositoryManagementLookupUsersWorkflow.php +++ b/src/applications/repository/management/PhabricatorRepositoryManagementLookupUsersWorkflow.php @@ -21,7 +21,7 @@ final class PhabricatorRepositoryManagementLookupUsersWorkflow $commits = $this->loadCommits($args, 'commits'); if (!$commits) { throw new PhutilArgumentUsageException( - "Specify one or more commits to resolve users for."); + 'Specify one or more commits to resolve users for.'); } $console = PhutilConsole::getConsole(); @@ -31,7 +31,7 @@ final class PhabricatorRepositoryManagementLookupUsersWorkflow $console->writeOut( "%s\n", - pht("Examining commit %s...", $name)); + pht('Examining commit %s...', $name)); $ref = id(new DiffusionLowLevelCommitQuery()) ->setRepository($repo) diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementMarkImportedWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementMarkImportedWorkflow.php index 7c8d5fb825..d90e0e501d 100644 --- a/src/applications/repository/management/PhabricatorRepositoryManagementMarkImportedWorkflow.php +++ b/src/applications/repository/management/PhabricatorRepositoryManagementMarkImportedWorkflow.php @@ -26,7 +26,7 @@ final class PhabricatorRepositoryManagementMarkImportedWorkflow if (!$repos) { throw new PhutilArgumentUsageException( - "Specify one or more repositories to mark imported, by callsign."); + 'Specify one or more repositories to mark imported, by callsign.'); } $new_importing_value = (bool)$args->getArg('mark-not-imported'); diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementMirrorWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementMirrorWorkflow.php index 16c72effed..5aab451c59 100644 --- a/src/applications/repository/management/PhabricatorRepositoryManagementMirrorWorkflow.php +++ b/src/applications/repository/management/PhabricatorRepositoryManagementMirrorWorkflow.php @@ -28,8 +28,8 @@ final class PhabricatorRepositoryManagementMirrorWorkflow if (!$repos) { throw new PhutilArgumentUsageException( pht( - "Specify one or more repositories to push to mirrors, by ". - "callsign.")); + 'Specify one or more repositories to push to mirrors, by '. + 'callsign.')); } $console = PhutilConsole::getConsole(); diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementPullWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementPullWorkflow.php index 5945e4c35e..ada90352a9 100644 --- a/src/applications/repository/management/PhabricatorRepositoryManagementPullWorkflow.php +++ b/src/applications/repository/management/PhabricatorRepositoryManagementPullWorkflow.php @@ -26,7 +26,7 @@ final class PhabricatorRepositoryManagementPullWorkflow if (!$repos) { throw new PhutilArgumentUsageException( - "Specify one or more repositories to pull, by callsign."); + 'Specify one or more repositories to pull, by callsign.'); } $console = PhutilConsole::getConsole(); diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementRefsWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementRefsWorkflow.php index 380a5d153e..3d3b2040c8 100644 --- a/src/applications/repository/management/PhabricatorRepositoryManagementRefsWorkflow.php +++ b/src/applications/repository/management/PhabricatorRepositoryManagementRefsWorkflow.php @@ -27,8 +27,8 @@ final class PhabricatorRepositoryManagementRefsWorkflow if (!$repos) { throw new PhutilArgumentUsageException( pht( - "Specify one or more repositories to update refs for, ". - "by callsign.")); + 'Specify one or more repositories to update refs for, '. + 'by callsign.')); } $console = PhutilConsole::getConsole(); diff --git a/src/applications/repository/phid/PhabricatorRepositoryPHIDTypeMirror.php b/src/applications/repository/phid/PhabricatorRepositoryPHIDTypeMirror.php index 4cae9981c6..8dcf103dc8 100644 --- a/src/applications/repository/phid/PhabricatorRepositoryPHIDTypeMirror.php +++ b/src/applications/repository/phid/PhabricatorRepositoryPHIDTypeMirror.php @@ -35,7 +35,7 @@ final class PhabricatorRepositoryPHIDTypeMirror $handle->setName( pht('Mirror %d %s', $mirror->getID(), $mirror->getRemoteURI())); - $handle->setURI("/diffusion/mirror/".$mirror->getID()."/"); + $handle->setURI('/diffusion/mirror/'.$mirror->getID().'/'); } } diff --git a/src/applications/repository/search/PhabricatorRepositoryCommitSearchIndexer.php b/src/applications/repository/search/PhabricatorRepositoryCommitSearchIndexer.php index 8e7b50f489..4e9f622d84 100644 --- a/src/applications/repository/search/PhabricatorRepositoryCommitSearchIndexer.php +++ b/src/applications/repository/search/PhabricatorRepositoryCommitSearchIndexer.php @@ -22,11 +22,11 @@ final class PhabricatorRepositoryCommitSearchIndexer ->withIDs(array($commit->getRepositoryID())) ->executeOne(); if (!$repository) { - throw new Exception("No such repository!"); + throw new Exception('No such repository!'); } $title = 'r'.$repository->getCallsign().$commit->getCommitIdentifier(). - " ".$commit_data->getSummary(); + ' '.$commit_data->getSummary(); $doc = new PhabricatorSearchAbstractDocument(); $doc->setPHID($commit->getPHID()); diff --git a/src/applications/repository/storage/PhabricatorRepository.php b/src/applications/repository/storage/PhabricatorRepository.php index f04f3ad1d3..4ac35afe75 100644 --- a/src/applications/repository/storage/PhabricatorRepository.php +++ b/src/applications/repository/storage/PhabricatorRepository.php @@ -176,7 +176,7 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO public function getSubversionPathURI($path = null, $commit = null) { $vcs = $this->getVersionControlSystem(); if ($vcs != PhabricatorRepositoryType::REPOSITORY_TYPE_SVN) { - throw new Exception("Not a subversion repository!"); + throw new Exception('Not a subversion repository!'); } if ($this->isHosted()) { @@ -372,7 +372,7 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO $env['HGPLAIN'] = 1; break; default: - throw new Exception("Unrecognized version control system."); + throw new Exception('Unrecognized version control system.'); } return $env; @@ -403,7 +403,7 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO // command-line flag instead of an environmental variable. break; default: - throw new Exception("Unrecognized version control system."); + throw new Exception('Unrecognized version control system.'); } } @@ -457,7 +457,7 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO } break; default: - throw new Exception("Unrecognized version control system."); + throw new Exception('Unrecognized version control system.'); } array_unshift($args, $pattern); @@ -480,7 +480,7 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO $pattern = "hg {$pattern}"; break; default: - throw new Exception("Unrecognized version control system."); + throw new Exception('Unrecognized version control system.'); } array_unshift($args, $pattern); @@ -535,7 +535,7 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO $uri); break; default: - throw new Exception("Unrecognized version control system."); + throw new Exception('Unrecognized version control system.'); } return $normalized_uri->getNormalizedPath(); @@ -617,7 +617,7 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL: return true; default: - throw new Exception("Unrecognized version control system."); + throw new Exception('Unrecognized version control system.'); } $closeable_flag = PhabricatorRepositoryCommit::IMPORTED_CLOSEABLE; diff --git a/src/applications/repository/storage/PhabricatorRepositoryVCSPassword.php b/src/applications/repository/storage/PhabricatorRepositoryVCSPassword.php index 9230bd5911..f3ba350282 100644 --- a/src/applications/repository/storage/PhabricatorRepositoryVCSPassword.php +++ b/src/applications/repository/storage/PhabricatorRepositoryVCSPassword.php @@ -26,7 +26,7 @@ final class PhabricatorRepositoryVCSPassword extends PhabricatorRepositoryDAO { PhutilOpaqueEnvelope $password, PhabricatorUser $user) { if ($user->getPHID() != $this->getUserPHID()) { - throw new Exception("User does not match password user PHID!"); + throw new Exception('User does not match password user PHID!'); } $raw_input = PhabricatorHash::digestPassword($password, $user->getPHID()); diff --git a/src/applications/repository/storage/__tests__/PhabricatorRepositoryTestCase.php b/src/applications/repository/storage/__tests__/PhabricatorRepositoryTestCase.php index 2ab824abfa..8e308ed602 100644 --- a/src/applications/repository/storage/__tests__/PhabricatorRepositoryTestCase.php +++ b/src/applications/repository/storage/__tests__/PhabricatorRepositoryTestCase.php @@ -106,7 +106,7 @@ final class PhabricatorRepositoryTestCase public function testFilterMercurialDebugOutput() { $map = array( - "" => "", + '' => '', "quack\n" => "quack\n", @@ -143,7 +143,7 @@ final class PhabricatorRepositoryTestCase "ignoring untrusted configuration option x.y = z\n". "duckignoring untrusted configuration option x.y = z\n". "quack" => - "duckquack", + 'duckquack', ); foreach ($map as $input => $expect) { diff --git a/src/applications/repository/worker/PhabricatorRepositoryCommitHeraldWorker.php b/src/applications/repository/worker/PhabricatorRepositoryCommitHeraldWorker.php index 70b5373754..e86ca99550 100644 --- a/src/applications/repository/worker/PhabricatorRepositoryCommitHeraldWorker.php +++ b/src/applications/repository/worker/PhabricatorRepositoryCommitHeraldWorker.php @@ -201,7 +201,7 @@ final class PhabricatorRepositoryCommitHeraldWorker $template->setRelatedPHID($commit->getPHID()); $template->setSubject("{$commit_name}: {$name}"); $template->setSubjectPrefix($prefix); - $template->setVarySubjectPrefix("[Commit]"); + $template->setVarySubjectPrefix('[Commit]'); $template->setBody($body); $template->setThreadID($thread_id, $is_new = true); $template->addHeader('Thread-Topic', $thread_topic); diff --git a/src/applications/repository/worker/PhabricatorRepositoryCommitOwnersWorker.php b/src/applications/repository/worker/PhabricatorRepositoryCommitOwnersWorker.php index 9a94281471..0d6db546ee 100644 --- a/src/applications/repository/worker/PhabricatorRepositoryCommitOwnersWorker.php +++ b/src/applications/repository/worker/PhabricatorRepositoryCommitOwnersWorker.php @@ -92,12 +92,12 @@ final class PhabricatorRepositoryCommitOwnersWorker $reasons = array(); if ($data->getCommitDetail('vsDiff')) { - $reasons[] = "Changed After Revision Was Accepted"; + $reasons[] = 'Changed After Revision Was Accepted'; } $commit_author_phid = $data->getCommitDetail('authorPHID'); if (!$commit_author_phid) { - $reasons[] = "Commit Author Not Recognized"; + $reasons[] = 'Commit Author Not Recognized'; } $revision_id = $data->getCommitDetail('differential.revisionID'); @@ -113,14 +113,14 @@ final class PhabricatorRepositoryCommitOwnersWorker $revision_author_phid = $revision->getAuthorPHID(); $commit_reviewedby_phid = $data->getCommitDetail('reviewerPHID'); if ($revision_author_phid !== $commit_author_phid) { - $reasons[] = "Author Not Matching with Revision"; + $reasons[] = 'Author Not Matching with Revision'; } } else { - $reasons[] = "Revision Not Found"; + $reasons[] = 'Revision Not Found'; } } else { - $reasons[] = "No Revision Specified"; + $reasons[] = 'No Revision Specified'; } $owners_phids = PhabricatorOwnersOwner::loadAffiliatedUserPHIDs( @@ -129,7 +129,7 @@ final class PhabricatorRepositoryCommitOwnersWorker if (!($commit_author_phid && in_array($commit_author_phid, $owners_phids) || $commit_reviewedby_phid && in_array($commit_reviewedby_phid, $owners_phids))) { - $reasons[] = "Owners Not Involved"; + $reasons[] = 'Owners Not Involved'; } return $reasons; diff --git a/src/applications/repository/worker/commitchangeparser/PhabricatorOwnersPackagePathValidator.php b/src/applications/repository/worker/commitchangeparser/PhabricatorOwnersPackagePathValidator.php index 43f50217c2..7269c74ab8 100644 --- a/src/applications/repository/worker/commitchangeparser/PhabricatorOwnersPackagePathValidator.php +++ b/src/applications/repository/worker/commitchangeparser/PhabricatorOwnersPackagePathValidator.php @@ -21,11 +21,11 @@ final class PhabricatorOwnersPackagePathValidator { $move_map = array(); foreach ($changes as $change) { if ($change->getChangeType() == DifferentialChangeType::TYPE_MOVE_HERE) { - $from_path = "/".$change->getTargetPath(); - $to_path = "/".$change->getPath(); + $from_path = '/'.$change->getTargetPath(); + $to_path = '/'.$change->getPath(); if ($change->getFileType() == DifferentialChangeType::FILE_DIRECTORY) { - $to_path = $to_path."/"; - $from_path = $from_path."/"; + $to_path = $to_path.'/'; + $from_path = $from_path.'/'; } $move_map[$from_path] = $to_path; } diff --git a/src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryCommitChangeParserWorker.php b/src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryCommitChangeParserWorker.php index 69ed92d750..5aedbf74dc 100644 --- a/src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryCommitChangeParserWorker.php +++ b/src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryCommitChangeParserWorker.php @@ -23,7 +23,7 @@ abstract class PhabricatorRepositoryCommitChangeParserWorker $this->log("Parsing %s...\n", $full_name); if ($this->isBadCommit($full_name)) { - $this->log("This commit is marked bad!"); + $this->log('This commit is marked bad!'); return; } diff --git a/src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php b/src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php index 524f01a994..e65905b986 100644 --- a/src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php +++ b/src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php @@ -201,7 +201,7 @@ final class PhabricatorRepositorySvnCommitChangeParserWorker if ($source_file_type == DifferentialChangeType::FILE_DELETED) { throw new Exception( - "Something is wrong; source of a copy must exist."); + 'Something is wrong; source of a copy must exist.'); } if ($source_file_type != DifferentialChangeType::FILE_DIRECTORY) { @@ -687,7 +687,7 @@ final class PhabricatorRepositorySvnCommitChangeParserWorker '((.*?))?@'; $matches = null; if (!preg_match($pattern, $entry, $matches)) { - throw new Exception("Unable to parse entry!"); + throw new Exception('Unable to parse entry!'); } $map[html_entity_decode($matches[2])] = $this->getFileTypeFromSVNKind($matches[1]); @@ -737,7 +737,7 @@ final class PhabricatorRepositorySvnCommitChangeParserWorker } } if (!$done) { - throw new Exception("Unexpected end of file."); + throw new Exception('Unexpected end of file.'); } return $map; diff --git a/src/applications/search/config/PhabricatorSearchConfigOptions.php b/src/applications/search/config/PhabricatorSearchConfigOptions.php index 71d3f262d6..7b1f5b7076 100644 --- a/src/applications/search/config/PhabricatorSearchConfigOptions.php +++ b/src/applications/search/config/PhabricatorSearchConfigOptions.php @@ -4,11 +4,11 @@ final class PhabricatorSearchConfigOptions extends PhabricatorApplicationConfigOptions { public function getName() { - return pht("Search"); + return pht('Search'); } public function getDescription() { - return pht("Options relating to Search."); + return pht('Options relating to Search.'); } public function getOptions() { @@ -18,19 +18,19 @@ final class PhabricatorSearchConfigOptions 'class', 'PhabricatorDefaultSearchEngineSelector') ->setBaseClass('PhabricatorSearchEngineSelector') - ->setSummary(pht("Search engine selector.")) + ->setSummary(pht('Search engine selector.')) ->setDescription( pht( - "Phabricator uses a search engine selector to choose which ". - "search engine to use when indexing and reconstructing ". - "documents, and when executing queries. You can override the ". - "engine selector to provide a new selector class which can ". - "select some custom engine you implement, if you want to store ". - "your documents in some search engine which does not have ". - "default support.")), + 'Phabricator uses a search engine selector to choose which '. + 'search engine to use when indexing and reconstructing '. + 'documents, and when executing queries. You can override the '. + 'engine selector to provide a new selector class which can '. + 'select some custom engine you implement, if you want to store '. + 'your documents in some search engine which does not have '. + 'default support.')), $this->newOption('search.elastic.host', 'string', null) ->setLocked(true) - ->setDescription(pht("Elastic Search host.")) + ->setDescription(pht('Elastic Search host.')) ->addExample('http://elastic.example.com:9200/', pht('Valid Setting')), ); } diff --git a/src/applications/search/controller/PhabricatorApplicationSearchController.php b/src/applications/search/controller/PhabricatorApplicationSearchController.php index 8518822b47..cbb9da48e5 100644 --- a/src/applications/search/controller/PhabricatorApplicationSearchController.php +++ b/src/applications/search/controller/PhabricatorApplicationSearchController.php @@ -50,19 +50,19 @@ final class PhabricatorApplicationSearchController if (!$parent) { throw new Exception( - "You must delegate to this controller, not invoke it directly."); + 'You must delegate to this controller, not invoke it directly.'); } $engine = $this->getSearchEngine(); if (!$engine) { throw new Exception( - "Call setEngine() before delegating to this controller!"); + 'Call setEngine() before delegating to this controller!'); } $nav = $this->getNavigation(); if (!$nav) { throw new Exception( - "Call setNavigation() before delegating to this controller!"); + 'Call setNavigation() before delegating to this controller!'); } $engine->setViewer($this->getRequest()->getUser()); @@ -231,7 +231,7 @@ final class PhabricatorApplicationSearchController // TODO: This is a bit hacky. if ($list instanceof PHUIObjectItemListView) { - $list->setNoDataString(pht("No results found for this query.")); + $list->setNoDataString(pht('No results found for this query.')); $list->setPager($pager); } else { if ($pager->willShowPagingControls()) { @@ -339,7 +339,7 @@ final class PhabricatorApplicationSearchController $crumbs = $parent ->buildApplicationCrumbs() - ->addTextCrumb(pht("Saved Queries"), $engine->getQueryManagementURI()); + ->addTextCrumb(pht('Saved Queries'), $engine->getQueryManagementURI()); $nav->selectFilter('query/edit'); $nav->setCrumbs($crumbs); @@ -348,7 +348,7 @@ final class PhabricatorApplicationSearchController return $parent->buildApplicationPage( $nav, array( - 'title' => pht("Saved Queries"), + 'title' => pht('Saved Queries'), 'device' => true, )); } diff --git a/src/applications/search/controller/PhabricatorSearchAttachController.php b/src/applications/search/controller/PhabricatorSearchAttachController.php index 2218ee5662..2c36ee49d8 100644 --- a/src/applications/search/controller/PhabricatorSearchAttachController.php +++ b/src/applications/search/controller/PhabricatorSearchAttachController.php @@ -249,17 +249,17 @@ final class PhabricatorSearchAttachController $instructions = null; break; case self::ACTION_MERGE: - $dialog_title = "Merge Duplicate Tasks"; - $header_text = "Tasks To Merge"; + $dialog_title = 'Merge Duplicate Tasks'; + $header_text = 'Tasks To Merge'; $button_text = "Merge {$noun}"; $instructions = - "These tasks will be merged into the current task and then closed. ". - "The current task will grow stronger."; + 'These tasks will be merged into the current task and then closed. '. + 'The current task will grow stronger.'; break; case self::ACTION_DEPENDENCIES: - $dialog_title = "Edit Dependencies"; - $header_text = "Current Dependencies"; - $button_text = "Save Dependencies"; + $dialog_title = 'Edit Dependencies'; + $header_text = 'Current Dependencies'; + $button_text = 'Save Dependencies'; $instructions = null; break; case self::ACTION_BLOCKS: diff --git a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php index 2bed70537f..1626a1d91f 100644 --- a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php +++ b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php @@ -30,7 +30,7 @@ abstract class PhabricatorApplicationSearchEngine { protected function requireViewer() { if (!$this->viewer) { - throw new Exception("Call setViewer() before using an engine!"); + throw new Exception('Call setViewer() before using an engine!'); } return $this->viewer; } diff --git a/src/applications/search/engine/PhabricatorSearchEngineElastic.php b/src/applications/search/engine/PhabricatorSearchEngineElastic.php index 82e03cf350..59bb2af0df 100644 --- a/src/applications/search/engine/PhabricatorSearchEngineElastic.php +++ b/src/applications/search/engine/PhabricatorSearchEngineElastic.php @@ -254,7 +254,7 @@ final class PhabricatorSearchEngineElastic extends PhabricatorSearchEngine { $body = json_decode($body, true); if (!is_array($body)) { - throw new Exception("elasticsearch server returned invalid JSON!"); + throw new Exception('elasticsearch server returned invalid JSON!'); } return $body; diff --git a/src/applications/search/engine/PhabricatorSearchEngineMySQL.php b/src/applications/search/engine/PhabricatorSearchEngineMySQL.php index 91603749bb..704fedce8a 100644 --- a/src/applications/search/engine/PhabricatorSearchEngineMySQL.php +++ b/src/applications/search/engine/PhabricatorSearchEngineMySQL.php @@ -10,7 +10,7 @@ final class PhabricatorSearchEngineMySQL extends PhabricatorSearchEngine { $phid = $doc->getPHID(); if (!$phid) { - throw new Exception("Document has no PHID!"); + throw new Exception('Document has no PHID!'); } $store = new PhabricatorSearchDocument(); diff --git a/src/applications/search/storage/PhabricatorSavedQuery.php b/src/applications/search/storage/PhabricatorSavedQuery.php index 0fc1296c86..910b7d4581 100644 --- a/src/applications/search/storage/PhabricatorSavedQuery.php +++ b/src/applications/search/storage/PhabricatorSavedQuery.php @@ -29,7 +29,7 @@ final class PhabricatorSavedQuery extends PhabricatorSearchDAO public function save() { if ($this->getEngineClassName() === null) { - throw new Exception(pht("Engine class is null.")); + throw new Exception(pht('Engine class is null.')); } // Instantiate the engine to make sure it's valid. diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelAccount.php b/src/applications/settings/panel/PhabricatorSettingsPanelAccount.php index 2384fef444..576459ac34 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelAccount.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelAccount.php @@ -90,7 +90,7 @@ final class PhabricatorSettingsPanelAccount ->setName('timezone') ->setOptions($timezone_id_map) ->setValue($user->getTimezoneIdentifier())) - ->appendRemarkupInstructions(pht("**Choose the pronoun you prefer:**")) + ->appendRemarkupInstructions(pht('**Choose the pronoun you prefer:**')) ->appendChild( id(new AphrontFormSelectControl()) ->setOptions($sexes) @@ -115,7 +115,7 @@ final class PhabricatorSettingsPanelAccount "| `H:i` | 14:34 | 24-hour time. |\n". "\n\n". "You can find a [[%s | full reference in the PHP manual]].", - "http://www.php.net/manual/en/function.date.php")) + 'http://www.php.net/manual/en/function.date.php')) ->appendChild( id(new AphrontFormTextControl()) ->setLabel(pht('Time-of-Day Format')) diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelDiffPreferences.php b/src/applications/settings/panel/PhabricatorSettingsPanelDiffPreferences.php index 16ba31bd3d..b31350074b 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelDiffPreferences.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelDiffPreferences.php @@ -50,9 +50,9 @@ final class PhabricatorSettingsPanelDiffPreferences 1 => pht('Enable Filetree'), )) ->setCaption( - pht("When looking at a revision or commit, enable a sidebar ". - "showing affected files. You can press %s to show or hide ". - "the sidebar.", + pht('When looking at a revision or commit, enable a sidebar '. + 'showing affected files. You can press %s to show or hide '. + 'the sidebar.', phutil_tag('tt', array(), 'f')))) ->appendChild( id(new AphrontFormSubmitControl()) diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php b/src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php index 4205d246dd..50ff17e3e6 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php @@ -312,7 +312,7 @@ final class PhabricatorSettingsPanelEmailAddresses $dialog = id(new AphrontDialogView()) ->setUser($user) ->addHiddenInput('verify', $email_id) - ->setTitle(pht("Send Another Verification Email?")) + ->setTitle(pht('Send Another Verification Email?')) ->appendChild(phutil_tag('p', array(), pht( 'Send another copy of the verification email to %s?', $address))) @@ -358,7 +358,7 @@ final class PhabricatorSettingsPanelEmailAddresses $dialog = id(new AphrontDialogView()) ->setUser($user) ->addHiddenInput('primary', $email_id) - ->setTitle(pht("Change primary email address?")) + ->setTitle(pht('Change primary email address?')) ->appendChild(phutil_tag('p', array(), pht( 'If you change your primary address, Phabricator will send'. ' all email to %s.', diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelEmailPreferences.php b/src/applications/settings/panel/PhabricatorSettingsPanelEmailPreferences.php index f38d6c0cb5..39082285dd 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelEmailPreferences.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelEmailPreferences.php @@ -217,25 +217,25 @@ final class PhabricatorSettingsPanelEmailPreferences private function getMailTags() { return array( MetaMTANotificationType::TYPE_DIFFERENTIAL_REVIEW_REQUEST => - pht("A revision is created."), + pht('A revision is created.'), MetaMTANotificationType::TYPE_DIFFERENTIAL_UPDATED => - pht("A revision is updated."), + pht('A revision is updated.'), MetaMTANotificationType::TYPE_DIFFERENTIAL_COMMENT => - pht("Someone comments on a revision."), + pht('Someone comments on a revision.'), MetaMTANotificationType::TYPE_DIFFERENTIAL_REVIEWERS => pht("A revision's reviewers change."), MetaMTANotificationType::TYPE_DIFFERENTIAL_CLOSED => - pht("A revision is closed."), + pht('A revision is closed.'), MetaMTANotificationType::TYPE_DIFFERENTIAL_CC => pht("A revision's CCs change."), MetaMTANotificationType::TYPE_DIFFERENTIAL_OTHER => - pht("Other revision activity not listed above occurs."), + pht('Other revision activity not listed above occurs.'), MetaMTANotificationType::TYPE_MANIPHEST_STATUS => pht("A task's status changes."), MetaMTANotificationType::TYPE_MANIPHEST_OWNER => pht("A task's owner changes."), MetaMTANotificationType::TYPE_MANIPHEST_COMMENT => - pht("Someone comments on a task."), + pht('Someone comments on a task.'), MetaMTANotificationType::TYPE_MANIPHEST_PRIORITY => pht("A task's priority changes."), MetaMTANotificationType::TYPE_MANIPHEST_CC => @@ -243,7 +243,7 @@ final class PhabricatorSettingsPanelEmailPreferences MetaMTANotificationType::TYPE_MANIPHEST_PROJECTS => pht("A task's associated projects change."), MetaMTANotificationType::TYPE_MANIPHEST_OTHER => - pht("Other task activity not listed above occurs."), + pht('Other task activity not listed above occurs.'), ); } diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php b/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php index e78fdc4ae0..bfa7c3a07a 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php @@ -365,7 +365,7 @@ final class PhabricatorSettingsPanelSSHKeys ->appendParagraph($explain) ->appendParagraph( pht( - "Phabricator will not retain a copy of the private key.")) + 'Phabricator will not retain a copy of the private key.')) ->addSubmitButton(pht('Generate Keypair')); } catch (Exception $ex) { $dialog diff --git a/src/applications/slowvote/conduit/ConduitAPI_slowvote_info_Method.php b/src/applications/slowvote/conduit/ConduitAPI_slowvote_info_Method.php index 0102cff9cb..4874f56a04 100644 --- a/src/applications/slowvote/conduit/ConduitAPI_slowvote_info_Method.php +++ b/src/applications/slowvote/conduit/ConduitAPI_slowvote_info_Method.php @@ -7,7 +7,7 @@ final class ConduitAPI_slowvote_info_Method extends ConduitAPI_slowvote_Method { public function getMethodDescription() { - return "Retrieve an array of information about a poll."; + return 'Retrieve an array of information about a poll.'; } public function defineParamTypes() { diff --git a/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php b/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php index 4154fa3020..9d7482a76f 100644 --- a/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php +++ b/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php @@ -152,7 +152,7 @@ final class PhabricatorSlowvoteEditController for ($ii = 0; $ii < 10; $ii++) { $n = ($ii + 1); $response = id(new AphrontFormTextControl()) - ->setLabel(pht("Response %d", $n)) + ->setLabel(pht('Response %d', $n)) ->setName('response[]') ->setValue(idx($responses, $ii, '')); diff --git a/src/applications/slowvote/view/SlowvoteEmbedView.php b/src/applications/slowvote/view/SlowvoteEmbedView.php index 0574288056..6e18e4b3ca 100644 --- a/src/applications/slowvote/view/SlowvoteEmbedView.php +++ b/src/applications/slowvote/view/SlowvoteEmbedView.php @@ -25,7 +25,7 @@ final class SlowvoteEmbedView extends AphrontView { public function render() { if (!$this->poll) { - throw new Exception("Call setPoll() before render()!"); + throw new Exception('Call setPoll() before render()!'); } $poll = $this->poll; diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php index 76797adc53..7b8cbd07d2 100644 --- a/src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php +++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php @@ -72,20 +72,20 @@ final class PhabricatorApplicationTransactionCommentEditor if (!$xaction->getPHID()) { throw new Exception( - "Transaction must have a PHID before calling applyEdit()!"); + 'Transaction must have a PHID before calling applyEdit()!'); } $type_comment = PhabricatorTransactions::TYPE_COMMENT; if ($xaction->getTransactionType() == $type_comment) { if ($comment->getPHID()) { throw new Exception( - "Transaction comment must not yet have a PHID!"); + 'Transaction comment must not yet have a PHID!'); } } if (!$this->getContentSource()) { throw new Exception( - "Call setContentSource() before applyEdit()!"); + 'Call setContentSource() before applyEdit()!'); } $actor = $this->requireActor(); diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php index b5c998d150..258720fbb8 100644 --- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php +++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php @@ -252,13 +252,13 @@ abstract class PhabricatorApplicationTransactionEditor protected function getCustomTransactionOldValue( PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction) { - throw new Exception("Capability not supported!"); + throw new Exception('Capability not supported!'); } protected function getCustomTransactionNewValue( PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction) { - throw new Exception("Capability not supported!"); + throw new Exception('Capability not supported!'); } protected function transactionHasEffect( @@ -854,7 +854,7 @@ abstract class PhabricatorApplicationTransactionEditor if (!$this->getContentSource()) { throw new Exception( - "Call setContentSource() before applyTransactions()!"); + 'Call setContentSource() before applyTransactions()!'); } // Do a bunch of sanity checks that the incoming transactions are fresh. @@ -869,13 +869,13 @@ abstract class PhabricatorApplicationTransactionEditor throw new PhabricatorApplicationTransactionStructureException( $xaction, pht( - "You can not apply transactions which already have IDs/PHIDs!")); + 'You can not apply transactions which already have IDs/PHIDs!')); } if ($xaction->getObjectPHID()) { throw new PhabricatorApplicationTransactionStructureException( $xaction, pht( - "You can not apply transactions which already have objectPHIDs!")); + 'You can not apply transactions which already have objectPHIDs!')); } if ($xaction->getAuthorPHID()) { throw new PhabricatorApplicationTransactionStructureException( @@ -1869,7 +1869,7 @@ abstract class PhabricatorApplicationTransactionEditor * @task mail */ protected function buildReplyHandler(PhabricatorLiskDAO $object) { - throw new Exception("Capability not supported."); + throw new Exception('Capability not supported.'); } @@ -1877,7 +1877,7 @@ abstract class PhabricatorApplicationTransactionEditor * @task mail */ protected function getMailSubjectPrefix() { - throw new Exception("Capability not supported."); + throw new Exception('Capability not supported.'); } @@ -1910,7 +1910,7 @@ abstract class PhabricatorApplicationTransactionEditor * @task mail */ protected function buildMailTemplate(PhabricatorLiskDAO $object) { - throw new Exception("Capability not supported."); + throw new Exception('Capability not supported.'); } @@ -1918,7 +1918,7 @@ abstract class PhabricatorApplicationTransactionEditor * @task mail */ protected function getMailTo(PhabricatorLiskDAO $object) { - throw new Exception("Capability not supported."); + throw new Exception('Capability not supported.'); } diff --git a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php index a0cac01c81..630dbb60ee 100644 --- a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php +++ b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php @@ -76,7 +76,7 @@ abstract class PhabricatorApplicationTransaction } public function getApplicationTransactionCommentObject() { - throw new Exception("Not implemented!"); + throw new Exception('Not implemented!'); } public function getApplicationTransactionViewObject() { @@ -125,7 +125,7 @@ abstract class PhabricatorApplicationTransaction public function getComment() { if ($this->commentNotLoaded) { - throw new Exception("Comment for this transaction was not loaded."); + throw new Exception('Comment for this transaction was not loaded.'); } return $this->comment; } diff --git a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php index 6ff13c78a6..a8bc51febf 100644 --- a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php +++ b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php @@ -151,7 +151,7 @@ class PhabricatorApplicationTransactionCommentView extends AphrontView { } if (!$this->getObjectPHID()) { - throw new Exception("Call setObjectPHID() before render()!"); + throw new Exception('Call setObjectPHID() before render()!'); } return id(new AphrontFormView()) diff --git a/src/applications/transactions/view/PhabricatorApplicationTransactionView.php b/src/applications/transactions/view/PhabricatorApplicationTransactionView.php index 524b476520..abc49488d0 100644 --- a/src/applications/transactions/view/PhabricatorApplicationTransactionView.php +++ b/src/applications/transactions/view/PhabricatorApplicationTransactionView.php @@ -148,7 +148,7 @@ class PhabricatorApplicationTransactionView extends AphrontView { public function render() { if (!$this->getObjectPHID()) { - throw new Exception("Call setObjectPHID() before render()!"); + throw new Exception('Call setObjectPHID() before render()!'); } $view = new PHUITimelineView(); diff --git a/src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php b/src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php index 7122222155..29bf07eadf 100644 --- a/src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php +++ b/src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php @@ -285,7 +285,7 @@ final class PhabricatorTypeaheadCommonDatasourceController $proj_result = id(new PhabricatorTypeaheadResult()) ->setName($proj->getName()) - ->setDisplayType("Project") + ->setDisplayType('Project') ->setURI('/project/view/'.$proj->getID().'/') ->setPHID($proj->getPHID()) ->setIcon($proj->getIcon().' bluegrey') diff --git a/src/applications/uiexample/examples/PHUITimelineExample.php b/src/applications/uiexample/examples/PHUITimelineExample.php index cfd5837c62..ff7ac1a938 100644 --- a/src/applications/uiexample/examples/PHUITimelineExample.php +++ b/src/applications/uiexample/examples/PHUITimelineExample.php @@ -119,7 +119,7 @@ final class PHUITimelineExample extends PhabricatorUIExample { $events[] = id(new PHUITimelineEventView()) ->setUserHandle($handle) - ->setTitle("Colorless") + ->setTitle('Colorless') ->setIcon('lock'); foreach ($colors as $color) { diff --git a/src/applications/uiexample/examples/PhabricatorAphrontBarExample.php b/src/applications/uiexample/examples/PhabricatorAphrontBarExample.php index f22f5757f9..61d62b282f 100644 --- a/src/applications/uiexample/examples/PhabricatorAphrontBarExample.php +++ b/src/applications/uiexample/examples/PhabricatorAphrontBarExample.php @@ -3,7 +3,7 @@ final class PhabricatorAphrontBarExample extends PhabricatorUIExample { public function getName() { - return "Bars"; + return 'Bars'; } public function getDescription() { @@ -56,13 +56,13 @@ final class PhabricatorAphrontBarExample extends PhabricatorUIExample { } return $this->wrap( - "Glyph bars in weird order", + 'Glyph bars in weird order', phutil_implode_html('', $views)); } private function renderAsciiStarBar() { return $this->wrap( - "Ascii star glyph bar", + 'Ascii star glyph bar', id(new AphrontGlyphBarView()) ->setValue(50) ->setMax(100) diff --git a/src/applications/uiexample/examples/PhabricatorBusyExample.php b/src/applications/uiexample/examples/PhabricatorBusyExample.php index 4d88bac3ef..1cee5ffca9 100644 --- a/src/applications/uiexample/examples/PhabricatorBusyExample.php +++ b/src/applications/uiexample/examples/PhabricatorBusyExample.php @@ -7,7 +7,7 @@ final class PhabricatorBusyExample extends PhabricatorUIExample { } public function getDescription() { - return "Busy."; + return 'Busy.'; } public function renderExample() { diff --git a/src/applications/uiexample/examples/PhabricatorHovercardExample.php b/src/applications/uiexample/examples/PhabricatorHovercardExample.php index e83081f81f..ca73039af9 100644 --- a/src/applications/uiexample/examples/PhabricatorHovercardExample.php +++ b/src/applications/uiexample/examples/PhabricatorHovercardExample.php @@ -18,11 +18,11 @@ final class PhabricatorHovercardExample extends PhabricatorUIExample { $elements = array(); $diff_handle = $this->createBasicDummyHandle( - "D123", + 'D123', DifferentialPHIDTypeRevision::TYPECONST, - "Introduce cooler Differential Revisions"); + 'Introduce cooler Differential Revisions'); - $panel = $this->createPanel("Differential Hovercard"); + $panel = $this->createPanel('Differential Hovercard'); $panel->appendChild(id(new PhabricatorHovercardView()) ->setObjectHandle($diff_handle) ->addField(pht('Author'), $user->getUsername()) @@ -32,14 +32,14 @@ final class PhabricatorHovercardExample extends PhabricatorUIExample { $elements[] = $panel; $task_handle = $this->createBasicDummyHandle( - "T123", + 'T123', ManiphestPHIDTypeTask::TYPECONST, - "Improve Mobile Experience for Phabricator"); + 'Improve Mobile Experience for Phabricator'); $tag = id(new PHUITagView()) ->setType(PHUITagView::TYPE_STATE) ->setName('Closed, Resolved'); - $panel = $this->createPanel("Maniphest Hovercard"); + $panel = $this->createPanel('Maniphest Hovercard'); $panel->appendChild(id(new PhabricatorHovercardView()) ->setObjectHandle($task_handle) ->setUser($user) @@ -56,7 +56,7 @@ final class PhabricatorHovercardExample extends PhabricatorUIExample { 'George Washington'); $user_handle->setImageURI( celerity_get_resource_uri('/rsrc/image/people/washington.png')); - $panel = $this->createPanel("Whatevery Hovercard"); + $panel = $this->createPanel('Whatevery Hovercard'); $panel->appendChild(id(new PhabricatorHovercardView()) ->setObjectHandle($user_handle) ->addField(pht('Status'), 'Available') @@ -65,7 +65,7 @@ final class PhabricatorHovercardExample extends PhabricatorUIExample { ->setUser($user)); $elements[] = $panel; - return phutil_implode_html("", $elements); + return phutil_implode_html('', $elements); } private function createPanel($header) { diff --git a/src/applications/xhprof/controller/PhabricatorXHProfProfileController.php b/src/applications/xhprof/controller/PhabricatorXHProfProfileController.php index 48cf29d1f4..9dbf1bd0be 100644 --- a/src/applications/xhprof/controller/PhabricatorXHProfProfileController.php +++ b/src/applications/xhprof/controller/PhabricatorXHProfProfileController.php @@ -23,7 +23,7 @@ final class PhabricatorXHProfProfileController $data = $file->loadFileData(); $data = @json_decode($data, true); if (!$data) { - throw new Exception("Failed to unserialize XHProf profile!"); + throw new Exception('Failed to unserialize XHProf profile!'); } $symbol = $request->getStr('symbol'); diff --git a/src/infrastructure/celerity/CelerityResourceController.php b/src/infrastructure/celerity/CelerityResourceController.php index 8ab192b6f1..286b215053 100644 --- a/src/infrastructure/celerity/CelerityResourceController.php +++ b/src/infrastructure/celerity/CelerityResourceController.php @@ -31,7 +31,7 @@ abstract class CelerityResourceController extends PhabricatorController { $type_map = self::getSupportedResourceTypes(); if (empty($type_map[$type])) { - throw new Exception("Only static resources may be served."); + throw new Exception('Only static resources may be served.'); } $dev_mode = PhabricatorEnv::getEnvConfig('phabricator.developer-mode'); @@ -103,7 +103,7 @@ abstract class CelerityResourceController extends PhabricatorController { // generate a comprehensive list of valid origins (an install may have // arbitrarily many Phame blogs, for example), and we lose nothing by // allowing access from anywhere. - $response->addAllowOrigin("*"); + $response->addAllowOrigin('*'); } return $this->makeResponseCacheable($response); diff --git a/src/infrastructure/celerity/CelerityResourceGraph.php b/src/infrastructure/celerity/CelerityResourceGraph.php index 358c6a0c02..a85c3ffbd8 100644 --- a/src/infrastructure/celerity/CelerityResourceGraph.php +++ b/src/infrastructure/celerity/CelerityResourceGraph.php @@ -8,7 +8,7 @@ final class CelerityResourceGraph extends AbstractDirectedGraph { protected function loadEdges(array $nodes) { if (!$this->graphSet) { throw new Exception( - "Call setResourceGraph before loading the graph!" + 'Call setResourceGraph before loading the graph!' ); } diff --git a/src/infrastructure/celerity/management/CelerityManagementMapWorkflow.php b/src/infrastructure/celerity/management/CelerityManagementMapWorkflow.php index a904c4fea2..29baccf5fd 100644 --- a/src/infrastructure/celerity/management/CelerityManagementMapWorkflow.php +++ b/src/infrastructure/celerity/management/CelerityManagementMapWorkflow.php @@ -17,14 +17,14 @@ final class CelerityManagementMapWorkflow $this->log( pht( - "Rebuilding %d resource source(s).", + 'Rebuilding %d resource source(s).', new PhutilNumber(count($resources_map)))); foreach ($resources_map as $name => $resources) { $this->rebuildResources($resources); } - $this->log(pht("Done.")); + $this->log(pht('Done.')); return 0; } diff --git a/src/infrastructure/daemon/bot/PhabricatorBot.php b/src/infrastructure/daemon/bot/PhabricatorBot.php index fb30fa7b7c..a8f11c0d6e 100644 --- a/src/infrastructure/daemon/bot/PhabricatorBot.php +++ b/src/infrastructure/daemon/bot/PhabricatorBot.php @@ -21,7 +21,7 @@ final class PhabricatorBot extends PhabricatorDaemon { public function run() { $argv = $this->getArgv(); if (count($argv) !== 1) { - throw new Exception("usage: PhabricatorBot "); + throw new Exception('usage: PhabricatorBot '); } $json_raw = Filesystem::readFile($argv[0]); @@ -120,7 +120,7 @@ final class PhabricatorBot extends PhabricatorDaemon { } if ($message->getCommand() == 'LOG') { - $this->log("[LOG] ".$message->getBody()); + $this->log('[LOG] '.$message->getBody()); } foreach ($this->handlers as $handler) { diff --git a/src/infrastructure/daemon/bot/PhabricatorIRCBot.php b/src/infrastructure/daemon/bot/PhabricatorIRCBot.php index 81f6cc0fec..a955ae5610 100644 --- a/src/infrastructure/daemon/bot/PhabricatorIRCBot.php +++ b/src/infrastructure/daemon/bot/PhabricatorIRCBot.php @@ -6,6 +6,6 @@ final class PhabricatorIRCBot extends PhabricatorDaemon { public function run() { throw new Exception( - "This daemon has been deprecated, use `PhabricatorBot` instead."); + 'This daemon has been deprecated, use `PhabricatorBot` instead.'); } } diff --git a/src/infrastructure/daemon/bot/adapter/PhabricatorBotBaseStreamingProtocolAdapter.php b/src/infrastructure/daemon/bot/adapter/PhabricatorBotBaseStreamingProtocolAdapter.php index 1456085eba..2511d739e9 100644 --- a/src/infrastructure/daemon/bot/adapter/PhabricatorBotBaseStreamingProtocolAdapter.php +++ b/src/infrastructure/daemon/bot/adapter/PhabricatorBotBaseStreamingProtocolAdapter.php @@ -23,7 +23,7 @@ abstract class PhabricatorBotBaseStreamingProtocolAdapter // First, join the room if (!$rooms) { - throw new Exception("Not configured to join any rooms!"); + throw new Exception('Not configured to join any rooms!'); } $this->readBuffers = array(); @@ -49,7 +49,7 @@ abstract class PhabricatorBotBaseStreamingProtocolAdapter curl_setopt( $this->readHandle[$url], CURLOPT_HTTPHEADER, - array("Content-type: application/json")); + array('Content-type: application/json')); curl_setopt( $this->readHandle[$url], CURLOPT_WRITEFUNCTION, @@ -88,7 +88,7 @@ abstract class PhabricatorBotBaseStreamingProtocolAdapter // Check for errors if ($status != CURLM_OK) { throw new Exception( - "Phabricator Bot had a problem reading from stream."); + 'Phabricator Bot had a problem reading from stream.'); } } @@ -96,7 +96,7 @@ abstract class PhabricatorBotBaseStreamingProtocolAdapter $messages = array(); if (!$this->active) { - throw new Exception("Phabricator Bot stopped reading from stream."); + throw new Exception('Phabricator Bot stopped reading from stream.'); } // Prod our http request diff --git a/src/infrastructure/daemon/bot/adapter/PhabricatorBotFlowdockProtocolAdapter.php b/src/infrastructure/daemon/bot/adapter/PhabricatorBotFlowdockProtocolAdapter.php index 86da1f5541..dc3b568a88 100644 --- a/src/infrastructure/daemon/bot/adapter/PhabricatorBotFlowdockProtocolAdapter.php +++ b/src/infrastructure/daemon/bot/adapter/PhabricatorBotFlowdockProtocolAdapter.php @@ -11,7 +11,7 @@ final class PhabricatorBotFlowdockProtocolAdapter $organization = $this->getConfig('organization'); $ssl = $this->getConfig('ssl'); - $url = ($ssl) ? "https://" : "http://"; + $url = ($ssl) ? 'https://' : 'http://'; $url .= "stream.flowdock.com/flows/{$organization}/{$channel}"; return $url; @@ -60,7 +60,7 @@ final class PhabricatorBotFlowdockProtocolAdapter $body, PhabricatorBotTarget $flow) { - list($organization, $room_id) = explode(":", $flow->getName()); + list($organization, $room_id) = explode(':', $flow->getName()); $this->performPost( "/flows/{$organization}/{$room_id}/messages", diff --git a/src/infrastructure/daemon/bot/adapter/PhabricatorCampfireProtocolAdapter.php b/src/infrastructure/daemon/bot/adapter/PhabricatorCampfireProtocolAdapter.php index b3afaa8a06..42054ec723 100644 --- a/src/infrastructure/daemon/bot/adapter/PhabricatorCampfireProtocolAdapter.php +++ b/src/infrastructure/daemon/bot/adapter/PhabricatorCampfireProtocolAdapter.php @@ -10,7 +10,7 @@ final class PhabricatorCampfireProtocolAdapter protected function buildStreamingUrl($channel) { $ssl = $this->getConfig('ssl'); - $url = ($ssl) ? "https://" : "http://"; + $url = ($ssl) ? 'https://' : 'http://'; $url .= "streaming.campfirenow.com/room/{$channel}/live.json"; return $url; diff --git a/src/infrastructure/daemon/bot/adapter/PhabricatorIRCProtocolAdapter.php b/src/infrastructure/daemon/bot/adapter/PhabricatorIRCProtocolAdapter.php index c9d701d36e..d2740209b0 100644 --- a/src/infrastructure/daemon/bot/adapter/PhabricatorIRCProtocolAdapter.php +++ b/src/infrastructure/daemon/bot/adapter/PhabricatorIRCProtocolAdapter.php @@ -47,7 +47,7 @@ final class PhabricatorIRCProtocolAdapter } $ok = stream_set_blocking($socket, false); if (!$ok) { - throw new Exception("Failed to set stream nonblocking."); + throw new Exception('Failed to set stream nonblocking.'); } $this->socket = $socket; @@ -72,7 +72,7 @@ final class PhabricatorIRCProtocolAdapter $ok = @stream_select($read, $write, $except, $timeout_sec = 1); if ($ok === false) { throw new Exception( - "socket_select() failed: ".socket_strerror(socket_last_error())); + 'socket_select() failed: '.socket_strerror(socket_last_error())); } if ($read) { @@ -82,16 +82,16 @@ final class PhabricatorIRCProtocolAdapter // This indicates the connection was terminated on the other side, // just exit via exception and let the overseer restart us after a // delay so we can reconnect. - throw new Exception("Remote host closed connection."); + throw new Exception('Remote host closed connection.'); } do { $data = fread($this->socket, 4096); if ($data === false) { - throw new Exception("fread() failed!"); + throw new Exception('fread() failed!'); } else { $messages[] = id(new PhabricatorBotMessage()) - ->setCommand("LOG") - ->setBody(">>> ".$data); + ->setCommand('LOG') + ->setBody('>>> '.$data); $this->readBuffer .= $data; } } while (strlen($data)); @@ -101,11 +101,11 @@ final class PhabricatorIRCProtocolAdapter do { $len = fwrite($this->socket, $this->writeBuffer); if ($len === false) { - throw new Exception("fwrite() failed!"); + throw new Exception('fwrite() failed!'); } else { $messages[] = id(new PhabricatorBotMessage()) - ->setCommand("LOG") - ->setBody(">>> ".substr($this->writeBuffer, 0, $len)); + ->setCommand('LOG') + ->setBody('>>> '.substr($this->writeBuffer, 0, $len)); $this->writeBuffer = substr($this->writeBuffer, $len); } } while (strlen($this->writeBuffer)); @@ -199,7 +199,7 @@ final class PhabricatorIRCProtocolAdapter } $join = $this->getConfig('join'); if (!$join) { - throw new Exception("Not configured to join any channels!"); + throw new Exception('Not configured to join any channels!'); } foreach ($join as $channel) { $this->write("JOIN {$channel}"); @@ -251,7 +251,7 @@ final class PhabricatorIRCProtocolAdapter } public function __destruct() { - $this->write("QUIT Goodbye."); + $this->write('QUIT Goodbye.'); fclose($this->socket); } } diff --git a/src/infrastructure/daemon/bot/handler/PhabricatorBotHandler.php b/src/infrastructure/daemon/bot/handler/PhabricatorBotHandler.php index 77ac1891e6..9dd449b155 100644 --- a/src/infrastructure/daemon/bot/handler/PhabricatorBotHandler.php +++ b/src/infrastructure/daemon/bot/handler/PhabricatorBotHandler.php @@ -50,7 +50,7 @@ abstract class PhabricatorBotHandler { public function replyTo(PhabricatorBotMessage $original_message, $body) { if ($original_message->getCommand() != 'MESSAGE') { throw new Exception( - "Handler is trying to reply to something which is not a message!"); + 'Handler is trying to reply to something which is not a message!'); } $reply = id(new PhabricatorBotMessage()) diff --git a/src/infrastructure/daemon/bot/handler/PhabricatorBotObjectNameHandler.php b/src/infrastructure/daemon/bot/handler/PhabricatorBotObjectNameHandler.php index 9d7ac4a19f..800f5aa767 100644 --- a/src/infrastructure/daemon/bot/handler/PhabricatorBotObjectNameHandler.php +++ b/src/infrastructure/daemon/bot/handler/PhabricatorBotObjectNameHandler.php @@ -126,7 +126,7 @@ final class PhabricatorBotObjectNameHandler extends PhabricatorBotHandler { array( 'id' => $file_id, )); - $output[$file['phid']] = $file['objectName'].": ".$file['uri']." - ". + $output[$file['phid']] = $file['objectName'].': '.$file['uri'].' - '. $file['name']; } } diff --git a/src/infrastructure/daemon/bot/handler/PhabricatorIRCProtocolHandler.php b/src/infrastructure/daemon/bot/handler/PhabricatorIRCProtocolHandler.php index 3f3ee28638..8eee254c47 100644 --- a/src/infrastructure/daemon/bot/handler/PhabricatorIRCProtocolHandler.php +++ b/src/infrastructure/daemon/bot/handler/PhabricatorIRCProtocolHandler.php @@ -9,7 +9,7 @@ final class PhabricatorIRCProtocolHandler extends PhabricatorBotHandler { static $warned; if (!$warned) { $warned = true; - phlog("The PhabricatorIRCProtocolHandler has been deprecated."); + phlog('The PhabricatorIRCProtocolHandler has been deprecated.'); } } diff --git a/src/infrastructure/daemon/workers/PhabricatorWorker.php b/src/infrastructure/daemon/workers/PhabricatorWorker.php index dbe4fbdd46..b162f4344a 100644 --- a/src/infrastructure/daemon/workers/PhabricatorWorker.php +++ b/src/infrastructure/daemon/workers/PhabricatorWorker.php @@ -187,7 +187,7 @@ abstract class PhabricatorWorker { foreach ($tasks as $task) { if ($task->getResult() != PhabricatorWorkerArchiveTask::RESULT_SUCCESS) { throw new Exception( - pht("Task %d failed!", $task->getID())); + pht('Task %d failed!', $task->getID())); } } } diff --git a/src/infrastructure/daemon/workers/__tests__/PhabricatorTestWorker.php b/src/infrastructure/daemon/workers/__tests__/PhabricatorTestWorker.php index 313074cc90..f871a00fb0 100644 --- a/src/infrastructure/daemon/workers/__tests__/PhabricatorTestWorker.php +++ b/src/infrastructure/daemon/workers/__tests__/PhabricatorTestWorker.php @@ -27,10 +27,10 @@ final class PhabricatorTestWorker extends PhabricatorWorker { switch (idx($this->getTaskData(), 'doWork')) { case 'fail-temporary': throw new Exception( - "Temporary failure!"); + 'Temporary failure!'); case 'fail-permanent': throw new PhabricatorWorkerPermanentFailureException( - "Permanent failure!"); + 'Permanent failure!'); default: return; } diff --git a/src/infrastructure/daemon/workers/query/PhabricatorWorkerLeaseQuery.php b/src/infrastructure/daemon/workers/query/PhabricatorWorkerLeaseQuery.php index 7d21cc5c29..3447206173 100644 --- a/src/infrastructure/daemon/workers/query/PhabricatorWorkerLeaseQuery.php +++ b/src/infrastructure/daemon/workers/query/PhabricatorWorkerLeaseQuery.php @@ -33,7 +33,7 @@ final class PhabricatorWorkerLeaseQuery extends PhabricatorQuery { public function execute() { if (!$this->limit) { - throw new Exception("You must setLimit() when leasing tasks."); + throw new Exception('You must setLimit() when leasing tasks.'); } $task_table = new PhabricatorWorkerActiveTask(); diff --git a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php index a8eca94cb5..c40ebbb824 100644 --- a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php +++ b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php @@ -67,8 +67,8 @@ final class PhabricatorWorkerActiveTask extends PhabricatorWorkerTask { public function delete() { throw new Exception( - "Active tasks can not be deleted directly. ". - "Use archiveTask() to move tasks to the archive."); + 'Active tasks can not be deleted directly. '. + 'Use archiveTask() to move tasks to the archive.'); } public function archiveTask($result, $duration) { diff --git a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerArchiveTask.php b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerArchiveTask.php index 6cdfa93922..cf985ca880 100644 --- a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerArchiveTask.php +++ b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerArchiveTask.php @@ -12,7 +12,7 @@ final class PhabricatorWorkerArchiveTask extends PhabricatorWorkerTask { public function save() { if ($this->getID() === null) { throw new Exception( - "Trying to archive a task with no ID."); + 'Trying to archive a task with no ID.'); } $other = new PhabricatorWorkerActiveTask(); diff --git a/src/infrastructure/edges/query/PhabricatorEdgeQuery.php b/src/infrastructure/edges/query/PhabricatorEdgeQuery.php index e46c65ad0e..976a35b9ae 100644 --- a/src/infrastructure/edges/query/PhabricatorEdgeQuery.php +++ b/src/infrastructure/edges/query/PhabricatorEdgeQuery.php @@ -160,7 +160,7 @@ final class PhabricatorEdgeQuery extends PhabricatorQuery { public function execute() { if (!$this->sourcePHIDs) { throw new Exception( - "You must use withSourcePHIDs() to query edges."); + 'You must use withSourcePHIDs() to query edges.'); } $sources = phid_group_by_type($this->sourcePHIDs); @@ -257,7 +257,7 @@ final class PhabricatorEdgeQuery extends PhabricatorQuery { array $types = array()) { if ($this->resultSet === null) { throw new Exception( - "You must execute() a query before you you can getDestinationPHIDs()."); + 'You must execute() a query before you you can getDestinationPHIDs().'); } $src_phids = array_fill_keys($src_phids, true); diff --git a/src/infrastructure/edges/util/PhabricatorEdgeGraph.php b/src/infrastructure/edges/util/PhabricatorEdgeGraph.php index 94a11bb2d9..57b422328e 100644 --- a/src/infrastructure/edges/util/PhabricatorEdgeGraph.php +++ b/src/infrastructure/edges/util/PhabricatorEdgeGraph.php @@ -11,7 +11,7 @@ final class PhabricatorEdgeGraph extends AbstractDirectedGraph { protected function loadEdges(array $nodes) { if (!$this->edgeType) { - throw new Exception("Set edge type before loading graph!"); + throw new Exception('Set edge type before loading graph!'); } $edges = id(new PhabricatorEdgeQuery()) diff --git a/src/infrastructure/env/PhabricatorConfigProxySource.php b/src/infrastructure/env/PhabricatorConfigProxySource.php index cb0ede7113..818b55452b 100644 --- a/src/infrastructure/env/PhabricatorConfigProxySource.php +++ b/src/infrastructure/env/PhabricatorConfigProxySource.php @@ -10,7 +10,7 @@ abstract class PhabricatorConfigProxySource final protected function getSource() { if (!$this->source) { - throw new Exception("No configuration source set!"); + throw new Exception('No configuration source set!'); } return $this->source; } diff --git a/src/infrastructure/env/PhabricatorConfigSource.php b/src/infrastructure/env/PhabricatorConfigSource.php index bfbc68d5de..dd52a18c72 100644 --- a/src/infrastructure/env/PhabricatorConfigSource.php +++ b/src/infrastructure/env/PhabricatorConfigSource.php @@ -21,11 +21,11 @@ abstract class PhabricatorConfigSource { } public function setKeys(array $keys) { - throw new Exception("This configuration source does not support writes."); + throw new Exception('This configuration source does not support writes.'); } public function deleteKeys(array $keys) { - throw new Exception("This configuration source does not support writes."); + throw new Exception('This configuration source does not support writes.'); } } diff --git a/src/infrastructure/env/PhabricatorConfigStackSource.php b/src/infrastructure/env/PhabricatorConfigStackSource.php index 2d6f735ffb..a118cf01b8 100644 --- a/src/infrastructure/env/PhabricatorConfigStackSource.php +++ b/src/infrastructure/env/PhabricatorConfigStackSource.php @@ -19,7 +19,7 @@ final class PhabricatorConfigStackSource public function popSource() { if (empty($this->stack)) { - throw new Exception("Popping an empty config stack!"); + throw new Exception('Popping an empty config stack!'); } return array_shift($this->stack); } diff --git a/src/infrastructure/env/PhabricatorEnv.php b/src/infrastructure/env/PhabricatorEnv.php index 8d83ffb4f2..3286a7258d 100644 --- a/src/infrastructure/env/PhabricatorEnv.php +++ b/src/infrastructure/env/PhabricatorEnv.php @@ -139,7 +139,7 @@ final class PhabricatorEnv { $stack->pushSource( id(new PhabricatorConfigLocalSource()) - ->setName(pht("Local Config"))); + ->setName(pht('Local Config'))); // If the install overrides the database adapter, we might need to load // the database adapter class before we can push on the database config. @@ -156,7 +156,7 @@ final class PhabricatorEnv { try { $stack->pushSource( id(new PhabricatorConfigDatabaseSource('default')) - ->setName(pht("Database"))); + ->setName(pht('Database'))); } catch (AphrontQueryException $exception) { // If the database is not available, just skip this configuration // source. This happens during `bin/storage upgrade`, `bin/conf` before @@ -167,7 +167,7 @@ final class PhabricatorEnv { public static function repairConfig($key, $value) { if (!self::$repairSource) { self::$repairSource = id(new PhabricatorConfigDictionarySource(array())) - ->setName(pht("Repaired Config")); + ->setName(pht('Repaired Config')); self::$sourceStack->pushSource(self::$repairSource); } self::$repairSource->setKeys(array($key => $value)); @@ -177,7 +177,7 @@ final class PhabricatorEnv { public static function overrideConfig($key, $value) { if (!self::$overrideSource) { self::$overrideSource = id(new PhabricatorConfigDictionarySource(array())) - ->setName(pht("Overridden Config")); + ->setName(pht('Overridden Config')); self::$sourceStack->pushSource(self::$overrideSource); } self::$overrideSource->setKeys(array($key => $value)); @@ -410,8 +410,8 @@ final class PhabricatorEnv { if ($stack_key !== $key) { self::$sourceStack->pushSource($source); throw new Exception( - "Scoped environments were destroyed in a diffent order than they ". - "were initialized."); + 'Scoped environments were destroyed in a diffent order than they '. + 'were initialized.'); } } diff --git a/src/infrastructure/env/__tests__/PhabricatorEnvTestCase.php b/src/infrastructure/env/__tests__/PhabricatorEnvTestCase.php index 0097a5bef4..5a10b833a0 100644 --- a/src/infrastructure/env/__tests__/PhabricatorEnvTestCase.php +++ b/src/infrastructure/env/__tests__/PhabricatorEnvTestCase.php @@ -141,8 +141,8 @@ final class PhabricatorEnvTestCase extends PhabricatorTestCase { $this->assertTrue( $caught instanceof Exception, - "Destroying a scoped environment which is not on the top of the stack ". - "should throw."); + 'Destroying a scoped environment which is not on the top of the stack '. + 'should throw.'); if (phutil_is_hiphop_runtime()) { $inner->__destruct(); @@ -158,7 +158,7 @@ final class PhabricatorEnvTestCase extends PhabricatorTestCase { public function testGetEnvExceptions() { $caught = null; try { - PhabricatorEnv::getEnvConfig("not.a.real.config.option"); + PhabricatorEnv::getEnvConfig('not.a.real.config.option'); } catch (Exception $ex) { $caught = $ex; } @@ -166,7 +166,7 @@ final class PhabricatorEnvTestCase extends PhabricatorTestCase { $caught = null; try { - PhabricatorEnv::getEnvConfig("test.value"); + PhabricatorEnv::getEnvConfig('test.value'); } catch (Exception $ex) { $caught = $ex; } diff --git a/src/infrastructure/events/PhabricatorEventListener.php b/src/infrastructure/events/PhabricatorEventListener.php index 211cc1f544..abaad375e6 100644 --- a/src/infrastructure/events/PhabricatorEventListener.php +++ b/src/infrastructure/events/PhabricatorEventListener.php @@ -30,7 +30,7 @@ abstract class PhabricatorEventListener extends PhutilEventListener { protected function addActionMenuItems(PhutilEvent $event, $items) { if ($event->getType() !== PhabricatorEventType::TYPE_UI_DIDRENDERACTIONS) { - throw new Exception("Not an action menu event!"); + throw new Exception('Not an action menu event!'); } if (!$items) { diff --git a/src/infrastructure/internationalization/translation/PhabricatorBaseEnglishTranslation.php b/src/infrastructure/internationalization/translation/PhabricatorBaseEnglishTranslation.php index acabccf577..c633b16241 100644 --- a/src/infrastructure/internationalization/translation/PhabricatorBaseEnglishTranslation.php +++ b/src/infrastructure/internationalization/translation/PhabricatorBaseEnglishTranslation.php @@ -654,9 +654,9 @@ abstract class PhabricatorBaseEnglishTranslation '%s Lines', ), - "Indexing %d object(s) of type %s." => array( - "Indexing %d object of type %s.", - "Indexing %d object of type %s.", + 'Indexing %d object(s) of type %s.' => array( + 'Indexing %d object of type %s.', + 'Indexing %d object of type %s.', ), 'Run these %d command(s):' => array( diff --git a/src/infrastructure/lint/linter/PhabricatorJavelinLinter.php b/src/infrastructure/lint/linter/PhabricatorJavelinLinter.php index 018a156121..c69d8aacbc 100644 --- a/src/infrastructure/lint/linter/PhabricatorJavelinLinter.php +++ b/src/infrastructure/lint/linter/PhabricatorJavelinLinter.php @@ -243,7 +243,7 @@ final class PhabricatorJavelinLinter extends ArcanistLinter { $matches = null; if (!preg_match('/^([?+\*])([^:]*):(\d+)$/', $line, $matches)) { throw new Exception( - "Received malformed output from `javelinsymbols`."); + 'Received malformed output from `javelinsymbols`.'); } $type = $matches[1]; $symbol = $matches[2]; diff --git a/src/infrastructure/markup/PhabricatorMarkupEngine.php b/src/infrastructure/markup/PhabricatorMarkupEngine.php index bedbc089da..2f6a030014 100644 --- a/src/infrastructure/markup/PhabricatorMarkupEngine.php +++ b/src/infrastructure/markup/PhabricatorMarkupEngine.php @@ -190,7 +190,7 @@ final class PhabricatorMarkupEngine { if (!isset($this->objects[$key]['output'])) { throw new Exception( - "Call process() before using results."); + 'Call process() before using results.'); } } diff --git a/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php b/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php index 34215d03b4..4e48c729c1 100644 --- a/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php +++ b/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php @@ -163,7 +163,7 @@ abstract class PhabricatorPolicyAwareQuery extends PhabricatorOffsetPagedQuery { } if (count($results) > 1) { - throw new Exception("Expected a single result!"); + throw new Exception('Expected a single result!'); } if (!$results) { @@ -182,7 +182,7 @@ abstract class PhabricatorPolicyAwareQuery extends PhabricatorOffsetPagedQuery { */ final public function execute() { if (!$this->viewer) { - throw new Exception("Call setViewer() before execute()!"); + throw new Exception('Call setViewer() before execute()!'); } $parent_query = $this->getParentQuery(); diff --git a/src/infrastructure/sms/management/PhabricatorSMSManagementListOutboundWorkflow.php b/src/infrastructure/sms/management/PhabricatorSMSManagementListOutboundWorkflow.php index fe861d9628..b1d0c2b899 100644 --- a/src/infrastructure/sms/management/PhabricatorSMSManagementListOutboundWorkflow.php +++ b/src/infrastructure/sms/management/PhabricatorSMSManagementListOutboundWorkflow.php @@ -8,7 +8,7 @@ final class PhabricatorSMSManagementListOutboundWorkflow ->setName('list-outbound') ->setSynopsis('List outbound sms messages sent by Phabricator.') ->setExamples( - "**list-outbound**") + '**list-outbound**') ->setArguments( array( array( @@ -30,7 +30,7 @@ final class PhabricatorSMSManagementListOutboundWorkflow $args->getArg('limit')); if (!$sms_messages) { - $console->writeErr("%s\n", pht("No sent sms.")); + $console->writeErr("%s\n", pht('No sent sms.')); return 0; } @@ -38,7 +38,7 @@ final class PhabricatorSMSManagementListOutboundWorkflow $console->writeOut( "%s\n", sprintf( - "% 8d %-8s To: %s", + '% 8d %-8s To: %s', $sms->getID(), $sms->getSendStatus(), $sms->getToNumber())); diff --git a/src/infrastructure/sms/management/PhabricatorSMSManagementShowOutboundWorkflow.php b/src/infrastructure/sms/management/PhabricatorSMSManagementShowOutboundWorkflow.php index 3dd7922b43..d9bd7e65a0 100644 --- a/src/infrastructure/sms/management/PhabricatorSMSManagementShowOutboundWorkflow.php +++ b/src/infrastructure/sms/management/PhabricatorSMSManagementShowOutboundWorkflow.php @@ -8,7 +8,7 @@ final class PhabricatorSMSManagementShowOutboundWorkflow ->setName('show-outbound') ->setSynopsis('Show diagnostic details about outbound sms.') ->setExamples( - "**show-outbound** --id 1 --id 2") + '**show-outbound** --id 1 --id 2') ->setArguments( array( array( @@ -38,7 +38,7 @@ final class PhabricatorSMSManagementShowOutboundWorkflow $missing = array_diff_key($ids, $messages); if ($missing) { throw new PhutilArgumentUsageException( - "Some specified sms messages do not exist: ". + 'Some specified sms messages do not exist: '. implode(', ', array_keys($missing))); } } diff --git a/src/infrastructure/ssh/PhabricatorSSHPassthruCommand.php b/src/infrastructure/ssh/PhabricatorSSHPassthruCommand.php index e05e0c7fae..5724728676 100644 --- a/src/infrastructure/ssh/PhabricatorSSHPassthruCommand.php +++ b/src/infrastructure/ssh/PhabricatorSSHPassthruCommand.php @@ -84,15 +84,15 @@ final class PhabricatorSSHPassthruCommand extends Phobject { $error_channel = $this->errorChannel; if (!$command_channel) { - throw new Exception("Set a command channel before calling execute()!"); + throw new Exception('Set a command channel before calling execute()!'); } if (!$io_channel) { - throw new Exception("Set an IO channel before calling execute()!"); + throw new Exception('Set an IO channel before calling execute()!'); } if (!$error_channel) { - throw new Exception("Set an error channel before calling execute()!"); + throw new Exception('Set an error channel before calling execute()!'); } $channels = array($command_channel, $io_channel, $error_channel); diff --git a/src/infrastructure/storage/__tests__/QueryFormattingTestCase.php b/src/infrastructure/storage/__tests__/QueryFormattingTestCase.php index b81484f7b2..1e2955bbbc 100644 --- a/src/infrastructure/storage/__tests__/QueryFormattingTestCase.php +++ b/src/infrastructure/storage/__tests__/QueryFormattingTestCase.php @@ -44,7 +44,7 @@ final class QueryFormattingTestCase extends PhabricatorTestCase { qsprintf($conn_r, '%B', null)); $this->assertEqual( - "NULL", + 'NULL', qsprintf($conn_r, '%nB', null)); $this->assertEqual( diff --git a/src/infrastructure/storage/lisk/LiskDAO.php b/src/infrastructure/storage/lisk/LiskDAO.php index 040a93c088..9250c8b7df 100644 --- a/src/infrastructure/storage/lisk/LiskDAO.php +++ b/src/infrastructure/storage/lisk/LiskDAO.php @@ -487,7 +487,7 @@ abstract class LiskDAO { public function loadColumnsWhere(array $columns, $pattern/* , $args... */) { if (!$this->getConfigOption(self::CONFIG_PARTIAL_OBJECTS)) { throw new BadMethodCallException( - "This class does not support partial objects."); + 'This class does not support partial objects.'); } $args = func_get_args(); $data = call_user_func_array( @@ -518,7 +518,7 @@ abstract class LiskDAO { if (count($data) > 1) { throw new AphrontQueryCountException( - "More than 1 result from loadOneWhere()!"); + 'More than 1 result from loadOneWhere()!'); } $data = reset($data); @@ -844,7 +844,7 @@ abstract class LiskDAO { if (count($relatives) > 1) { throw new AphrontQueryCountException( - "More than 1 result from loadOneRelative()!"); + 'More than 1 result from loadOneRelative()!'); } return reset($relatives); @@ -1347,8 +1347,8 @@ abstract class LiskDAO { $id_key = $this->getIDKey(); if (!$id_key) { throw new Exception( - "This DAO does not have a single-part primary key. The method you ". - "called requires a single-part primary key."); + 'This DAO does not have a single-part primary key. The method you '. + 'called requires a single-part primary key.'); } return $id_key; } @@ -1363,8 +1363,8 @@ abstract class LiskDAO { */ protected function generatePHID() { throw new Exception( - "To use CONFIG_AUX_PHID, you need to overload ". - "generatePHID() to perform PHID generation."); + 'To use CONFIG_AUX_PHID, you need to overload '. + 'generatePHID() to perform PHID generation.'); } @@ -1588,7 +1588,7 @@ abstract class LiskDAO { self::$processIsolationLevel--; if (self::$processIsolationLevel < 0) { throw new Exception( - "Lisk process isolation level was reduced below 0."); + 'Lisk process isolation level was reduced below 0.'); } } @@ -1624,7 +1624,7 @@ abstract class LiskDAO { self::$transactionIsolationLevel--; if (self::$transactionIsolationLevel < 0) { throw new Exception( - "Lisk transaction isolation level was reduced below 0."); + 'Lisk transaction isolation level was reduced below 0.'); } else if (self::$transactionIsolationLevel == 0) { foreach (self::$connections as $key => $conn) { if ($conn) { diff --git a/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php b/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php index e9abf0496e..0b96ba1682 100644 --- a/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php +++ b/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php @@ -7,7 +7,7 @@ abstract class PhabricatorLiskDAO extends LiskDAO { private static $namespaceStack = array(); - const ATTACHABLE = ""; + const ATTACHABLE = ''; /* -( Configuring Storage )------------------------------------------------ */ @@ -41,7 +41,7 @@ abstract class PhabricatorLiskDAO extends LiskDAO { $namespace = self::getDefaultStorageNamespace(); } if (!strlen($namespace)) { - throw new Exception("No storage namespace configured!"); + throw new Exception('No storage namespace configured!'); } return $namespace; } diff --git a/src/infrastructure/storage/lisk/__tests__/LiskFixtureTestCase.php b/src/infrastructure/storage/lisk/__tests__/LiskFixtureTestCase.php index 0aae94d444..c65a9af3cd 100644 --- a/src/infrastructure/storage/lisk/__tests__/LiskFixtureTestCase.php +++ b/src/infrastructure/storage/lisk/__tests__/LiskFixtureTestCase.php @@ -67,7 +67,7 @@ final class LiskFixtureTestCase extends PhabricatorTestCase { $this->assertTrue( ($loaded !== null), - "Reads inside transactions should have transaction visibility."); + 'Reads inside transactions should have transaction visibility.'); LiskDAO::beginIsolateAllLiskEffectsToTransactions(); } catch (Exception $ex) { @@ -88,7 +88,7 @@ final class LiskFixtureTestCase extends PhabricatorTestCase { $this->assertEqual(null, $load->load(9999)); $this->assertEqual(null, $load->load('')); $this->assertEqual(null, $load->load('cow')); - $this->assertEqual(null, $load->load($id."cow")); + $this->assertEqual(null, $load->load($id.'cow')); $this->assertTrue((bool)$load->load((int)$id)); $this->assertTrue((bool)$load->load((string)$id)); diff --git a/src/infrastructure/storage/lisk/__tests__/LiskIsolationTestCase.php b/src/infrastructure/storage/lisk/__tests__/LiskIsolationTestCase.php index 844f3ffc09..ad289c1469 100644 --- a/src/infrastructure/storage/lisk/__tests__/LiskIsolationTestCase.php +++ b/src/infrastructure/storage/lisk/__tests__/LiskIsolationTestCase.php @@ -48,8 +48,8 @@ final class LiskIsolationTestCase extends PhabricatorTestCase { $dao->establishLiveConnection('r'); $this->assertFailure( - "LiskIsolationTestDAO did not throw an exception when instructed to ". - "explicitly connect to an external database."); + 'LiskIsolationTestDAO did not throw an exception when instructed to '. + 'explicitly connect to an external database.'); } catch (LiskIsolationTestDAOException $ex) { // Expected, pass. } diff --git a/src/infrastructure/storage/lisk/__tests__/LiskIsolationTestDAO.php b/src/infrastructure/storage/lisk/__tests__/LiskIsolationTestDAO.php index 545accbe6b..3929787173 100644 --- a/src/infrastructure/storage/lisk/__tests__/LiskIsolationTestDAO.php +++ b/src/infrastructure/storage/lisk/__tests__/LiskIsolationTestDAO.php @@ -17,8 +17,8 @@ final class LiskIsolationTestDAO extends LiskDAO { public function establishLiveConnection($mode) { throw new LiskIsolationTestDAOException( - "Isolation failure! DAO is attempting to connect to an external ". - "resource!"); + 'Isolation failure! DAO is attempting to connect to an external '. + 'resource!'); } public function getConnectionNamespace() { diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDestroyWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDestroyWorkflow.php index d26625e5c9..46ef6d3cf3 100644 --- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDestroyWorkflow.php +++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDestroyWorkflow.php @@ -12,8 +12,8 @@ final class PhabricatorStorageManagementDestroyWorkflow array( array( 'name' => 'unittest-fixtures', - 'help' => "Restrict **destroy** operations to databases created ". - "by PhabricatorTestCase test fixtures.", + 'help' => 'Restrict **destroy** operations to databases created '. + 'by PhabricatorTestCase test fixtures.', ))); } @@ -23,9 +23,9 @@ final class PhabricatorStorageManagementDestroyWorkflow if (!$is_dry && !$is_force) { echo phutil_console_wrap( - "Are you completely sure you really want to permanently destroy all ". - "storage for Phabricator data? This operation can not be undone and ". - "your data will not be recoverable if you proceed."); + 'Are you completely sure you really want to permanently destroy all '. + 'storage for Phabricator data? This operation can not be undone and '. + 'your data will not be recoverable if you proceed.'); if (!phutil_console_confirm('Permanently destroy all data?')) { echo "Cancelled.\n"; diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementProbeWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementProbeWorkflow.php index d40d1e94ab..416b3893db 100644 --- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementProbeWorkflow.php +++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementProbeWorkflow.php @@ -14,7 +14,7 @@ final class PhabricatorStorageManagementProbeWorkflow $console = PhutilConsole::getConsole(); $console->writeErr( "%s\n", - pht("Analyzing table sizes (this may take a moment)...")); + pht('Analyzing table sizes (this may take a moment)...')); $api = $this->getAPI(); $patches = $this->getPatches(); @@ -45,25 +45,25 @@ final class PhabricatorStorageManagementProbeWorkflow } } - $console->writeOut("%s\n", pht("APPROXIMATE TABLE SIZES")); + $console->writeOut("%s\n", pht('APPROXIMATE TABLE SIZES')); asort($totals); foreach ($totals as $db => $size) { $database_size = $this->formatSize($totals[$db], $overall); $console->writeOut( "**%s**\n", - sprintf("%-32.32s %18s", $db, $database_size)); + sprintf('%-32.32s %18s', $db, $database_size)); $data[$db] = isort($data[$db], '_totalSize'); foreach ($data[$db] as $table => $info) { $table_size = $this->formatSize($info['_totalSize'], $overall); $console->writeOut( "%s\n", - sprintf(" %-28.28s %18s", $table, $table_size)); + sprintf(' %-28.28s %18s', $table, $table_size)); } } $overall_size = $this->formatSize($overall, $overall); $console->writeOut( "**%s**\n", - sprintf("%-32.32s %18s", pht('TOTAL'), $overall_size)); + sprintf('%-32.32s %18s', pht('TOTAL'), $overall_size)); return 0; } diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementStatusWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementStatusWorkflow.php index ee583e8107..2a259b928d 100644 --- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementStatusWorkflow.php +++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementStatusWorkflow.php @@ -33,7 +33,7 @@ final class PhabricatorStorageManagementStatusWorkflow printf( "% -".($len + 2)."s ". - "%-".strlen("Not Applied")."s ". + "%-".strlen('Not Applied')."s ". "%-4s ". "%s\n", diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementUpgradeWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementUpgradeWorkflow.php index 86f35882cb..8479a4e925 100644 --- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementUpgradeWorkflow.php +++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementUpgradeWorkflow.php @@ -7,7 +7,7 @@ final class PhabricatorStorageManagementUpgradeWorkflow $this ->setName('upgrade') ->setExamples('**upgrade** [__options__]') - ->setSynopsis("Upgrade database schemata.") + ->setSynopsis('Upgrade database schemata.') ->setArguments( array( array( @@ -38,9 +38,9 @@ final class PhabricatorStorageManagementUpgradeWorkflow if (!$is_dry && !$is_force) { echo phutil_console_wrap( - "Before running storage upgrades, you should take down the ". - "Phabricator web interface and stop any running Phabricator ". - "daemons (you can disable this warning with --force)."); + 'Before running storage upgrades, you should take down the '. + 'Phabricator web interface and stop any running Phabricator '. + 'daemons (you can disable this warning with --force).'); if (!phutil_console_confirm('Are you ready to continue?')) { echo "Cancelled.\n"; @@ -71,8 +71,8 @@ final class PhabricatorStorageManagementUpgradeWorkflow if ($apply_only) { throw new PhutilArgumentUsageException( - "Storage has not been initialized yet, you must initialize storage ". - "before selectively applying patches."); + 'Storage has not been initialized yet, you must initialize storage '. + 'before selectively applying patches.'); return 1; } @@ -178,7 +178,7 @@ final class PhabricatorStorageManagementUpgradeWorkflow if (!$applied_something) { if (count($patches)) { throw new Exception( - "Some patches could not be applied: ". + 'Some patches could not be applied: '. implode(', ', array_keys($patches))); } else if (!$is_dry && !$apply_only) { echo "Storage is up to date. Use 'storage status' for details.\n"; diff --git a/src/infrastructure/testing/PhabricatorTestCase.php b/src/infrastructure/testing/PhabricatorTestCase.php index e4d5868461..a2e322b380 100644 --- a/src/infrastructure/testing/PhabricatorTestCase.php +++ b/src/infrastructure/testing/PhabricatorTestCase.php @@ -128,8 +128,8 @@ abstract class PhabricatorTestCase extends ArcanistPhutilTestCase { unset($this->env); } catch (Exception $ex) { throw new Exception( - "Some test called PhabricatorEnv::beginScopedEnv(), but is still ". - "holding a reference to the scoped environment!"); + 'Some test called PhabricatorEnv::beginScopedEnv(), but is still '. + 'holding a reference to the scoped environment!'); } } @@ -206,8 +206,8 @@ abstract class PhabricatorTestCase extends ArcanistPhutilTestCase { public static function assertExecutingUnitTests() { if (!self::$testsAreRunning) { throw new Exception( - "Executing test code outside of test execution! This code path can ". - "only be run during unit tests."); + 'Executing test code outside of test execution! This code path can '. + 'only be run during unit tests.'); } } diff --git a/src/infrastructure/time/PhabricatorTime.php b/src/infrastructure/time/PhabricatorTime.php index ec5680331d..d1eb281e1c 100644 --- a/src/infrastructure/time/PhabricatorTime.php +++ b/src/infrastructure/time/PhabricatorTime.php @@ -25,7 +25,7 @@ final class PhabricatorTime { public static function popTime($key) { if ($key !== last_key(self::$stack)) { - throw new Exception("PhabricatorTime::popTime with bad key."); + throw new Exception('PhabricatorTime::popTime with bad key.'); } array_pop(self::$stack); diff --git a/src/infrastructure/util/PhabricatorHash.php b/src/infrastructure/util/PhabricatorHash.php index 1ba1bde4f8..64f02b867f 100644 --- a/src/infrastructure/util/PhabricatorHash.php +++ b/src/infrastructure/util/PhabricatorHash.php @@ -30,7 +30,7 @@ final class PhabricatorHash { public static function digestPassword(PhutilOpaqueEnvelope $envelope, $salt) { $result = $envelope->openEnvelope(); if (!$result) { - throw new Exception("Trying to digest empty password!"); + throw new Exception('Trying to digest empty password!'); } for ($ii = 0; $ii < 1000; $ii++) { @@ -58,13 +58,13 @@ final class PhabricatorHash { static $map; if ($map === null) { - $map = "0123456789". - "abcdefghij". - "klmnopqrst". - "uvwxyzABCD". - "EFGHIJKLMN". - "OPQRSTUVWX". - "YZ._"; + $map = '0123456789'. + 'abcdefghij'. + 'klmnopqrst'. + 'uvwxyzABCD'. + 'EFGHIJKLMN'. + 'OPQRSTUVWX'. + 'YZ._'; } $result = ''; diff --git a/src/infrastructure/util/__tests__/PhabricatorSlugTestCase.php b/src/infrastructure/util/__tests__/PhabricatorSlugTestCase.php index 29d371d2e1..faefb51382 100644 --- a/src/infrastructure/util/__tests__/PhabricatorSlugTestCase.php +++ b/src/infrastructure/util/__tests__/PhabricatorSlugTestCase.php @@ -14,7 +14,7 @@ final class PhabricatorSlugTestCase extends PhabricatorTestCase { 'DERP//DERP' => 'derp/derp/', 'a B c' => 'a_b_c/', '-1~2.3abcd' => '-1~2.3abcd/', - "T\x00O\x00D\x00O" => "t_o_d_o/", + "T\x00O\x00D\x00O" => 't_o_d_o/', 'x#%&+=\\?<> y' => 'x_y/', "\xE2\x98\x83" => "\xE2\x98\x83/", '..' => 'dotdot/', diff --git a/src/infrastructure/util/password/PhabricatorBcryptPasswordHasher.php b/src/infrastructure/util/password/PhabricatorBcryptPasswordHasher.php index cc8dacfc80..941d022070 100644 --- a/src/infrastructure/util/password/PhabricatorBcryptPasswordHasher.php +++ b/src/infrastructure/util/password/PhabricatorBcryptPasswordHasher.php @@ -28,7 +28,7 @@ final class PhabricatorBcryptPasswordHasher } public function getHumanReadableStrength() { - return pht("Good"); + return pht('Good'); } protected function getPasswordHash(PhutilOpaqueEnvelope $envelope) { diff --git a/src/infrastructure/util/password/PhabricatorIteratedMD5PasswordHasher.php b/src/infrastructure/util/password/PhabricatorIteratedMD5PasswordHasher.php index 2847352f09..5ab335b7a1 100644 --- a/src/infrastructure/util/password/PhabricatorIteratedMD5PasswordHasher.php +++ b/src/infrastructure/util/password/PhabricatorIteratedMD5PasswordHasher.php @@ -29,7 +29,7 @@ final class PhabricatorIteratedMD5PasswordHasher } public function getHumanReadableStrength() { - return pht("Okay"); + return pht('Okay'); } protected function getPasswordHash(PhutilOpaqueEnvelope $envelope) { diff --git a/src/view/AphrontDialogView.php b/src/view/AphrontDialogView.php index 96d7ac3119..9a71350136 100644 --- a/src/view/AphrontDialogView.php +++ b/src/view/AphrontDialogView.php @@ -203,7 +203,7 @@ final class AphrontDialogView extends AphrontView { if (!$this->user) { throw new Exception( - pht("You must call setUser() when rendering an AphrontDialogView.")); + pht('You must call setUser() when rendering an AphrontDialogView.')); } $more = $this->class; diff --git a/src/view/__tests__/PhabricatorAphrontViewTestCase.php b/src/view/__tests__/PhabricatorAphrontViewTestCase.php index 4d0d67c690..d0cc0d40f9 100644 --- a/src/view/__tests__/PhabricatorAphrontViewTestCase.php +++ b/src/view/__tests__/PhabricatorAphrontViewTestCase.php @@ -18,7 +18,7 @@ final class PhabricatorAphrontViewTestCase extends PhabricatorTestCase { $this->assertFalse($view->hasChildren()); } - $view->appendChild("!"); + $view->appendChild('!'); $this->assertTrue($view->hasChildren()); } diff --git a/src/view/control/AphrontCursorPagerView.php b/src/view/control/AphrontCursorPagerView.php index 1cc2dc8472..59fc86493e 100644 --- a/src/view/control/AphrontCursorPagerView.php +++ b/src/view/control/AphrontCursorPagerView.php @@ -89,7 +89,7 @@ final class AphrontCursorPagerView extends AphrontView { public function getFirstPageURI() { if (!$this->uri) { throw new Exception( - pht("You must call setURI() before you can call getFirstPageURI().")); + pht('You must call setURI() before you can call getFirstPageURI().')); } if (!$this->afterID && !($this->beforeID && $this->moreResults)) { @@ -104,7 +104,7 @@ final class AphrontCursorPagerView extends AphrontView { public function getPrevPageURI() { if (!$this->uri) { throw new Exception( - pht("You must call setURI() before you can call getPrevPageURI().")); + pht('You must call setURI() before you can call getPrevPageURI().')); } if (!$this->prevPageID) { @@ -119,7 +119,7 @@ final class AphrontCursorPagerView extends AphrontView { public function getNextPageURI() { if (!$this->uri) { throw new Exception( - pht("You must call setURI() before you can call getNextPageURI().")); + pht('You must call setURI() before you can call getNextPageURI().')); } if (!$this->nextPageID) { @@ -134,7 +134,7 @@ final class AphrontCursorPagerView extends AphrontView { public function render() { if (!$this->uri) { throw new Exception( - pht("You must call setURI() before you can call render().")); + pht('You must call setURI() before you can call render().')); } $links = array(); @@ -146,7 +146,7 @@ final class AphrontCursorPagerView extends AphrontView { array( 'href' => $first_uri, ), - "\xC2\xAB ". pht("First")); + "\xC2\xAB ". pht('First')); } $prev_uri = $this->getPrevPageURI(); @@ -156,7 +156,7 @@ final class AphrontCursorPagerView extends AphrontView { array( 'href' => $prev_uri, ), - "\xE2\x80\xB9 " . pht("Prev")); + "\xE2\x80\xB9 " . pht('Prev')); } $next_uri = $this->getNextPageURI(); @@ -166,7 +166,7 @@ final class AphrontCursorPagerView extends AphrontView { array( 'href' => $next_uri, ), - pht("Next") . " \xE2\x80\xBA"); + pht('Next') . " \xE2\x80\xBA"); } return phutil_tag( diff --git a/src/view/control/AphrontPagerView.php b/src/view/control/AphrontPagerView.php index b80b91692c..ba6a98736c 100644 --- a/src/view/control/AphrontPagerView.php +++ b/src/view/control/AphrontPagerView.php @@ -110,7 +110,7 @@ final class AphrontPagerView extends AphrontView { public function render() { if (!$this->uri) { throw new Exception( - pht("You must call setURI() before you can call render().")); + pht('You must call setURI() before you can call render().')); } require_celerity_resource('aphront-pager-view-css'); diff --git a/src/view/form/PHUIFormLayoutView.php b/src/view/form/PHUIFormLayoutView.php index 3ff5f02670..fa05a72a59 100644 --- a/src/view/form/PHUIFormLayoutView.php +++ b/src/view/form/PHUIFormLayoutView.php @@ -27,7 +27,7 @@ final class PHUIFormLayoutView extends AphrontView { public function appendRemarkupInstructions($remarkup) { if ($this->getUser() === null) { throw new Exception( - "Call `setUser` before appending Remarkup to PHUIFormLayoutView."); + 'Call `setUser` before appending Remarkup to PHUIFormLayoutView.'); } return $this->appendInstructions( diff --git a/src/view/form/PHUIFormPageView.php b/src/view/form/PHUIFormPageView.php index c945094957..7b45edb255 100644 --- a/src/view/form/PHUIFormPageView.php +++ b/src/view/form/PHUIFormPageView.php @@ -85,7 +85,7 @@ class PHUIFormPageView extends AphrontView { $name = $control->getName(); if (!strlen($name)) { - throw new Exception("Form control has no name!"); + throw new Exception('Form control has no name!'); } if (isset($this->controls[$name])) { @@ -117,7 +117,7 @@ class PHUIFormPageView extends AphrontView { public function setPagedFormView(PHUIPagedFormView $view, $key) { if ($this->key) { - throw new Exception("This page is already part of a form!"); + throw new Exception('This page is already part of a form!'); } $this->form = $view; $this->key = $key; diff --git a/src/view/form/PHUIPagedFormView.php b/src/view/form/PHUIPagedFormView.php index 034c86a1eb..11b1db9441 100644 --- a/src/view/form/PHUIPagedFormView.php +++ b/src/view/form/PHUIPagedFormView.php @@ -226,7 +226,7 @@ final class PHUIPagedFormView extends AphrontTagView { $selected_page = $this->getSelectedPage(); if (!$selected_page) { - throw new Exception("No selected page!"); + throw new Exception('No selected page!'); } $form->addHiddenInput( @@ -254,7 +254,7 @@ final class PHUIPagedFormView extends AphrontTagView { } if ($this->isLastPage($selected_page)) { - $submit->addSubmitButton(pht("Save")); + $submit->addSubmitButton(pht('Save')); } else { $submit->addSubmitButton(pht("Continue \xC2\xBB")); } diff --git a/src/view/form/control/AphrontFormControl.php b/src/view/form/control/AphrontFormControl.php index bdb0513c82..ab4022a147 100644 --- a/src/view/form/control/AphrontFormControl.php +++ b/src/view/form/control/AphrontFormControl.php @@ -133,7 +133,7 @@ abstract class AphrontFormControl extends AphrontView { public function setFormPage(PHUIFormPageView $page) { if ($this->formPage) { - throw new Exception("This control is already a member of a page!"); + throw new Exception('This control is already a member of a page!'); } $this->formPage = $page; return $this; @@ -141,7 +141,7 @@ abstract class AphrontFormControl extends AphrontView { public function getFormPage() { if ($this->formPage === null) { - throw new Exception("This control does not have a page!"); + throw new Exception('This control does not have a page!'); } return $this->formPage; } diff --git a/src/view/form/control/AphrontFormDateControl.php b/src/view/form/control/AphrontFormDateControl.php index b8c781f2bb..38c96b8861 100644 --- a/src/view/form/control/AphrontFormDateControl.php +++ b/src/view/form/control/AphrontFormDateControl.php @@ -286,7 +286,7 @@ final class AphrontFormDateControl extends AphrontFormControl { $user = $this->getUser(); if (!$this->getUser()) { - throw new Exception("Call setUser() before getTimezone()!"); + throw new Exception('Call setUser() before getTimezone()!'); } $user_zone = $user->getTimezoneIdentifier(); diff --git a/src/view/form/control/AphrontFormPolicyControl.php b/src/view/form/control/AphrontFormPolicyControl.php index ee7d8edf1d..0009e4836b 100644 --- a/src/view/form/control/AphrontFormPolicyControl.php +++ b/src/view/form/control/AphrontFormPolicyControl.php @@ -113,10 +113,10 @@ final class AphrontFormPolicyControl extends AphrontFormControl { protected function renderInput() { if (!$this->object) { - throw new Exception(pht("Call setPolicyObject() before rendering!")); + throw new Exception(pht('Call setPolicyObject() before rendering!')); } if (!$this->capability) { - throw new Exception(pht("Call setCapability() before rendering!")); + throw new Exception(pht('Call setCapability() before rendering!')); } $policy = $this->object->getPolicy($this->capability); diff --git a/src/view/layout/AphrontMultiColumnView.php b/src/view/layout/AphrontMultiColumnView.php index ec784f4669..07997c6ee3 100644 --- a/src/view/layout/AphrontMultiColumnView.php +++ b/src/view/layout/AphrontMultiColumnView.php @@ -66,7 +66,7 @@ final class AphrontMultiColumnView extends AphrontView { if ($this->fluidishLayout || $this->fluidLayout) { // we only support seven columns for now for fluid views; see T4054 if (count($this->columns) > 7) { - throw new Exception("No more than 7 columns per view."); + throw new Exception('No more than 7 columns per view.'); } } diff --git a/src/view/layout/AphrontPanelView.php b/src/view/layout/AphrontPanelView.php index 066d538de6..43905b4c17 100644 --- a/src/view/layout/AphrontPanelView.php +++ b/src/view/layout/AphrontPanelView.php @@ -78,7 +78,7 @@ final class AphrontPanelView extends AphrontView { if ($this->buttons) { $buttons = phutil_tag_div( 'aphront-panel-view-buttons', - phutil_implode_html(" ", $this->buttons)); + phutil_implode_html(' ', $this->buttons)); } $header_elements = phutil_tag_div( 'aphront-panel-header', diff --git a/src/view/layout/AphrontSideNavFilterView.php b/src/view/layout/AphrontSideNavFilterView.php index 57ca640602..058ff15e98 100644 --- a/src/view/layout/AphrontSideNavFilterView.php +++ b/src/view/layout/AphrontSideNavFilterView.php @@ -165,10 +165,10 @@ final class AphrontSideNavFilterView extends AphrontView { public function render() { if ($this->menu->getItems()) { if (!$this->baseURI) { - throw new Exception(pht("Call setBaseURI() before render()!")); + throw new Exception(pht('Call setBaseURI() before render()!')); } if ($this->selectedFilter === false) { - throw new Exception(pht("Call selectFilter() before render()!")); + throw new Exception(pht('Call selectFilter() before render()!')); } } diff --git a/src/view/layout/PhabricatorActionListView.php b/src/view/layout/PhabricatorActionListView.php index c5f156bb09..866cd45492 100644 --- a/src/view/layout/PhabricatorActionListView.php +++ b/src/view/layout/PhabricatorActionListView.php @@ -29,7 +29,7 @@ final class PhabricatorActionListView extends AphrontView { public function render() { if (!$this->user) { - throw new Exception(pht("Call setUser() before render()!")); + throw new Exception(pht('Call setUser() before render()!')); } $event = new PhabricatorEvent( diff --git a/src/view/layout/PhabricatorSourceCodeView.php b/src/view/layout/PhabricatorSourceCodeView.php index bc8a9c81ee..05fab2301c 100644 --- a/src/view/layout/PhabricatorSourceCodeView.php +++ b/src/view/layout/PhabricatorSourceCodeView.php @@ -71,7 +71,7 @@ final class PhabricatorSourceCodeView extends AphrontView { } if ($this->canClickHighlight) { - $line_uri = $this->uri . "$" . $line_number; + $line_uri = $this->uri . '$' . $line_number; $line_href = (string) new PhutilURI($line_uri); $tag_number = javelin_tag( diff --git a/src/view/layout/PhabricatorTransactionView.php b/src/view/layout/PhabricatorTransactionView.php index f87a1f3df9..f0eeb42962 100644 --- a/src/view/layout/PhabricatorTransactionView.php +++ b/src/view/layout/PhabricatorTransactionView.php @@ -49,7 +49,7 @@ final class PhabricatorTransactionView extends AphrontView { public function render() { if (!$this->user) { - throw new Exception(pht("Call setUser() before render()!")); + throw new Exception(pht('Call setUser() before render()!')); } require_celerity_resource('phabricator-transaction-view-css'); diff --git a/src/view/page/PhabricatorStandardPageView.php b/src/view/page/PhabricatorStandardPageView.php index 093287eb6a..8ea05e8fdd 100644 --- a/src/view/page/PhabricatorStandardPageView.php +++ b/src/view/page/PhabricatorStandardPageView.php @@ -101,7 +101,7 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView { if (!$this->getRequest()) { throw new Exception( pht( - "You must set the Request to render a PhabricatorStandardPageView.")); + 'You must set the Request to render a PhabricatorStandardPageView.')); } $console = $this->getConsole(); diff --git a/src/view/phui/PHUIButtonBarView.php b/src/view/phui/PHUIButtonBarView.php index 5e644a29b3..861ea34ebf 100644 --- a/src/view/phui/PHUIButtonBarView.php +++ b/src/view/phui/PHUIButtonBarView.php @@ -27,9 +27,9 @@ final class PHUIButtonBarView extends AphrontTagView { if ($j > 1) { if ($i == 1) { $button->addClass('phui-button-bar-first'); - } elseif ($i == $j) { + } else if ($i == $j) { $button->addClass('phui-button-bar-last'); - } elseif ($j > 1) { + } else if ($j > 1) { $button->addClass('phui-button-bar-middle'); } } diff --git a/src/view/phui/PHUIFeedStoryView.php b/src/view/phui/PHUIFeedStoryView.php index 5fc8745474..9c4c95dfc7 100644 --- a/src/view/phui/PHUIFeedStoryView.php +++ b/src/view/phui/PHUIFeedStoryView.php @@ -256,10 +256,10 @@ final class PHUIFeedStoryView extends AphrontView { public function setAppIconFromPHID($phid) { switch (phid_get_type($phid)) { case PholioPHIDTypeMock::TYPECONST: - $this->setAppIcon("pholio-dark"); + $this->setAppIcon('pholio-dark'); break; case PhabricatorMacroPHIDTypeMacro::TYPECONST: - $this->setAppIcon("macro-dark"); + $this->setAppIcon('macro-dark'); break; case ManiphestPHIDTypeTask::TYPECONST: $this->setAppIcon('maniphest-dark'); diff --git a/src/view/phui/PHUIIconView.php b/src/view/phui/PHUIIconView.php index 77091e9e91..c950f08d3f 100644 --- a/src/view/phui/PHUIIconView.php +++ b/src/view/phui/PHUIIconView.php @@ -76,7 +76,7 @@ final class PHUIIconView extends AphrontTagView { $classes[] = 'sprite-'.$this->spriteSheet; $classes[] = $this->spriteSheet.'-'.$this->spriteIcon; - } elseif ($this->iconFont) { + } else if ($this->iconFont) { require_celerity_resource('phui-font-icon-base-css'); require_celerity_resource('font-fontawesome'); $classes[] = 'phui-font-fa'; diff --git a/src/view/phui/PHUIObjectItemView.php b/src/view/phui/PHUIObjectItemView.php index 80592fe5f9..6dd6c99b8c 100644 --- a/src/view/phui/PHUIObjectItemView.php +++ b/src/view/phui/PHUIObjectItemView.php @@ -182,7 +182,7 @@ final class PHUIObjectItemView extends AphrontTagView { public function addAction(PHUIListItemView $action) { if (count($this->actions) >= 3) { - throw new Exception("Limit 3 actions per item."); + throw new Exception('Limit 3 actions per item.'); } $this->actions[] = $action; return $this; @@ -287,7 +287,7 @@ final class PHUIObjectItemView extends AphrontTagView { case null: break; default: - throw new Exception(pht("Invalid effect!")); + throw new Exception(pht('Invalid effect!')); } if ($this->getGrippable()) { diff --git a/src/view/phui/PHUIRemarkupPreviewPanel.php b/src/view/phui/PHUIRemarkupPreviewPanel.php index 0a98f1decb..3cf49b7939 100644 --- a/src/view/phui/PHUIRemarkupPreviewPanel.php +++ b/src/view/phui/PHUIRemarkupPreviewPanel.php @@ -69,10 +69,10 @@ final class PHUIRemarkupPreviewPanel extends AphrontTagView { protected function getTagContent() { if ($this->previewURI === null) { - throw new Exception("Call setPreviewURI() before rendering!"); + throw new Exception('Call setPreviewURI() before rendering!'); } if ($this->controlID === null) { - throw new Exception("Call setControlID() before rendering!"); + throw new Exception('Call setControlID() before rendering!'); } $preview_id = celerity_generate_unique_node_id(); diff --git a/src/view/phui/PHUITagView.php b/src/view/phui/PHUITagView.php index 5c8c469601..4ab4fa781d 100644 --- a/src/view/phui/PHUITagView.php +++ b/src/view/phui/PHUITagView.php @@ -92,7 +92,7 @@ final class PHUITagView extends AphrontView { public function render() { if (!$this->type) { - throw new Exception(pht("You must call setType() before render()!")); + throw new Exception(pht('You must call setType() before render()!')); } require_celerity_resource('phui-tag-view-css'); diff --git a/src/view/phui/calendar/PHUICalendarMonthView.php b/src/view/phui/calendar/PHUICalendarMonthView.php index 69be7720cd..0b63643af1 100644 --- a/src/view/phui/calendar/PHUICalendarMonthView.php +++ b/src/view/phui/calendar/PHUICalendarMonthView.php @@ -42,7 +42,7 @@ final class PHUICalendarMonthView extends AphrontView { public function render() { if (empty($this->user)) { - throw new Exception("Call setUser() before render()!"); + throw new Exception('Call setUser() before render()!'); } $events = msort($this->events, 'getEpochStart'); diff --git a/src/view/widget/hovercard/PhabricatorHovercardView.php b/src/view/widget/hovercard/PhabricatorHovercardView.php index 8af99ab9bb..8a417452f2 100644 --- a/src/view/widget/hovercard/PhabricatorHovercardView.php +++ b/src/view/widget/hovercard/PhabricatorHovercardView.php @@ -62,14 +62,14 @@ final class PhabricatorHovercardView extends AphrontView { public function render() { if (!$this->handle) { - throw new Exception("Call setObjectHandle() before calling render()!"); + throw new Exception('Call setObjectHandle() before calling render()!'); } $handle = $this->handle; - require_celerity_resource("phabricator-hovercard-view-css"); + require_celerity_resource('phabricator-hovercard-view-css'); - $title = pht("%s: %s", + $title = pht('%s: %s', $handle->getTypeName(), $this->title ? $this->title : $handle->getName()); diff --git a/support/PhabricatorStartup.php b/support/PhabricatorStartup.php index c600de1be0..b39d94785a 100644 --- a/support/PhabricatorStartup.php +++ b/support/PhabricatorStartup.php @@ -209,7 +209,7 @@ final class PhabricatorStartup { public static function beginOutputCapture() { if (self::$capturingOutput) { - self::didFatal("Already capturing output!"); + self::didFatal('Already capturing output!'); } self::$capturingOutput = true; ob_start(); diff --git a/webroot/index.php b/webroot/index.php index 0adaf7322f..8ce3bc5a36 100644 --- a/webroot/index.php +++ b/webroot/index.php @@ -129,7 +129,7 @@ try { $access_log->write(); if ($original_exception) { $ex = new PhutilAggregateException( - "Multiple exceptions during processing and rendering.", + 'Multiple exceptions during processing and rendering.', array( $original_exception, $ex, -- 2.51.2