diff --git a/resources/sql/patches/059.engines.php b/resources/sql/patches/059.engines.php --- a/resources/sql/patches/059.engines.php +++ b/resources/sql/patches/059.engines.php @@ -24,7 +24,7 @@ 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 --- a/resources/sql/patches/079.nametokenindex.php +++ b/resources/sql/patches/079.nametokenindex.php @@ -7,10 +7,10 @@ $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 --- a/resources/sql/patches/090.forceuniqueprojectnames.php +++ b/resources/sql/patches/090.forceuniqueprojectnames.php @@ -64,9 +64,9 @@ } 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 --- a/resources/sql/patches/102.heraldcleanup.php +++ b/resources/sql/patches/102.heraldcleanup.php @@ -24,14 +24,14 @@ 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 --- 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 --- a/resources/sql/patches/131.migraterevisionquery.php +++ b/resources/sql/patches/131.migraterevisionquery.php @@ -5,12 +5,12 @@ $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 --- a/resources/sql/patches/20121209.xmacromigrate.php +++ b/resources/sql/patches/20121209.xmacromigrate.php @@ -1,6 +1,6 @@ openTransaction(); @@ -9,7 +9,7 @@ continue; } - echo "."; + echo '.'; queryfx( $macro->establishConnection('w'), diff --git a/resources/sql/patches/20130201.revisionunsubscribed.php b/resources/sql/patches/20130201.revisionunsubscribed.php --- a/resources/sql/patches/20130201.revisionunsubscribed.php +++ b/resources/sql/patches/20130201.revisionunsubscribed.php @@ -11,7 +11,7 @@ '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 --- a/resources/sql/patches/20130409.commitdrev.php +++ b/resources/sql/patches/20130409.commitdrev.php @@ -22,12 +22,12 @@ $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 --- a/resources/sql/patches/20130502.countdownrevamp2.php +++ b/resources/sql/patches/20130502.countdownrevamp2.php @@ -1,6 +1,6 @@ openTransaction(); @@ -9,7 +9,7 @@ continue; } - echo "."; + echo '.'; queryfx( $countdown->establishConnection('w'), diff --git a/resources/sql/patches/20130703.legalpaddocdenorm.php b/resources/sql/patches/20130703.legalpaddocdenorm.php --- 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 --- a/resources/sql/patches/20130711.pholioimageobsolete.php +++ b/resources/sql/patches/20130711.pholioimageobsolete.php @@ -1,6 +1,6 @@ openTransaction(); @@ -9,7 +9,7 @@ continue; } - echo "."; + echo '.'; queryfx( $image->establishConnection('w'), diff --git a/resources/sql/patches/20131205.buildstepordermig.php b/resources/sql/patches/20131205.buildstepordermig.php --- a/resources/sql/patches/20131205.buildstepordermig.php +++ b/resources/sql/patches/20131205.buildstepordermig.php @@ -13,9 +13,9 @@ $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 @@ 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 --- a/scripts/calendar/import_us_holidays.php +++ b/scripts/calendar/import_us_holidays.php @@ -7,45 +7,45 @@ // 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 --- a/scripts/mail/mail_handler.php +++ b/scripts/mail/mail_handler.php @@ -44,12 +44,12 @@ (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 --- a/scripts/repository/rebuild_summaries.php +++ b/scripts/repository/rebuild_summaries.php @@ -22,7 +22,7 @@ $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 @@ $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 --- a/scripts/repository/reparse.php +++ b/scripts/repository/reparse.php @@ -103,7 +103,7 @@ $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 (!$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 ($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 --- a/scripts/repository/save_lint.php +++ b/scripts/repository/save_lint.php @@ -18,30 +18,30 @@ 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 --- a/scripts/ssh/ssh-auth.php +++ b/scripts/ssh/ssh-auth.php @@ -16,7 +16,7 @@ $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 --- a/scripts/ssh/ssh-exec.php +++ b/scripts/ssh/ssh-exec.php @@ -32,14 +32,14 @@ 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 @@ )); 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 @@ $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 @@ $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 --- a/scripts/symbols/generate_ctags_symbols.php +++ b/scripts/symbols/generate_ctags_symbols.php @@ -35,7 +35,7 @@ $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 @@ // 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 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 --- a/scripts/user/account_admin.php +++ b/scripts/user/account_admin.php @@ -21,15 +21,15 @@ "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 @@ $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 @@ // 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 @@ 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 --- a/scripts/user/add_user.php +++ b/scripts/user/add_user.php @@ -19,8 +19,8 @@ $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 --- a/src/aphront/AphrontRequest.php +++ b/src/aphront/AphrontRequest.php @@ -483,7 +483,7 @@ 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 --- a/src/aphront/configuration/AphrontApplicationConfiguration.php +++ b/src/aphront/configuration/AphrontApplicationConfiguration.php @@ -138,8 +138,8 @@ ->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 --- a/src/aphront/response/AphrontProxyResponse.php +++ b/src/aphront/response/AphrontProxyResponse.php @@ -67,7 +67,7 @@ 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 --- a/src/aphront/sink/AphrontHTTPSink.php +++ b/src/aphront/sink/AphrontHTTPSink.php @@ -50,7 +50,7 @@ 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 --- a/src/aphront/sink/__tests__/AphrontHTTPSinkTestCase.php +++ b/src/aphront/sink/__tests__/AphrontHTTPSinkTestCase.php @@ -36,7 +36,7 @@ public function testHTTPSinkResponseSplitting() { $input = $this->tryTestCaseMap( array( - "test" => true, + 'test' => true, "test\nx" => false, "test\rx" => false, "test\0x" => false, @@ -75,7 +75,7 @@ $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 --- a/src/applications/arcanist/conduit/ConduitAPI_arcanist_projectinfo_Method.php +++ b/src/applications/arcanist/conduit/ConduitAPI_arcanist_projectinfo_Method.php @@ -7,7 +7,7 @@ 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 --- 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 --- a/src/applications/audit/editor/PhabricatorAuditCommentEditor.php +++ b/src/applications/audit/editor/PhabricatorAuditCommentEditor.php @@ -145,7 +145,7 @@ $actor_request = id(new PhabricatorRepositoryAuditRequest()) ->setCommitPHID($commit->getPHID()) ->setAuditorPHID($actor->getPHID()) - ->setAuditReasons(array("Resigned")); + ->setAuditReasons(array('Resigned')); } $actor_request @@ -220,7 +220,7 @@ ->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 --- a/src/applications/audit/mail/PhabricatorAuditReplyHandler.php +++ b/src/applications/audit/mail/PhabricatorAuditReplyHandler.php @@ -4,7 +4,7 @@ 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 @@ 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 --- a/src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php +++ b/src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php @@ -72,7 +72,7 @@ $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 @@ $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 @@ $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 @@ 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 --- a/src/applications/auth/controller/PhabricatorAuthConfirmLinkController.php +++ b/src/applications/auth/controller/PhabricatorAuthConfirmLinkController.php @@ -58,8 +58,8 @@ '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 --- a/src/applications/auth/controller/PhabricatorAuthLoginController.php +++ b/src/applications/auth/controller/PhabricatorAuthLoginController.php @@ -68,7 +68,7 @@ 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 @@ $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 --- a/src/applications/auth/controller/PhabricatorAuthRegisterController.php +++ b/src/applications/auth/controller/PhabricatorAuthRegisterController.php @@ -163,7 +163,7 @@ $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 @@ 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 --- a/src/applications/auth/controller/PhabricatorAuthStartController.php +++ b/src/applications/auth/controller/PhabricatorAuthStartController.php @@ -46,9 +46,9 @@ 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 @@ 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 --- a/src/applications/auth/controller/PhabricatorAuthUnlinkController.php +++ b/src/applications/auth/controller/PhabricatorAuthUnlinkController.php @@ -73,7 +73,7 @@ ->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 @@ ->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 @@ ->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 --- a/src/applications/auth/controller/PhabricatorAuthValidateController.php +++ b/src/applications/auth/controller/PhabricatorAuthValidateController.php @@ -49,8 +49,8 @@ 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 --- a/src/applications/auth/controller/PhabricatorEmailLoginController.php +++ b/src/applications/auth/controller/PhabricatorEmailLoginController.php @@ -26,13 +26,13 @@ $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 @@ 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 --- a/src/applications/auth/controller/config/PhabricatorAuthEditController.php +++ b/src/applications/auth/controller/config/PhabricatorAuthEditController.php @@ -177,8 +177,8 @@ $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 --- a/src/applications/auth/management/PhabricatorAuthManagementLDAPWorkflow.php +++ b/src/applications/auth/management/PhabricatorAuthManagementLDAPWorkflow.php @@ -19,33 +19,33 @@ 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 --- a/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php +++ b/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php @@ -67,12 +67,12 @@ 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 @@ $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 @@ 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 @@ 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 @@ 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 @@ 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 @@ $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 --- a/src/applications/auth/management/PhabricatorAuthManagementStripWorkflow.php +++ b/src/applications/auth/management/PhabricatorAuthManagementStripWorkflow.php @@ -120,7 +120,7 @@ $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 --- a/src/applications/auth/provider/PhabricatorAuthProvider.php +++ b/src/applications/auth/provider/PhabricatorAuthProvider.php @@ -16,7 +16,7 @@ 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 @@ protected function renderLoginForm( AphrontRequest $request, $mode) { - throw new Exception("Not implemented!"); + throw new Exception('Not implemented!'); } public function createProviders() { @@ -198,7 +198,7 @@ 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 @@ } 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 --- a/src/applications/auth/provider/PhabricatorAuthProviderLDAP.php +++ b/src/applications/auth/provider/PhabricatorAuthProviderLDAP.php @@ -167,7 +167,7 @@ $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 @@ "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 --- a/src/applications/auth/provider/PhabricatorAuthProviderOAuth2.php +++ b/src/applications/auth/provider/PhabricatorAuthProviderOAuth2.php @@ -198,7 +198,7 @@ $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 --- a/src/applications/auth/provider/PhabricatorAuthProviderPersona.php +++ b/src/applications/auth/provider/PhabricatorAuthProviderPersona.php @@ -55,12 +55,12 @@ $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 --- a/src/applications/auth/storage/PhabricatorAuthProviderConfigTransaction.php +++ b/src/applications/auth/storage/PhabricatorAuthProviderConfigTransaction.php @@ -7,7 +7,7 @@ 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 --- a/src/applications/base/controller/PhabricatorController.php +++ b/src/applications/base/controller/PhabricatorController.php @@ -251,7 +251,7 @@ 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 @@ 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 --- a/src/applications/base/controller/__tests__/PhabricatorAccessControlTestCase.php +++ b/src/applications/base/controller/__tests__/PhabricatorAccessControlTestCase.php @@ -63,7 +63,7 @@ // Test standard defaults. $this->checkAccess( - "Default", + 'Default', id(clone $controller), $request, array( @@ -82,7 +82,7 @@ $env->overrideEnvConfig('auth.require-email-verification', true); $this->checkAccess( - "Email Verification Required", + 'Email Verification Required', id(clone $controller), $request, array( @@ -97,7 +97,7 @@ )); $this->checkAccess( - "Email Verification Required, With Exception", + 'Email Verification Required, With Exception', id(clone $controller)->setConfig('email', false), $request, array( @@ -116,7 +116,7 @@ // Test admin access. $this->checkAccess( - "Admin Required", + 'Admin Required', id(clone $controller)->setConfig('admin', true), $request, array( @@ -134,7 +134,7 @@ // Test disabled access. $this->checkAccess( - "Allow Disabled", + 'Allow Disabled', id(clone $controller)->setConfig('enabled', false), $request, array( @@ -152,7 +152,7 @@ // Test no login required. $this->checkAccess( - "No Login Required", + 'No Login Required', id(clone $controller)->setConfig('login', false), $request, array( @@ -170,7 +170,7 @@ // Test public access. $this->checkAccess( - "No Login Required", + 'No Login Required', id(clone $controller)->setConfig('public', true), $request, array( @@ -185,7 +185,7 @@ $env->overrideEnvConfig('policy.allow-public', true); $this->checkAccess( - "Public + configured", + 'Public + configured', id(clone $controller)->setConfig('public', true), $request, array( @@ -210,7 +210,7 @@ $app_controller = id(clone $controller)->setCurrentApplication($app); $this->checkAccess( - "Application Controller", + 'Application Controller', $app_controller, $request, array( @@ -225,7 +225,7 @@ )); $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 --- a/src/applications/cache/PhabricatorKeyValueDatabaseCache.php +++ b/src/applications/cache/PhabricatorKeyValueDatabaseCache.php @@ -136,7 +136,7 @@ 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 @@ 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 --- a/src/applications/cache/management/PhabricatorCacheManagementPurgeWorkflow.php +++ b/src/applications/cache/management/PhabricatorCacheManagementPurgeWorkflow.php @@ -52,19 +52,19 @@ } 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 --- a/src/applications/calendar/view/AphrontCalendarEventView.php +++ b/src/applications/calendar/view/AphrontCalendarEventView.php @@ -88,7 +88,7 @@ } 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 --- a/src/applications/chatlog/conduit/ConduitAPI_chatlog_query_Method.php +++ b/src/applications/chatlog/conduit/ConduitAPI_chatlog_query_Method.php @@ -11,7 +11,7 @@ } 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 --- a/src/applications/chatlog/conduit/ConduitAPI_chatlog_record_Method.php +++ b/src/applications/chatlog/conduit/ConduitAPI_chatlog_record_Method.php @@ -11,7 +11,7 @@ } 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 --- a/src/applications/chatlog/controller/PhabricatorChatLogChannelLogController.php +++ b/src/applications/chatlog/controller/PhabricatorChatLogChannelLogController.php @@ -152,7 +152,7 @@ array( 'href' => $first_uri, ), - "\xC2\xAB ". pht("Newest")); + "\xC2\xAB ". pht('Newest')); } $prev_uri = $pager->getPrevPageURI(); @@ -162,7 +162,7 @@ array( 'href' => $prev_uri, ), - "\xE2\x80\xB9 " . pht("Newer")); + "\xE2\x80\xB9 " . pht('Newer')); } $next_uri = $pager->getNextPageURI(); @@ -172,7 +172,7 @@ array( 'href' => $next_uri, ), - pht("Older") . " \xE2\x80\xBA"); + pht('Older') . " \xE2\x80\xBA"); } $pager_top = phutil_tag( @@ -224,7 +224,7 @@ 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 --- a/src/applications/conduit/call/ConduitCall.php +++ b/src/applications/conduit/call/ConduitCall.php @@ -114,7 +114,7 @@ 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 @@ 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 @@ $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 @@ '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 --- a/src/applications/conduit/call/__tests__/ConduitCallTestCase.php +++ b/src/applications/conduit/call/__tests__/ConduitCallTestCase.php @@ -23,6 +23,6 @@ $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 --- a/src/applications/conduit/config/PhabricatorConduitConfigOptions.php +++ b/src/applications/conduit/config/PhabricatorConduitConfigOptions.php @@ -4,18 +4,18 @@ 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 --- a/src/applications/conduit/controller/PhabricatorConduitAPIController.php +++ b/src/applications/conduit/controller/PhabricatorConduitAPIController.php @@ -168,7 +168,7 @@ $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 --- a/src/applications/conduit/method/ConduitAPI_conduit_connect_Method.php +++ b/src/applications/conduit/method/ConduitAPI_conduit_connect_Method.php @@ -14,7 +14,7 @@ } public function getMethodDescription() { - return "Connect a session-based client."; + return 'Connect a session-based client.'; } public function defineParamTypes() { @@ -35,22 +35,22 @@ 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 @@ 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 --- a/src/applications/conduit/method/ConduitAPI_conduit_getcertificate_Method.php +++ b/src/applications/conduit/method/ConduitAPI_conduit_getcertificate_Method.php @@ -15,7 +15,7 @@ } public function getMethodDescription() { - return "Retrieve certificate information for a user."; + return 'Retrieve certificate information for a user.'; } public function defineParamTypes() { @@ -31,10 +31,10 @@ 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 @@ '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 --- a/src/applications/conduit/method/ConduitAPI_conduit_ping_Method.php +++ b/src/applications/conduit/method/ConduitAPI_conduit_ping_Method.php @@ -10,7 +10,7 @@ } 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 --- 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 @@ $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 --- a/src/applications/conduit/protocol/ConduitAPIRequest.php +++ b/src/applications/conduit/protocol/ConduitAPIRequest.php @@ -38,9 +38,9 @@ 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 --- a/src/applications/conduit/ssh/ConduitSSHWorkflow.php +++ b/src/applications/conduit/ssh/ConduitSSHWorkflow.php @@ -18,9 +18,9 @@ $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 @@ $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 --- a/src/applications/config/check/PhabricatorSetupCheckAPC.php +++ b/src/applications/config/check/PhabricatorSetupCheckAPC.php @@ -19,7 +19,7 @@ } 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 --- a/src/applications/config/check/PhabricatorSetupCheckBaseURI.php +++ b/src/applications/config/check/PhabricatorSetupCheckBaseURI.php @@ -55,7 +55,7 @@ $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 --- a/src/applications/config/check/PhabricatorSetupCheckExtraConfig.php +++ b/src/applications/config/check/PhabricatorSetupCheckExtraConfig.php @@ -29,7 +29,7 @@ $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 @@ } $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 --- a/src/applications/config/check/PhabricatorSetupCheckMail.php +++ b/src/applications/config/check/PhabricatorSetupCheckMail.php @@ -41,7 +41,7 @@ '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 @@ '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 @@ '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 --- a/src/applications/config/check/PhabricatorSetupCheckMySQL.php +++ b/src/applications/config/check/PhabricatorSetupCheckMySQL.php @@ -25,12 +25,12 @@ ->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 --- a/src/applications/config/check/PhabricatorSetupCheckPath.php +++ b/src/applications/config/check/PhabricatorSetupCheckPath.php @@ -103,8 +103,8 @@ ->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 --- a/src/applications/config/check/PhabricatorSetupCheckRepositories.php +++ b/src/applications/config/check/PhabricatorSetupCheckRepositories.php @@ -18,8 +18,8 @@ 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 --- a/src/applications/config/check/PhabricatorSetupCheckTimezone.php +++ b/src/applications/config/check/PhabricatorSetupCheckTimezone.php @@ -31,8 +31,8 @@ } $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 --- a/src/applications/config/controller/PhabricatorConfigEditController.php +++ b/src/applications/config/controller/PhabricatorConfigEditController.php @@ -24,8 +24,8 @@ $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 @@ ->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 @@ ->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 --- a/src/applications/config/controller/PhabricatorConfigIgnoreController.php +++ b/src/applications/config/controller/PhabricatorConfigIgnoreController.php @@ -31,8 +31,8 @@ $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 --- a/src/applications/config/controller/PhabricatorConfigIssueListController.php +++ b/src/applications/config/controller/PhabricatorConfigIssueListController.php @@ -15,7 +15,7 @@ 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 --- a/src/applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php +++ b/src/applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php @@ -23,14 +23,14 @@ $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 --- a/src/applications/config/management/PhabricatorConfigManagementGetWorkflow.php +++ b/src/applications/config/management/PhabricatorConfigManagementGetWorkflow.php @@ -23,14 +23,14 @@ $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 --- a/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php +++ b/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php @@ -22,7 +22,7 @@ $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 @@ 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 --- a/src/applications/config/option/PhabricatorAWSConfigOptions.php +++ b/src/applications/config/option/PhabricatorAWSConfigOptions.php @@ -4,11 +4,11 @@ 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 --- a/src/applications/config/option/PhabricatorAccessLogConfigOptions.php +++ b/src/applications/config/option/PhabricatorAccessLogConfigOptions.php @@ -4,57 +4,57 @@ 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 @@ '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 @@ '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 --- a/src/applications/config/option/PhabricatorAuthenticationConfigOptions.php +++ b/src/applications/config/option/PhabricatorAuthenticationConfigOptions.php @@ -4,11 +4,11 @@ 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 @@ $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 @@ "{{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 @@ 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 @@ $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 --- a/src/applications/config/option/PhabricatorConfigOption.php +++ b/src/applications/config/option/PhabricatorConfigOption.php @@ -187,7 +187,7 @@ 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 --- a/src/applications/config/option/PhabricatorCoreConfigOptions.php +++ b/src/applications/config/option/PhabricatorCoreConfigOptions.php @@ -4,11 +4,11 @@ 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 @@ 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 @@ 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 @@ ->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 @@ 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 @@ '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 --- a/src/applications/config/option/PhabricatorDeveloperConfigOptions.php +++ b/src/applications/config/option/PhabricatorDeveloperConfigOptions.php @@ -4,11 +4,11 @@ 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 @@ $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 @@ $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 @@ $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 @@ 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 --- a/src/applications/config/option/PhabricatorDisqusConfigOptions.php +++ b/src/applications/config/option/PhabricatorDisqusConfigOptions.php @@ -4,17 +4,17 @@ 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 --- a/src/applications/config/option/PhabricatorExtendingPhabricatorConfigOptions.php +++ b/src/applications/config/option/PhabricatorExtendingPhabricatorConfigOptions.php @@ -4,29 +4,29 @@ 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 @@ ->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 --- a/src/applications/config/option/PhabricatorGarbageCollectorConfigOptions.php +++ b/src/applications/config/option/PhabricatorGarbageCollectorConfigOptions.php @@ -4,11 +4,11 @@ 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 --- a/src/applications/config/option/PhabricatorMailgunConfigOptions.php +++ b/src/applications/config/option/PhabricatorMailgunConfigOptions.php @@ -4,11 +4,11 @@ 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 --- a/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php +++ b/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php @@ -4,11 +4,11 @@ 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 @@ 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 @@ $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 @@ $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 --- a/src/applications/config/option/PhabricatorMySQLConfigOptions.php +++ b/src/applications/config/option/PhabricatorMySQLConfigOptions.php @@ -4,11 +4,11 @@ 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 @@ $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 @@ 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 @@ 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 @@ $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 --- a/src/applications/config/option/PhabricatorNotificationConfigOptions.php +++ b/src/applications/config/option/PhabricatorNotificationConfigOptions.php @@ -4,11 +4,11 @@ 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 @@ $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 @@ ->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 --- a/src/applications/config/option/PhabricatorPHDConfigOptions.php +++ b/src/applications/config/option/PhabricatorPHDConfigOptions.php @@ -4,11 +4,11 @@ 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 @@ $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 @@ $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 @@ "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 --- a/src/applications/config/option/PhabricatorPHPMailerConfigOptions.php +++ b/src/applications/config/option/PhabricatorPHPMailerConfigOptions.php @@ -4,18 +4,18 @@ 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 --- a/src/applications/config/option/PhabricatorRecaptchaConfigOptions.php +++ b/src/applications/config/option/PhabricatorRecaptchaConfigOptions.php @@ -4,11 +4,11 @@ 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 @@ $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 --- a/src/applications/config/option/PhabricatorSecurityConfigOptions.php +++ b/src/applications/config/option/PhabricatorSecurityConfigOptions.php @@ -4,11 +4,11 @@ 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 @@ 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 @@ ->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 @@ ->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 @@ ->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 @@ '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 @@ '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 @@ $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 --- a/src/applications/config/option/PhabricatorSendGridConfigOptions.php +++ b/src/applications/config/option/PhabricatorSendGridConfigOptions.php @@ -4,11 +4,11 @@ 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 --- a/src/applications/config/option/PhabricatorSyntaxHighlightingConfigOptions.php +++ b/src/applications/config/option/PhabricatorSyntaxHighlightingConfigOptions.php @@ -4,11 +4,11 @@ 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 @@ '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 @@ '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 @@ '@\.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 @@ '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 @@ '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 --- a/src/applications/config/option/PhabricatorTranslationsConfigOptions.php +++ b/src/applications/config/option/PhabricatorTranslationsConfigOptions.php @@ -4,11 +4,11 @@ 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 @@ '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 --- a/src/applications/config/option/PhabricatorUIConfigOptions.php +++ b/src/applications/config/option/PhabricatorUIConfigOptions.php @@ -4,11 +4,11 @@ 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 --- a/src/applications/config/response/PhabricatorConfigResponse.php +++ b/src/applications/config/response/PhabricatorConfigResponse.php @@ -15,8 +15,8 @@ // 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 --- a/src/applications/config/view/PhabricatorSetupIssueView.php +++ b/src/applications/config/view/PhabricatorSetupIssueView.php @@ -42,7 +42,7 @@ $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 @@ $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 @@ "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 @@ '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 @@ '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 @@ $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 @@ '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 @@ '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 @@ '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 @@ '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 --- a/src/applications/conpherence/mail/ConpherenceReplyHandler.php +++ b/src/applications/conpherence/mail/ConpherenceReplyHandler.php @@ -14,7 +14,7 @@ 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 --- a/src/applications/conpherence/storage/ConpherenceThread.php +++ b/src/applications/conpherence/storage/ConpherenceThread.php @@ -194,7 +194,7 @@ } 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 --- a/src/applications/countdown/view/PhabricatorCountdownView.php +++ b/src/applications/countdown/view/PhabricatorCountdownView.php @@ -30,7 +30,7 @@ '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 --- a/src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php +++ b/src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php @@ -139,7 +139,7 @@ $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 --- a/src/applications/daemon/management/PhabricatorDaemonManagementListWorkflow.php +++ b/src/applications/daemon/management/PhabricatorDaemonManagementListWorkflow.php @@ -17,7 +17,7 @@ $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 --- a/src/applications/daemon/management/PhabricatorDaemonManagementStatusWorkflow.php +++ b/src/applications/daemon/management/PhabricatorDaemonManagementStatusWorkflow.php @@ -17,7 +17,7 @@ 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 --- a/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php +++ b/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php @@ -273,7 +273,7 @@ $this->launchDaemon($name, $argv, $is_debug = false); } - $console->writeErr(pht("Done.")."\n"); + $console->writeErr(pht('Done.')."\n"); return 0; } @@ -313,7 +313,7 @@ } 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 @@ $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 --- a/src/applications/daemon/view/PhabricatorDaemonLogEventsView.php +++ b/src/applications/daemon/view/PhabricatorDaemonLogEventsView.php @@ -27,7 +27,7 @@ $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 @@ 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 --- a/src/applications/daemon/view/PhabricatorDaemonLogListView.php +++ b/src/applications/daemon/view/PhabricatorDaemonLogListView.php @@ -14,7 +14,7 @@ $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 @@ $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 --- a/src/applications/differential/conduit/ConduitAPI_differential_close_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_close_Method.php @@ -4,7 +4,7 @@ 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 --- a/src/applications/differential/conduit/ConduitAPI_differential_createcomment_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_createcomment_Method.php @@ -4,7 +4,7 @@ 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 --- a/src/applications/differential/conduit/ConduitAPI_differential_creatediff_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_creatediff_Method.php @@ -4,7 +4,7 @@ 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 --- a/src/applications/differential/conduit/ConduitAPI_differential_createinline_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_createinline_Method.php @@ -4,7 +4,7 @@ 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 --- a/src/applications/differential/conduit/ConduitAPI_differential_createrawdiff_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_createrawdiff_Method.php @@ -4,7 +4,7 @@ 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 --- a/src/applications/differential/conduit/ConduitAPI_differential_createrevision_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_createrevision_Method.php @@ -4,7 +4,7 @@ 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 --- a/src/applications/differential/conduit/ConduitAPI_differential_find_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_find_Method.php @@ -12,7 +12,7 @@ } 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 --- a/src/applications/differential/conduit/ConduitAPI_differential_finishpostponedlinters_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_finishpostponedlinters_Method.php @@ -4,8 +4,8 @@ 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 --- a/src/applications/differential/conduit/ConduitAPI_differential_getalldiffs_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_getalldiffs_Method.php @@ -13,7 +13,7 @@ } 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 --- a/src/applications/differential/conduit/ConduitAPI_differential_getcommitmessage_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_getcommitmessage_Method.php @@ -4,7 +4,7 @@ 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 @@ $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 --- a/src/applications/differential/conduit/ConduitAPI_differential_getcommitpaths_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_getcommitpaths_Method.php @@ -4,8 +4,8 @@ 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 --- a/src/applications/differential/conduit/ConduitAPI_differential_getrawdiff_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_getrawdiff_Method.php @@ -4,7 +4,7 @@ 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 --- a/src/applications/differential/conduit/ConduitAPI_differential_getrevision_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_getrevision_Method.php @@ -12,7 +12,7 @@ } 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 --- a/src/applications/differential/conduit/ConduitAPI_differential_getrevisioncomments_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_getrevisioncomments_Method.php @@ -12,7 +12,7 @@ } 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 --- a/src/applications/differential/conduit/ConduitAPI_differential_parsecommitmessage_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_parsecommitmessage_Method.php @@ -6,7 +6,7 @@ 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 --- a/src/applications/differential/conduit/ConduitAPI_differential_query_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_query_Method.php @@ -4,7 +4,7 @@ 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 --- a/src/applications/differential/conduit/ConduitAPI_differential_setdiffproperty_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_setdiffproperty_Method.php @@ -4,7 +4,7 @@ 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 --- a/src/applications/differential/conduit/ConduitAPI_differential_updaterevision_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_updaterevision_Method.php @@ -4,7 +4,7 @@ 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 --- a/src/applications/differential/conduit/ConduitAPI_differential_updateunitresults_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_updateunitresults_Method.php @@ -4,7 +4,7 @@ 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 --- a/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php +++ b/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php @@ -110,18 +110,18 @@ '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 @@ $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 @@ $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 @@ $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 @@ "'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 @@ 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 @@ 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 --- a/src/applications/differential/controller/DifferentialDiffCreateController.php +++ b/src/applications/differential/controller/DifferentialDiffCreateController.php @@ -20,8 +20,8 @@ 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 @@ ->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 --- a/src/applications/differential/controller/DifferentialInlineCommentEditController.php +++ b/src/applications/differential/controller/DifferentialInlineCommentEditController.php @@ -22,11 +22,11 @@ ->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 @@ $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 --- a/src/applications/differential/controller/DifferentialRevisionEditController.php +++ b/src/applications/differential/controller/DifferentialRevisionEditController.php @@ -49,7 +49,7 @@ } 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 --- a/src/applications/differential/controller/DifferentialRevisionLandController.php +++ b/src/applications/differential/controller/DifferentialRevisionLandController.php @@ -40,10 +40,10 @@ $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 @@ 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 @@ $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 @@ 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 --- a/src/applications/differential/controller/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/DifferentialRevisionViewController.php @@ -39,7 +39,7 @@ 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 --- a/src/applications/differential/customfield/DifferentialJIRAIssuesField.php +++ b/src/applications/differential/customfield/DifferentialJIRAIssuesField.php @@ -183,8 +183,8 @@ $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 --- a/src/applications/differential/customfield/DifferentialLintField.php +++ b/src/applications/differential/customfield/DifferentialLintField.php @@ -128,9 +128,9 @@ $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 @@ } } - 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 --- a/src/applications/differential/customfield/DifferentialTitleField.php +++ b/src/applications/differential/customfield/DifferentialTitleField.php @@ -110,8 +110,8 @@ 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 --- a/src/applications/differential/customfield/DifferentialUnitField.php +++ b/src/applications/differential/customfield/DifferentialUnitField.php @@ -200,7 +200,7 @@ } } - 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 --- a/src/applications/differential/editor/DifferentialTransactionEditor.php +++ b/src/applications/differential/editor/DifferentialTransactionEditor.php @@ -857,22 +857,22 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 --- a/src/applications/differential/landing/DifferentialLandingStrategy.php +++ b/src/applications/differential/landing/DifferentialLandingStrategy.php @@ -44,14 +44,14 @@ $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 --- a/src/applications/differential/landing/DifferentialLandingToGitHub.php +++ b/src/applications/differential/landing/DifferentialLandingToGitHub.php @@ -88,7 +88,7 @@ $github_repo); $workspace->execxLocal( - "push %P HEAD:master", + 'push %P HEAD:master', new PhutilOpaqueEnvelope($remote)); } @@ -99,7 +99,7 @@ $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 --- a/src/applications/differential/landing/DifferentialLandingToHostedGit.php +++ b/src/applications/differential/landing/DifferentialLandingToHostedGit.php @@ -56,7 +56,7 @@ . "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 @@ 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 --- a/src/applications/differential/landing/DifferentialLandingToHostedMercurial.php +++ b/src/applications/differential/landing/DifferentialLandingToHostedMercurial.php @@ -90,7 +90,7 @@ 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 --- a/src/applications/differential/mail/DifferentialReplyHandler.php +++ b/src/applications/differential/mail/DifferentialReplyHandler.php @@ -11,7 +11,7 @@ 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 @@ $text .= implode(', ', $modified_commands); } - $text .= "."; + $text .= '.'; return $text; } diff --git a/src/applications/differential/parser/DifferentialChangesetParser.php b/src/applications/differential/parser/DifferentialChangesetParser.php --- a/src/applications/differential/parser/DifferentialChangesetParser.php +++ b/src/applications/differential/parser/DifferentialChangesetParser.php @@ -990,7 +990,7 @@ 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 @@ 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 --- a/src/applications/differential/parser/DifferentialHunkParser.php +++ b/src/applications/differential/parser/DifferentialHunkParser.php @@ -428,7 +428,7 @@ 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 @@ $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 @@ $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 @@ 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 --- a/src/applications/differential/parser/__tests__/DifferentialCustomFieldRevertsParserTestCase.php +++ b/src/applications/differential/parser/__tests__/DifferentialCustomFieldRevertsParserTestCase.php @@ -42,7 +42,7 @@ ), ), - "Reverts 123" => array( + 'Reverts 123' => array( array( 'match' => 'Reverts 123', 'prefix' => 'Reverts', @@ -54,7 +54,7 @@ ), - "Reverts r123" => array( + 'Reverts r123' => array( array( 'match' => 'Reverts r123', 'prefix' => 'Reverts', @@ -78,7 +78,7 @@ "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 --- a/src/applications/differential/parser/__tests__/DifferentialHunkParserTestCase.php +++ b/src/applications/differential/parser/__tests__/DifferentialHunkParserTestCase.php @@ -46,7 +46,7 @@ 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 @@ 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 @@ 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 --- a/src/applications/differential/query/DifferentialRevisionQuery.php +++ b/src/applications/differential/query/DifferentialRevisionQuery.php @@ -889,7 +889,7 @@ 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 --- a/src/applications/differential/render/DifferentialChangesetOneUpRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetOneUpRenderer.php @@ -71,7 +71,7 @@ $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 --- a/src/applications/differential/render/DifferentialChangesetTestRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetTestRenderer.php @@ -80,7 +80,7 @@ $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 --- a/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php @@ -94,7 +94,7 @@ ), ), $is_first_block - ? pht("Show First 20 Lines") + ? pht('Show First 20 Lines') : pht("\xE2\x96\xB2 Show 20 Lines")); } @@ -130,7 +130,7 @@ ), ), $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 --- a/src/applications/differential/storage/DifferentialReviewer.php +++ b/src/applications/differential/storage/DifferentialReviewer.php @@ -41,7 +41,7 @@ $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 --- a/src/applications/differential/storage/__tests__/DifferentialHunkTestCase.php +++ b/src/applications/differential/storage/__tests__/DifferentialHunkTestCase.php @@ -29,8 +29,8 @@ $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 --- a/src/applications/differential/view/DifferentialDiffTableOfContentsView.php +++ b/src/applications/differential/view/DifferentialDiffTableOfContentsView.php @@ -136,8 +136,7 @@ $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 --- a/src/applications/differential/view/DifferentialInlineCommentEditView.php +++ b/src/applications/differential/view/DifferentialInlineCommentEditView.php @@ -42,10 +42,10 @@ 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 --- a/src/applications/differential/view/DifferentialLocalCommitsView.php +++ b/src/applications/differential/view/DifferentialLocalCommitsView.php @@ -19,7 +19,7 @@ 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 --- a/src/applications/differential/view/DifferentialRevisionListView.php +++ b/src/applications/differential/view/DifferentialRevisionListView.php @@ -54,7 +54,7 @@ $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 --- a/src/applications/differential/view/DifferentialTransactionView.php +++ b/src/applications/differential/view/DifferentialTransactionView.php @@ -104,7 +104,7 @@ $inlines[] = $xaction; break; default: - throw new Exception("Unknown grouped transaction type!"); + throw new Exception('Unknown grouped transaction type!'); } } @@ -149,9 +149,9 @@ $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 --- a/src/applications/diffusion/conduit/ConduitAPI_diffusion_existsquery_Method.php +++ b/src/applications/diffusion/conduit/ConduitAPI_diffusion_existsquery_Method.php @@ -7,7 +7,7 @@ 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 --- a/src/applications/diffusion/conduit/ConduitAPI_diffusion_findsymbols_Method.php +++ b/src/applications/diffusion/conduit/ConduitAPI_diffusion_findsymbols_Method.php @@ -7,7 +7,7 @@ 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 --- a/src/applications/diffusion/conduit/ConduitAPI_diffusion_getlintmessages_Method.php +++ b/src/applications/diffusion/conduit/ConduitAPI_diffusion_getlintmessages_Method.php @@ -11,7 +11,7 @@ } 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 --- a/src/applications/diffusion/conduit/ConduitAPI_diffusion_getrecentcommitsbypath_Method.php +++ b/src/applications/diffusion/conduit/ConduitAPI_diffusion_getrecentcommitsbypath_Method.php @@ -9,7 +9,7 @@ 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 --- a/src/applications/diffusion/conduit/ConduitAPI_diffusion_historyquery_Method.php +++ b/src/applications/diffusion/conduit/ConduitAPI_diffusion_historyquery_Method.php @@ -66,7 +66,7 @@ $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 --- a/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php +++ b/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php @@ -38,8 +38,8 @@ 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 @@ 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 --- a/src/applications/diffusion/controller/DiffusionBrowseFileController.php +++ b/src/applications/diffusion/controller/DiffusionBrowseFileController.php @@ -125,13 +125,13 @@ 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 @@ 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 @@ $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 @@ $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 --- a/src/applications/diffusion/controller/DiffusionCommitController.php +++ b/src/applications/diffusion/controller/DiffusionCommitController.php @@ -247,7 +247,7 @@ $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 @@ ->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 @@ $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 --- a/src/applications/diffusion/controller/DiffusionController.php +++ b/src/applications/diffusion/controller/DiffusionController.php @@ -11,7 +11,7 @@ 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 @@ $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 --- a/src/applications/diffusion/controller/DiffusionExternalController.php +++ b/src/applications/diffusion/controller/DiffusionExternalController.php @@ -76,9 +76,9 @@ ->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 --- a/src/applications/diffusion/controller/DiffusionInlineCommentController.php +++ b/src/applications/diffusion/controller/DiffusionInlineCommentController.php @@ -19,7 +19,7 @@ '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 @@ $path_id); if (!$path) { - throw new Exception("Invalid path ID!"); + throw new Exception('Invalid path ID!'); } return id(new PhabricatorAuditInlineComment()) @@ -49,7 +49,7 @@ $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 --- a/src/applications/diffusion/controller/DiffusionRepositoryController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryController.php @@ -290,7 +290,7 @@ ->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 @@ ->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 --- a/src/applications/diffusion/controller/DiffusionRepositoryCreateController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryCreateController.php @@ -43,7 +43,7 @@ $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 @@ $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 @@ "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 @@ 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 @@ '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 @@ ->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 --- a/src/applications/diffusion/controller/DiffusionServeController.php +++ b/src/applications/diffusion/controller/DiffusionServeController.php @@ -16,7 +16,7 @@ // 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 @@ // 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 @@ $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 @@ // "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 --- a/src/applications/diffusion/controller/DiffusionSymbolController.php +++ b/src/applications/diffusion/controller/DiffusionSymbolController.php @@ -136,7 +136,7 @@ '', )); $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 --- a/src/applications/diffusion/data/DiffusionRepositoryTag.php +++ b/src/applications/diffusion/data/DiffusionRepositoryTag.php @@ -72,7 +72,7 @@ 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 --- a/src/applications/diffusion/engine/DiffusionCommitHookEngine.php +++ b/src/applications/diffusion/engine/DiffusionCommitHookEngine.php @@ -610,8 +610,8 @@ 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 --- a/src/applications/diffusion/query/DiffusionCommitQuery.php +++ b/src/applications/diffusion/query/DiffusionCommitQuery.php @@ -135,7 +135,7 @@ 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 --- a/src/applications/diffusion/query/DiffusionLintCountQuery.php +++ b/src/applications/diffusion/query/DiffusionLintCountQuery.php @@ -23,11 +23,11 @@ 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 --- a/src/applications/diffusion/query/DiffusionQuery.php +++ b/src/applications/diffusion/query/DiffusionQuery.php @@ -32,7 +32,7 @@ $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 --- a/src/applications/diffusion/query/DiffusionSymbolQuery.php +++ b/src/applications/diffusion/query/DiffusionSymbolQuery.php @@ -119,10 +119,10 @@ 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 --- a/src/applications/diffusion/query/filecontent/DiffusionFileContentQuery.php +++ b/src/applications/diffusion/query/filecontent/DiffusionFileContentQuery.php @@ -28,7 +28,7 @@ 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 --- a/src/applications/diffusion/query/filecontent/DiffusionSvnFileContentQuery.php +++ b/src/applications/diffusion/query/filecontent/DiffusionSvnFileContentQuery.php @@ -26,9 +26,9 @@ // 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 --- a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelGitRefQuery.php +++ b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelGitRefQuery.php @@ -25,7 +25,7 @@ $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 @@ $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 @@ $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 --- a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelQuery.php +++ b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelQuery.php @@ -17,7 +17,7 @@ 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 --- a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelResolveRefsQuery.php +++ b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelResolveRefsQuery.php @@ -31,7 +31,7 @@ $result = $this->resolveSubversionRefs(); break; default: - throw new Exception("Unsupported repository type!"); + throw new Exception('Unsupported repository type!'); } return $result; @@ -46,7 +46,7 @@ $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 --- a/src/applications/diffusion/query/rawdiff/DiffusionGitRawDiffQuery.php +++ b/src/applications/diffusion/query/rawdiff/DiffusionGitRawDiffQuery.php @@ -28,7 +28,7 @@ $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 --- a/src/applications/diffusion/request/DiffusionGitRequest.php +++ b/src/applications/diffusion/request/DiffusionGitRequest.php @@ -17,7 +17,7 @@ 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 --- a/src/applications/diffusion/request/DiffusionMercurialRequest.php +++ b/src/applications/diffusion/request/DiffusionMercurialRequest.php @@ -19,7 +19,7 @@ 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 --- a/src/applications/diffusion/request/DiffusionRequest.php +++ b/src/applications/diffusion/request/DiffusionRequest.php @@ -163,7 +163,7 @@ $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 @@ // 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 --- a/src/applications/diffusion/ssh/DiffusionSSHMercurialServeWorkflow.php +++ b/src/applications/diffusion/ssh/DiffusionSSHMercurialServeWorkflow.php @@ -32,11 +32,11 @@ $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 --- a/src/applications/diffusion/ssh/DiffusionSSHSubversionServeWorkflow.php +++ b/src/applications/diffusion/ssh/DiffusionSSHSubversionServeWorkflow.php @@ -35,7 +35,7 @@ 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 --- a/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php +++ b/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php @@ -8,7 +8,7 @@ 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 @@ '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 --- a/src/applications/diffusion/view/DiffusionCommentView.php +++ b/src/applications/diffusion/view/DiffusionCommentView.php @@ -114,15 +114,15 @@ $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 --- a/src/applications/diffusion/view/DiffusionEmptyResultView.php +++ b/src/applications/diffusion/view/DiffusionEmptyResultView.php @@ -32,7 +32,7 @@ $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 @@ $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 --- a/src/applications/diviner/atom/DivinerAtom.php +++ b/src/applications/diviner/atom/DivinerAtom.php @@ -95,14 +95,14 @@ 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 @@ 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 @@ 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 @@ 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 --- a/src/applications/diviner/atomizer/DivinerArticleAtomizer.php +++ b/src/applications/diviner/atomizer/DivinerArticleAtomizer.php @@ -16,7 +16,7 @@ $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 --- a/src/applications/diviner/publisher/DivinerPublisher.php +++ b/src/applications/diviner/publisher/DivinerPublisher.php @@ -74,7 +74,7 @@ $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 @@ $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 --- a/src/applications/diviner/workflow/DivinerAtomizeWorkflow.php +++ b/src/applications/diviner/workflow/DivinerAtomizeWorkflow.php @@ -36,7 +36,7 @@ $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 @@ $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 @@ $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 --- a/src/applications/diviner/workflow/DivinerGenerateWorkflow.php +++ b/src/applications/diviner/workflow/DivinerGenerateWorkflow.php @@ -192,12 +192,12 @@ 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 --- a/src/applications/diviner/workflow/DivinerWorkflow.php +++ b/src/applications/diviner/workflow/DivinerWorkflow.php @@ -20,7 +20,7 @@ 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 --- a/src/applications/doorkeeper/engine/DoorkeeperObjectRef.php +++ b/src/applications/doorkeeper/engine/DoorkeeperObjectRef.php @@ -30,7 +30,7 @@ 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 --- a/src/applications/doorkeeper/option/PhabricatorAsanaConfigOptions.php +++ b/src/applications/doorkeeper/option/PhabricatorAsanaConfigOptions.php @@ -4,17 +4,17 @@ 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 @@ "\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 @@ } $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 --- a/src/applications/doorkeeper/worker/DoorkeeperFeedWorkerAsana.php +++ b/src/applications/doorkeeper/worker/DoorkeeperFeedWorkerAsana.php @@ -143,7 +143,7 @@ $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 --- a/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php +++ b/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php @@ -45,7 +45,7 @@ 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 @@ $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 @@ 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 --- a/src/applications/drydock/blueprint/DrydockLocalHostBlueprintImplementation.php +++ b/src/applications/drydock/blueprint/DrydockLocalHostBlueprintImplementation.php @@ -43,8 +43,8 @@ $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 --- a/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php +++ b/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php @@ -53,7 +53,7 @@ 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 --- a/src/applications/drydock/interface/command/DrydockSSHCommandInterface.php +++ b/src/applications/drydock/interface/command/DrydockSSHCommandInterface.php @@ -17,7 +17,7 @@ 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 --- a/src/applications/drydock/interface/filesystem/DrydockSFTPFilesystemInterface.php +++ b/src/applications/drydock/interface/filesystem/DrydockSFTPFilesystemInterface.php @@ -17,7 +17,7 @@ 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 @@ 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 @@ $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 --- a/src/applications/drydock/management/DrydockManagementCloseWorkflow.php +++ b/src/applications/drydock/management/DrydockManagementCloseWorkflow.php @@ -22,7 +22,7 @@ $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 --- a/src/applications/drydock/management/DrydockManagementCreateResourceWorkflow.php +++ b/src/applications/drydock/management/DrydockManagementCreateResourceWorkflow.php @@ -33,13 +33,13 @@ $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 @@ ->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 --- a/src/applications/drydock/management/DrydockManagementLeaseWorkflow.php +++ b/src/applications/drydock/management/DrydockManagementLeaseWorkflow.php @@ -28,7 +28,7 @@ $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 --- a/src/applications/drydock/management/DrydockManagementReleaseWorkflow.php +++ b/src/applications/drydock/management/DrydockManagementReleaseWorkflow.php @@ -22,7 +22,7 @@ $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 --- a/src/applications/drydock/storage/DrydockLease.php +++ b/src/applications/drydock/storage/DrydockLease.php @@ -85,7 +85,7 @@ 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 @@ 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 @@ 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 --- a/src/applications/drydock/worker/DrydockAllocatorWorker.php +++ b/src/applications/drydock/worker/DrydockAllocatorWorker.php @@ -19,7 +19,7 @@ ->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 @@ // 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 --- a/src/applications/fact/controller/PhabricatorFactChartController.php +++ b/src/applications/fact/controller/PhabricatorFactChartController.php @@ -32,7 +32,7 @@ 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 --- a/src/applications/fact/daemon/PhabricatorFactDaemon.php +++ b/src/applications/fact/daemon/PhabricatorFactDaemon.php @@ -15,7 +15,7 @@ } $this->processAggregates(); - $this->log("Zzz..."); + $this->log('Zzz...'); $this->sleep(60 * 5); } } @@ -91,7 +91,7 @@ } 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 --- a/src/applications/fact/management/PhabricatorFactManagementCursorsWorkflow.php +++ b/src/applications/fact/management/PhabricatorFactManagementCursorsWorkflow.php @@ -31,12 +31,12 @@ '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 @@ $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 --- a/src/applications/feed/PhabricatorFeedStoryPublisher.php +++ b/src/applications/feed/PhabricatorFeedStoryPublisher.php @@ -65,7 +65,7 @@ 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 @@ 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 --- a/src/applications/feed/conduit/ConduitAPI_feed_publish_Method.php +++ b/src/applications/feed/conduit/ConduitAPI_feed_publish_Method.php @@ -11,7 +11,7 @@ } 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 --- a/src/applications/feed/conduit/ConduitAPI_feed_query_Method.php +++ b/src/applications/feed/conduit/ConduitAPI_feed_query_Method.php @@ -11,7 +11,7 @@ } 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 --- a/src/applications/feed/management/PhabricatorFeedManagementRepublishWorkflow.php +++ b/src/applications/feed/management/PhabricatorFeedManagementRepublishWorkflow.php @@ -26,10 +26,10 @@ $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 @@ 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 @@ '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 --- a/src/applications/feed/story/PhabricatorFeedStory.php +++ b/src/applications/feed/story/PhabricatorFeedStory.php @@ -163,7 +163,7 @@ 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 --- a/src/applications/feed/story/PhabricatorFeedStoryAggregate.php +++ b/src/applications/feed/story/PhabricatorFeedStoryAggregate.php @@ -68,7 +68,7 @@ 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 --- a/src/applications/feed/story/PhabricatorFeedStoryCommit.php +++ b/src/applications/feed/story/PhabricatorFeedStoryCommit.php @@ -38,13 +38,13 @@ 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 --- a/src/applications/files/PhabricatorImageTransformer.php +++ b/src/applications/files/PhabricatorImageTransformer.php @@ -388,12 +388,12 @@ $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 --- a/src/applications/files/conduit/ConduitAPI_file_download_Method.php +++ b/src/applications/files/conduit/ConduitAPI_file_download_Method.php @@ -7,7 +7,7 @@ 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 --- 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 --- 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 --- 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 --- a/src/applications/files/config/PhabricatorFilesConfigOptions.php +++ b/src/applications/files/config/PhabricatorFilesConfigOptions.php @@ -7,11 +7,11 @@ 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 @@ ->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 @@ "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 --- a/src/applications/files/controller/PhabricatorFileInfoController.php +++ b/src/applications/files/controller/PhabricatorFileInfoController.php @@ -41,7 +41,7 @@ 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 --- a/src/applications/files/controller/PhabricatorFileTransformController.php +++ b/src/applications/files/controller/PhabricatorFileTransformController.php @@ -119,7 +119,7 @@ $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 --- a/src/applications/files/engineselector/PhabricatorDefaultFileStorageEngineSelector.php +++ b/src/applications/files/engineselector/PhabricatorDefaultFileStorageEngineSelector.php @@ -42,10 +42,10 @@ // 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 --- a/src/applications/files/exception/PhabricatorFileUploadException.php +++ b/src/applications/files/exception/PhabricatorFileUploadException.php @@ -8,24 +8,24 @@ "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 --- a/src/applications/files/management/PhabricatorFilesManagementEnginesWorkflow.php +++ b/src/applications/files/management/PhabricatorFilesManagementEnginesWorkflow.php @@ -15,7 +15,7 @@ $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 --- a/src/applications/files/management/PhabricatorFilesManagementMigrateWorkflow.php +++ b/src/applications/files/management/PhabricatorFilesManagementMigrateWorkflow.php @@ -35,8 +35,8 @@ $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 @@ $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 --- a/src/applications/files/management/PhabricatorFilesManagementPurgeWorkflow.php +++ b/src/applications/files/management/PhabricatorFilesManagementPurgeWorkflow.php @@ -30,8 +30,8 @@ $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 --- a/src/applications/files/management/PhabricatorFilesManagementRebuildWorkflow.php +++ b/src/applications/files/management/PhabricatorFilesManagementRebuildWorkflow.php @@ -38,8 +38,8 @@ $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 @@ } $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 --- a/src/applications/files/management/PhabricatorFilesManagementWorkflow.php +++ b/src/applications/files/management/PhabricatorFilesManagementWorkflow.php @@ -9,7 +9,7 @@ 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 --- a/src/applications/files/storage/PhabricatorFile.php +++ b/src/applications/files/storage/PhabricatorFile.php @@ -61,7 +61,7 @@ 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 @@ $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 @@ 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 @@ 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 @@ 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 @@ $data = $data; break; default: - throw new Exception("Unknown storage format."); + throw new Exception('Unknown storage format.'); } return $data; @@ -493,7 +493,7 @@ 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 @@ 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 @@ $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 --- 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 @@ 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 --- 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 --- 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 --- a/src/applications/flag/controller/PhabricatorFlagEditController.php +++ b/src/applications/flag/controller/PhabricatorFlagEditController.php @@ -45,7 +45,7 @@ $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 @@ 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 @@ $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 --- a/src/applications/harbormaster/controller/HarbormasterBuildViewController.php +++ b/src/applications/harbormaster/controller/HarbormasterBuildViewController.php @@ -23,7 +23,7 @@ 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 --- a/src/applications/harbormaster/controller/HarbormasterBuildableViewController.php +++ b/src/applications/harbormaster/controller/HarbormasterBuildableViewController.php @@ -36,7 +36,7 @@ $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 --- a/src/applications/harbormaster/controller/HarbormasterPlanEditController.php +++ b/src/applications/harbormaster/controller/HarbormasterPlanEditController.php @@ -97,7 +97,7 @@ } 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 --- a/src/applications/harbormaster/controller/HarbormasterPlanViewController.php +++ b/src/applications/harbormaster/controller/HarbormasterPlanViewController.php @@ -34,7 +34,7 @@ ->setTransactions($xactions) ->setShouldTerminate(true); - $title = pht("Plan %d", $id); + $title = pht('Plan %d', $id); $header = id(new PHUIHeaderView()) ->setHeader($title) @@ -48,7 +48,7 @@ $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 @@ ->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 @@ ->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 --- a/src/applications/harbormaster/controller/HarbormasterStepDeleteController.php +++ b/src/applications/harbormaster/controller/HarbormasterStepDeleteController.php @@ -23,7 +23,7 @@ ->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 --- a/src/applications/harbormaster/step/HarbormasterCommandBuildStepImplementation.php +++ b/src/applications/harbormaster/step/HarbormasterCommandBuildStepImplementation.php @@ -38,8 +38,8 @@ $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 --- a/src/applications/harbormaster/step/HarbormasterPublishFragmentBuildStepImplementation.php +++ b/src/applications/harbormaster/step/HarbormasterPublishFragmentBuildStepImplementation.php @@ -47,7 +47,7 @@ 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 --- a/src/applications/harbormaster/step/HarbormasterWaitForPreviousBuildStepImplementation.php +++ b/src/applications/harbormaster/step/HarbormasterWaitForPreviousBuildStepImplementation.php @@ -28,12 +28,12 @@ // 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 --- a/src/applications/harbormaster/storage/build/HarbormasterBuild.php +++ b/src/applications/harbormaster/storage/build/HarbormasterBuild.php @@ -176,7 +176,7 @@ 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 --- a/src/applications/harbormaster/storage/build/HarbormasterBuildArtifact.php +++ b/src/applications/harbormaster/storage/build/HarbormasterBuildArtifact.php @@ -60,9 +60,9 @@ 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 @@ 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 @@ $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 @@ 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 --- a/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php +++ b/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php @@ -53,7 +53,7 @@ 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 @@ 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 @@ '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 @@ '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 @@ '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 --- a/src/applications/herald/adapter/HeraldAdapter.php +++ b/src/applications/herald/adapter/HeraldAdapter.php @@ -242,7 +242,7 @@ 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 @@ 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 @@ $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 @@ $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 @@ $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 @@ $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 --- a/src/applications/herald/adapter/HeraldCommitAdapter.php +++ b/src/applications/herald/adapter/HeraldCommitAdapter.php @@ -269,7 +269,7 @@ ); $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 --- a/src/applications/herald/controller/HeraldRuleController.php +++ b/src/applications/herald/controller/HeraldRuleController.php @@ -92,9 +92,9 @@ 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 @@ ->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 @@ $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 @@ $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 --- a/src/applications/herald/controller/HeraldTestConsoleController.php +++ b/src/applications/herald/controller/HeraldTestConsoleController.php @@ -48,7 +48,7 @@ $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 --- a/src/applications/herald/controller/HeraldTranscriptController.php +++ b/src/applications/herald/controller/HeraldTranscriptController.php @@ -60,7 +60,7 @@ // 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 @@ $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 --- a/src/applications/herald/engine/HeraldEngine.php +++ b/src/applications/herald/engine/HeraldEngine.php @@ -79,8 +79,8 @@ ->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 @@ $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 @@ 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 --- a/src/applications/herald/storage/HeraldRule.php +++ b/src/applications/herald/storage/HeraldRule.php @@ -128,7 +128,7 @@ 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 @@ 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 --- a/src/applications/legalpad/mail/LegalpadReplyHandler.php +++ b/src/applications/legalpad/mail/LegalpadReplyHandler.php @@ -7,7 +7,7 @@ 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 --- a/src/applications/lipsum/generator/PhabricatorTestDataGenerator.php +++ b/src/applications/lipsum/generator/PhabricatorTestDataGenerator.php @@ -9,20 +9,20 @@ 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 --- a/src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php +++ b/src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php @@ -26,13 +26,13 @@ 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 @@ 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 --- 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 --- a/src/applications/macro/config/PhabricatorMacroConfigOptions.php +++ b/src/applications/macro/config/PhabricatorMacroConfigOptions.php @@ -4,11 +4,11 @@ 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 --- a/src/applications/macro/controller/PhabricatorMacroMemeController.php +++ b/src/applications/macro/controller/PhabricatorMacroMemeController.php @@ -31,8 +31,8 @@ $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 --- a/src/applications/macro/mail/PhabricatorMacroReplyHandler.php +++ b/src/applications/macro/mail/PhabricatorMacroReplyHandler.php @@ -4,7 +4,7 @@ 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 @@ 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 --- a/src/applications/macro/query/PhabricatorMacroSearchEngine.php +++ b/src/applications/macro/query/PhabricatorMacroSearchEngine.php @@ -78,7 +78,7 @@ $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 --- a/src/applications/maniphest/conduit/ConduitAPI_maniphest_createtask_Method.php +++ b/src/applications/maniphest/conduit/ConduitAPI_maniphest_createtask_Method.php @@ -7,7 +7,7 @@ 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 --- a/src/applications/maniphest/conduit/ConduitAPI_maniphest_find_Method.php +++ b/src/applications/maniphest/conduit/ConduitAPI_maniphest_find_Method.php @@ -17,7 +17,7 @@ } 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 --- a/src/applications/maniphest/conduit/ConduitAPI_maniphest_gettasktransactions_Method.php +++ b/src/applications/maniphest/conduit/ConduitAPI_maniphest_gettasktransactions_Method.php @@ -7,7 +7,7 @@ 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 --- a/src/applications/maniphest/conduit/ConduitAPI_maniphest_info_Method.php +++ b/src/applications/maniphest/conduit/ConduitAPI_maniphest_info_Method.php @@ -8,7 +8,7 @@ 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 --- a/src/applications/maniphest/conduit/ConduitAPI_maniphest_query_Method.php +++ b/src/applications/maniphest/conduit/ConduitAPI_maniphest_query_Method.php @@ -12,7 +12,7 @@ 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 --- a/src/applications/maniphest/conduit/ConduitAPI_maniphest_querystatuses_Method.php +++ b/src/applications/maniphest/conduit/ConduitAPI_maniphest_querystatuses_Method.php @@ -4,7 +4,7 @@ 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 --- a/src/applications/maniphest/conduit/ConduitAPI_maniphest_update_Method.php +++ b/src/applications/maniphest/conduit/ConduitAPI_maniphest_update_Method.php @@ -7,7 +7,7 @@ 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 --- a/src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php +++ b/src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php @@ -4,11 +4,11 @@ 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 @@ 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 @@ 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 @@ ->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 --- a/src/applications/maniphest/controller/ManiphestExportController.php +++ b/src/applications/maniphest/controller/ManiphestExportController.php @@ -88,7 +88,7 @@ ->appendChild( id(new AphrontFormSelectControl()) ->setLabel(pht('Format:')) - ->setName("excel-format") + ->setName('excel-format') ->setOptions($export_formats)); $dialog->appendChild($form); @@ -98,7 +98,7 @@ 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 --- a/src/applications/maniphest/controller/ManiphestReportController.php +++ b/src/applications/maniphest/controller/ManiphestReportController.php @@ -245,16 +245,16 @@ 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 --- a/src/applications/maniphest/lipsum/PhabricatorManiphestTaskTestDataGenerator.php +++ b/src/applications/maniphest/lipsum/PhabricatorManiphestTaskTestDataGenerator.php @@ -61,7 +61,7 @@ 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 --- a/src/applications/maniphest/mail/ManiphestReplyHandler.php +++ b/src/applications/maniphest/mail/ManiphestReplyHandler.php @@ -7,7 +7,7 @@ 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 @@ 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 --- a/src/applications/metamta/adapter/PhabricatorMailImplementationSendGridAdapter.php +++ b/src/applications/metamta/adapter/PhabricatorMailImplementationSendGridAdapter.php @@ -147,7 +147,7 @@ } 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 --- a/src/applications/metamta/contentsource/PhabricatorContentSourceView.php +++ b/src/applications/metamta/contentsource/PhabricatorContentSourceView.php @@ -24,7 +24,7 @@ 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 --- a/src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php +++ b/src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php @@ -8,7 +8,7 @@ ->setName('list-inbound') ->setSynopsis('List inbound messages received by Phabricator.') ->setExamples( - "**list-inbound**") + '**list-inbound**') ->setArguments( array( array( @@ -29,7 +29,7 @@ $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 @@ $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 --- a/src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php +++ b/src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php @@ -8,7 +8,7 @@ ->setName('list-outbound') ->setSynopsis('List outbound messages sent by Phabricator.') ->setExamples( - "**list-outbound**") + '**list-outbound**') ->setArguments( array( array( @@ -29,7 +29,7 @@ $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 @@ $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 --- a/src/applications/metamta/management/PhabricatorMailManagementReceiveTestWorkflow.php +++ b/src/applications/metamta/management/PhabricatorMailManagementReceiveTestWorkflow.php @@ -11,7 +11,7 @@ '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 @@ $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 --- a/src/applications/metamta/management/PhabricatorMailManagementResendWorkflow.php +++ b/src/applications/metamta/management/PhabricatorMailManagementResendWorkflow.php @@ -8,7 +8,7 @@ ->setName('resend') ->setSynopsis('Send mail again.') ->setExamples( - "**resend** --id 1 --id 2") + '**resend** --id 1 --id 2') ->setArguments( array( array( @@ -38,7 +38,7 @@ $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 --- a/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php +++ b/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php @@ -11,7 +11,7 @@ '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 @@ $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 --- a/src/applications/metamta/management/PhabricatorMailManagementShowInboundWorkflow.php +++ b/src/applications/metamta/management/PhabricatorMailManagementShowInboundWorkflow.php @@ -8,7 +8,7 @@ ->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 @@ $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 --- a/src/applications/metamta/management/PhabricatorMailManagementShowOutboundWorkflow.php +++ b/src/applications/metamta/management/PhabricatorMailManagementShowOutboundWorkflow.php @@ -8,7 +8,7 @@ ->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 @@ $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 --- a/src/applications/metamta/parser/__tests__/PhabricatorMetaMTAEmailBodyParserTestCase.php +++ b/src/applications/metamta/parser/__tests__/PhabricatorMetaMTAEmailBodyParserTestCase.php @@ -8,7 +8,7 @@ foreach ($bodies as $body) { $parser = new PhabricatorMetaMTAEmailBodyParser(); $stripped = $parser->stripTextBody($body); - $this->assertEqual("OKAY", $stripped); + $this->assertEqual('OKAY', $stripped); } } @@ -42,7 +42,7 @@ $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 --- a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php +++ b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php @@ -332,7 +332,7 @@ 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 @@ 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 @@ 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 @@ 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 --- a/src/applications/metamta/storage/__tests__/PhabricatorMetaMTAMailTestCase.php +++ b/src/applications/metamta/storage/__tests__/PhabricatorMetaMTAMailTestCase.php @@ -164,8 +164,8 @@ $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 --- a/src/applications/metamta/view/__tests__/PhabricatorMetaMTAMailBodyTestCase.php +++ b/src/applications/metamta/view/__tests__/PhabricatorMetaMTAMailBodyTestCase.php @@ -66,10 +66,10 @@ $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 --- a/src/applications/notification/PhabricatorNotificationQuery.php +++ b/src/applications/notification/PhabricatorNotificationQuery.php @@ -47,7 +47,7 @@ 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 @@ $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 --- a/src/applications/notification/controller/PhabricatorNotificationClearController.php +++ b/src/applications/notification/controller/PhabricatorNotificationClearController.php @@ -29,8 +29,8 @@ 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 --- a/src/applications/notification/controller/PhabricatorNotificationStatusController.php +++ b/src/applications/notification/controller/PhabricatorNotificationStatusController.php @@ -9,7 +9,7 @@ $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 @@ ->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 --- a/src/applications/notification/storage/PhabricatorFeedStoryNotification.php +++ b/src/applications/notification/storage/PhabricatorFeedStoryNotification.php @@ -25,11 +25,11 @@ 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 --- a/src/applications/owners/config/PhabricatorOwnersConfigOptions.php +++ b/src/applications/owners/config/PhabricatorOwnersConfigOptions.php @@ -4,11 +4,11 @@ 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 --- a/src/applications/owners/controller/PhabricatorOwnersDetailController.php +++ b/src/applications/owners/controller/PhabricatorOwnersDetailController.php @@ -224,7 +224,7 @@ $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 --- 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 --- 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 --- a/src/applications/passphrase/keys/PassphraseAbstractKey.php +++ b/src/applications/passphrase/keys/PassphraseAbstractKey.php @@ -6,7 +6,7 @@ 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 --- a/src/applications/passphrase/view/PassphraseCredentialControl.php +++ b/src/applications/passphrase/view/PassphraseCredentialControl.php @@ -41,7 +41,7 @@ $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 --- a/src/applications/paste/conduit/ConduitAPI_paste_info_Method.php +++ b/src/applications/paste/conduit/ConduitAPI_paste_info_Method.php @@ -14,7 +14,7 @@ } 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 --- 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 --- a/src/applications/paste/lipsum/PhabricatorPasteTestDataGenerator.php +++ b/src/applications/paste/lipsum/PhabricatorPasteTestDataGenerator.php @@ -5,8 +5,8 @@ // 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 @@ 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 @@ $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 @@ 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 --- a/src/applications/paste/view/PasteEmbedView.php +++ b/src/applications/paste/view/PasteEmbedView.php @@ -28,7 +28,7 @@ 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 --- a/src/applications/people/conduit/ConduitAPI_user_addstatus_Method.php +++ b/src/applications/people/conduit/ConduitAPI_user_addstatus_Method.php @@ -8,7 +8,7 @@ } 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 --- a/src/applications/people/conduit/ConduitAPI_user_disable_Method.php +++ b/src/applications/people/conduit/ConduitAPI_user_disable_Method.php @@ -7,7 +7,7 @@ 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 --- a/src/applications/people/conduit/ConduitAPI_user_enable_Method.php +++ b/src/applications/people/conduit/ConduitAPI_user_enable_Method.php @@ -7,7 +7,7 @@ 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 --- a/src/applications/people/conduit/ConduitAPI_user_info_Method.php +++ b/src/applications/people/conduit/ConduitAPI_user_info_Method.php @@ -15,7 +15,7 @@ } 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 --- a/src/applications/people/conduit/ConduitAPI_user_query_Method.php +++ b/src/applications/people/conduit/ConduitAPI_user_query_Method.php @@ -7,7 +7,7 @@ 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 --- a/src/applications/people/conduit/ConduitAPI_user_removestatus_Method.php +++ b/src/applications/people/conduit/ConduitAPI_user_removestatus_Method.php @@ -7,7 +7,7 @@ } 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 --- a/src/applications/people/conduit/ConduitAPI_user_whoami_Method.php +++ b/src/applications/people/conduit/ConduitAPI_user_whoami_Method.php @@ -7,7 +7,7 @@ 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 --- a/src/applications/people/config/PhabricatorUserConfigOptions.php +++ b/src/applications/people/config/PhabricatorUserConfigOptions.php @@ -4,11 +4,11 @@ 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 @@ 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 --- a/src/applications/people/controller/PhabricatorPeopleLdapController.php +++ b/src/applications/people/controller/PhabricatorPeopleLdapController.php @@ -73,13 +73,13 @@ $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 @@ $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 --- a/src/applications/people/controller/PhabricatorPeopleNewController.php +++ b/src/applications/people/controller/PhabricatorPeopleNewController.php @@ -56,7 +56,7 @@ $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 --- a/src/applications/people/editor/PhabricatorUserEditor.php +++ b/src/applications/people/editor/PhabricatorUserEditor.php @@ -26,11 +26,11 @@ 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 @@ 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 @@ 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 @@ $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 @@ $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 @@ $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 @@ $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 @@ $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 @@ $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 @@ $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 @@ 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 @@ $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 @@ $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 --- a/src/applications/people/lipsum/PhabricatorPeopleTestDataGenerator.php +++ b/src/applications/people/lipsum/PhabricatorPeopleTestDataGenerator.php @@ -40,9 +40,9 @@ $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 @@ $reduced .= $w[0]; } } - } elseif ($random == 1) { + } else if ($random == 1) { foreach ($words as $w) { if ($w == $words[0]) { $reduced .= $w; @@ -61,7 +61,7 @@ $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 @@ $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 @@ } 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 --- a/src/applications/people/storage/PhabricatorUser.php +++ b/src/applications/people/storage/PhabricatorUser.php @@ -125,8 +125,8 @@ 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 @@ } break; default: - throw new Exception("Unknown CSRF token format!"); + throw new Exception('Unknown CSRF token format!'); } } @@ -371,7 +371,7 @@ 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 --- 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 --- 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 --- a/src/applications/phame/config/PhabricatorPhameConfigOptions.php +++ b/src/applications/phame/config/PhabricatorPhameConfigOptions.php @@ -4,11 +4,11 @@ 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 --- a/src/applications/phame/skins/PhameSkinSpecification.php +++ b/src/applications/phame/skins/PhameSkinSpecification.php @@ -105,7 +105,7 @@ $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 --- a/src/applications/phame/storage/PhameBlog.php +++ b/src/applications/phame/storage/PhameBlog.php @@ -46,8 +46,8 @@ 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 --- a/src/applications/phid/conduit/ConduitAPI_phid_info_Method.php +++ b/src/applications/phid/conduit/ConduitAPI_phid_info_Method.php @@ -15,7 +15,7 @@ } 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 --- a/src/applications/phid/conduit/ConduitAPI_phid_lookup_Method.php +++ b/src/applications/phid/conduit/ConduitAPI_phid_lookup_Method.php @@ -7,7 +7,7 @@ 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 --- a/src/applications/phid/conduit/ConduitAPI_phid_query_Method.php +++ b/src/applications/phid/conduit/ConduitAPI_phid_query_Method.php @@ -7,7 +7,7 @@ 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 --- a/src/applications/phid/query/PhabricatorObjectQuery.php +++ b/src/applications/phid/query/PhabricatorObjectQuery.php @@ -78,7 +78,7 @@ 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 --- a/src/applications/phid/query/__tests__/PhabricatorObjectListQueryTestCase.php +++ b/src/applications/phid/query/__tests__/PhabricatorObjectListQueryTestCase.php @@ -26,13 +26,13 @@ $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 @@ // 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 --- a/src/applications/phid/storage/PhabricatorPHID.php +++ b/src/applications/phid/storage/PhabricatorPHID.php @@ -9,7 +9,7 @@ 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 --- a/src/applications/phid/type/PhabricatorPHIDType.php +++ b/src/applications/phid/type/PhabricatorPHIDType.php @@ -114,7 +114,7 @@ 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 --- a/src/applications/pholio/config/PhabricatorPholioConfigOptions.php +++ b/src/applications/pholio/config/PhabricatorPholioConfigOptions.php @@ -7,11 +7,11 @@ 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 --- a/src/applications/pholio/controller/PholioInlineSaveController.php +++ b/src/applications/pholio/controller/PholioInlineSaveController.php @@ -30,7 +30,7 @@ $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 --- a/src/applications/pholio/lipsum/PhabricatorPholioMockTestDataGenerator.php +++ b/src/applications/pholio/lipsum/PhabricatorPholioMockTestDataGenerator.php @@ -88,8 +88,8 @@ } 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 --- a/src/applications/pholio/mail/PholioReplyHandler.php +++ b/src/applications/pholio/mail/PholioReplyHandler.php @@ -7,7 +7,7 @@ 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 @@ 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 --- a/src/applications/pholio/view/PholioInlineCommentEditView.php +++ b/src/applications/pholio/view/PholioInlineCommentEditView.php @@ -33,10 +33,10 @@ 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 --- a/src/applications/pholio/view/PholioInlineCommentSaveView.php +++ b/src/applications/pholio/view/PholioInlineCommentSaveView.php @@ -26,10 +26,10 @@ 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 --- a/src/applications/pholio/view/PholioInlineCommentView.php +++ b/src/applications/pholio/view/PholioInlineCommentView.php @@ -21,7 +21,7 @@ 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 @@ 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 --- a/src/applications/pholio/view/PholioMockEmbedView.php +++ b/src/applications/pholio/view/PholioMockEmbedView.php @@ -20,7 +20,7 @@ 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 --- a/src/applications/pholio/view/PholioMockImagesView.php +++ b/src/applications/pholio/view/PholioMockImagesView.php @@ -56,7 +56,7 @@ 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 --- a/src/applications/pholio/view/PholioTransactionView.php +++ b/src/applications/pholio/view/PholioTransactionView.php @@ -59,7 +59,7 @@ $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 --- a/src/applications/phortune/controller/PhortuneAccountBuyController.php +++ b/src/applications/phortune/controller/PhortuneAccountBuyController.php @@ -144,7 +144,7 @@ $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 --- a/src/applications/phortune/controller/PhortuneController.php +++ b/src/applications/phortune/controller/PhortuneController.php @@ -13,7 +13,7 @@ } 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 --- a/src/applications/phortune/controller/PhortunePaymentMethodEditController.php +++ b/src/applications/phortune/controller/PhortunePaymentMethodEditController.php @@ -27,8 +27,8 @@ $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 --- a/src/applications/phortune/controller/PhortuneProviderController.php +++ b/src/applications/phortune/controller/PhortuneProviderController.php @@ -31,7 +31,7 @@ $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 --- a/src/applications/phortune/currency/PhortuneCurrency.php +++ b/src/applications/phortune/currency/PhortuneCurrency.php @@ -54,7 +54,7 @@ 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 @@ 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 --- a/src/applications/phortune/option/PhabricatorPhortuneConfigOptions.php +++ b/src/applications/phortune/option/PhabricatorPhortuneConfigOptions.php @@ -4,11 +4,11 @@ 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 --- a/src/applications/phortune/provider/PhortunePaypalPaymentProvider.php +++ b/src/applications/phortune/provider/PhortunePaypalPaymentProvider.php @@ -25,7 +25,7 @@ } public function getPaymentMethodProviderDescription() { - return "Paypal"; + return 'Paypal'; } @@ -37,7 +37,7 @@ 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 --- a/src/applications/phortune/provider/PhortuneStripePaymentProvider.php +++ b/src/applications/phortune/provider/PhortuneStripePaymentProvider.php @@ -52,7 +52,7 @@ $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 --- a/src/applications/phortune/provider/PhortuneWePayPaymentProvider.php +++ b/src/applications/phortune/provider/PhortuneWePayPaymentProvider.php @@ -26,7 +26,7 @@ } public function getPaymentMethodProviderDescription() { - return "WePay"; + return 'WePay'; } @@ -38,7 +38,7 @@ 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 --- a/src/applications/phpast/controller/PhabricatorXHPASTViewPanelController.php +++ b/src/applications/phpast/controller/PhabricatorXHPASTViewPanelController.php @@ -11,7 +11,7 @@ $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 --- a/src/applications/phragment/conduit/ConduitAPI_phragment_getpatch_Method.php +++ b/src/applications/phragment/conduit/ConduitAPI_phragment_getpatch_Method.php @@ -11,7 +11,7 @@ } 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 @@ // 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 @@ } $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 --- a/src/applications/phragment/conduit/ConduitAPI_phragment_queryfragments_Method.php +++ b/src/applications/phragment/conduit/ConduitAPI_phragment_queryfragments_Method.php @@ -11,7 +11,7 @@ } 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 --- a/src/applications/phragment/controller/PhragmentBrowseController.php +++ b/src/applications/phragment/controller/PhragmentBrowseController.php @@ -9,7 +9,7 @@ } 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 --- a/src/applications/phragment/controller/PhragmentController.php +++ b/src/applications/phragment/controller/PhragmentController.php @@ -94,7 +94,7 @@ $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 @@ $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 @@ $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 @@ $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 @@ $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 @@ 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 @@ } 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 @@ * 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 --- a/src/applications/phragment/controller/PhragmentCreateController.php +++ b/src/applications/phragment/controller/PhragmentCreateController.php @@ -5,7 +5,7 @@ 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 --- a/src/applications/phragment/controller/PhragmentHistoryController.php +++ b/src/applications/phragment/controller/PhragmentHistoryController.php @@ -9,7 +9,7 @@ } public function willProcessRequest(array $data) { - $this->dblob = idx($data, "dblob", ""); + $this->dblob = idx($data, 'dblob', ''); } public function processRequest() { @@ -75,9 +75,9 @@ ->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 @@ ->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 --- a/src/applications/phragment/controller/PhragmentPatchController.php +++ b/src/applications/phragment/controller/PhragmentPatchController.php @@ -10,8 +10,8 @@ } 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 @@ // 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 @@ ->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 --- a/src/applications/phragment/controller/PhragmentPolicyController.php +++ b/src/applications/phragment/controller/PhragmentPolicyController.php @@ -5,7 +5,7 @@ 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 --- a/src/applications/phragment/controller/PhragmentRevertController.php +++ b/src/applications/phragment/controller/PhragmentRevertController.php @@ -47,7 +47,7 @@ ->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 @@ ->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 --- a/src/applications/phragment/controller/PhragmentSnapshotCreateController.php +++ b/src/applications/phragment/controller/PhragmentSnapshotCreateController.php @@ -5,7 +5,7 @@ private $dblob; public function willProcessRequest(array $data) { - $this->dblob = idx($data, "dblob", ""); + $this->dblob = idx($data, 'dblob', ''); } public function processRequest() { @@ -79,7 +79,7 @@ } } - $fragment_sequence = "-"; + $fragment_sequence = '-'; if ($fragment->getLatestVersion() !== null) { $fragment_sequence = $fragment->getLatestVersion()->getSequence(); } @@ -98,7 +98,7 @@ 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 @@ '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 --- a/src/applications/phragment/controller/PhragmentSnapshotDeleteController.php +++ b/src/applications/phragment/controller/PhragmentSnapshotDeleteController.php @@ -45,8 +45,8 @@ ->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 --- a/src/applications/phragment/controller/PhragmentSnapshotPromoteController.php +++ b/src/applications/phragment/controller/PhragmentSnapshotPromoteController.php @@ -80,7 +80,7 @@ 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 @@ 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 --- a/src/applications/phragment/controller/PhragmentSnapshotViewController.php +++ b/src/applications/phragment/controller/PhragmentSnapshotViewController.php @@ -9,7 +9,7 @@ } public function willProcessRequest(array $data) { - $this->id = idx($data, "id", ""); + $this->id = idx($data, 'id', ''); } public function processRequest() { @@ -100,8 +100,8 @@ ->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 @@ 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 @@ 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 --- a/src/applications/phragment/controller/PhragmentUpdateController.php +++ b/src/applications/phragment/controller/PhragmentUpdateController.php @@ -5,7 +5,7 @@ private $dblob; public function willProcessRequest(array $data) { - $this->dblob = idx($data, "dblob", ""); + $this->dblob = idx($data, 'dblob', ''); } public function processRequest() { @@ -34,7 +34,7 @@ // 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 --- a/src/applications/phragment/controller/PhragmentVersionController.php +++ b/src/applications/phragment/controller/PhragmentVersionController.php @@ -9,7 +9,7 @@ } public function willProcessRequest(array $data) { - $this->id = idx($data, "id", 0); + $this->id = idx($data, 'id', 0); } public function processRequest() { @@ -48,7 +48,7 @@ $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 @@ '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 @@ $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 --- a/src/applications/phragment/controller/PhragmentZIPController.php +++ b/src/applications/phragment/controller/PhragmentZIPController.php @@ -12,8 +12,8 @@ } 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 @@ } 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 --- a/src/applications/phragment/phid/PhragmentPHIDTypeFragment.php +++ b/src/applications/phragment/phid/PhragmentPHIDTypeFragment.php @@ -35,7 +35,7 @@ $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 --- a/src/applications/phragment/phid/PhragmentPHIDTypeFragmentVersion.php +++ b/src/applications/phragment/phid/PhragmentPHIDTypeFragmentVersion.php @@ -35,7 +35,7 @@ $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 --- a/src/applications/phragment/storage/PhragmentFragment.php +++ b/src/applications/phragment/storage/PhragmentFragment.php @@ -85,7 +85,7 @@ 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 @@ 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 @@ $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 @@ 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 --- 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 @@ $new_hash = $new->getContentHash(); } - $old_content = ""; - $new_content = ""; + $old_content = ''; + $new_content = ''; if ($old_hash === $new_hash) { return null; @@ -36,13 +36,13 @@ 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 --- a/src/applications/phrequent/config/PhabricatorPhrequentConfigOptions.php +++ b/src/applications/phrequent/config/PhabricatorPhrequentConfigOptions.php @@ -4,11 +4,11 @@ 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 --- a/src/applications/phrequent/controller/PhrequentTrackController.php +++ b/src/applications/phrequent/controller/PhrequentTrackController.php @@ -81,7 +81,7 @@ $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 --- a/src/applications/phrequent/query/PhrequentSearchEngine.php +++ b/src/applications/phrequent/query/PhrequentSearchEngine.php @@ -186,7 +186,7 @@ ->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 --- a/src/applications/phriction/conduit/ConduitAPI_phriction_edit_Method.php +++ b/src/applications/phriction/conduit/ConduitAPI_phriction_edit_Method.php @@ -4,7 +4,7 @@ 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 --- a/src/applications/phriction/config/PhabricatorPhrictionConfigOptions.php +++ b/src/applications/phriction/config/PhabricatorPhrictionConfigOptions.php @@ -4,18 +4,18 @@ 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 --- a/src/applications/phriction/controller/PhrictionDiffController.php +++ b/src/applications/phriction/controller/PhrictionDiffController.php @@ -114,7 +114,7 @@ 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 --- a/src/applications/phriction/controller/PhrictionDocumentController.php +++ b/src/applications/phriction/controller/PhrictionDocumentController.php @@ -289,7 +289,7 @@ } 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 --- a/src/applications/phriction/controller/PhrictionHistoryController.php +++ b/src/applications/phriction/controller/PhrictionHistoryController.php @@ -83,7 +83,7 @@ $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 --- a/src/applications/phriction/controller/PhrictionMoveController.php +++ b/src/applications/phriction/controller/PhrictionMoveController.php @@ -70,7 +70,7 @@ 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 --- a/src/applications/phriction/editor/PhrictionDocumentEditor.php +++ b/src/applications/phriction/editor/PhrictionDocumentEditor.php @@ -293,15 +293,15 @@ 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 --- a/src/applications/policy/__tests__/PhabricatorPolicyTestCase.php +++ b/src/applications/policy/__tests__/PhabricatorPolicyTestCase.php @@ -175,7 +175,7 @@ * 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 @@ * 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 --- a/src/applications/policy/config/PhabricatorPolicyConfigOptions.php +++ b/src/applications/policy/config/PhabricatorPolicyConfigOptions.php @@ -4,11 +4,11 @@ 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 @@ 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 --- a/src/applications/policy/controller/PhabricatorPolicyEditController.php +++ b/src/applications/policy/controller/PhabricatorPolicyEditController.php @@ -54,7 +54,7 @@ $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 @@ 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 --- a/src/applications/policy/management/PhabricatorPolicyManagementShowWorkflow.php +++ b/src/applications/policy/management/PhabricatorPolicyManagementShowWorkflow.php @@ -8,7 +8,7 @@ ->setName('show') ->setSynopsis('Show policy information about an object.') ->setExamples( - "**show** D123") + '**show** D123') ->setArguments( array( array( @@ -26,12 +26,12 @@ 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 --- a/src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php +++ b/src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php @@ -10,7 +10,7 @@ '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 @@ 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 --- a/src/applications/policy/query/PhabricatorPolicyQuery.php +++ b/src/applications/policy/query/PhabricatorPolicyQuery.php @@ -56,8 +56,8 @@ 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 --- a/src/applications/ponder/controller/PonderQuestionViewController.php +++ b/src/applications/ponder/controller/PonderQuestionViewController.php @@ -41,7 +41,7 @@ $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 --- a/src/applications/ponder/editor/PonderVoteEditor.php +++ b/src/applications/ponder/editor/PonderVoteEditor.php @@ -25,7 +25,7 @@ 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 --- a/src/applications/ponder/mail/PonderQuestionReplyHandler.php +++ b/src/applications/ponder/mail/PonderQuestionReplyHandler.php @@ -4,7 +4,7 @@ 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 --- a/src/applications/ponder/storage/PonderAnswer.php +++ b/src/applications/ponder/storage/PonderAnswer.php @@ -160,11 +160,11 @@ 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 --- a/src/applications/ponder/storage/PonderQuestion.php +++ b/src/applications/ponder/storage/PonderQuestion.php @@ -48,7 +48,7 @@ } 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 --- 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 --- a/src/applications/project/config/PhabricatorProjectConfigOptions.php +++ b/src/applications/project/config/PhabricatorProjectConfigOptions.php @@ -4,11 +4,11 @@ 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 @@ ->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 --- a/src/applications/project/storage/PhabricatorProject.php +++ b/src/applications/project/storage/PhabricatorProject.php @@ -86,9 +86,9 @@ 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 --- a/src/applications/releeph/commitfinder/ReleephCommitFinder.php +++ b/src/applications/releeph/commitfinder/ReleephCommitFinder.php @@ -60,7 +60,7 @@ $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 --- a/src/applications/releeph/conduit/ConduitAPI_releeph_getbranches_Method.php +++ b/src/applications/releeph/conduit/ConduitAPI_releeph_getbranches_Method.php @@ -4,7 +4,7 @@ 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 --- a/src/applications/releeph/conduit/ConduitAPI_releeph_projectinfo_Method.php +++ b/src/applications/releeph/conduit/ConduitAPI_releeph_projectinfo_Method.php @@ -5,8 +5,8 @@ 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 @@ 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 @@ $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 --- a/src/applications/releeph/conduit/ConduitAPI_releeph_queryrequests_Method.php +++ b/src/applications/releeph/conduit/ConduitAPI_releeph_queryrequests_Method.php @@ -5,7 +5,7 @@ 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 --- a/src/applications/releeph/conduit/ConduitAPI_releeph_request_Method.php +++ b/src/applications/releeph/conduit/ConduitAPI_releeph_request_Method.php @@ -4,7 +4,7 @@ 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 @@ 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 @@ ->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 --- 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 @@ } 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 --- 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 @@ } 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 --- 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 @@ } 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 --- 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 @@ } 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 @@ $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 @@ $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 --- 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 @@ 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 --- 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 @@ 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 @@ $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 --- 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 @@ * 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 --- 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 @@ } 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 --- a/src/applications/releeph/config/PhabricatorApplicationReleephConfigOptions.php +++ b/src/applications/releeph/config/PhabricatorApplicationReleephConfigOptions.php @@ -4,11 +4,11 @@ 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 @@ ->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 @@ '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 --- a/src/applications/releeph/controller/product/ReleephProductEditController.php +++ b/src/applications/releeph/controller/product/ReleephProductEditController.php @@ -71,7 +71,7 @@ '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 @@ ->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 --- a/src/applications/releeph/controller/request/ReleephRequestDifferentialCreateController.php +++ b/src/applications/releeph/controller/request/ReleephRequestDifferentialCreateController.php @@ -44,8 +44,8 @@ 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 @@ ->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 --- a/src/applications/releeph/controller/request/ReleephRequestEditController.php +++ b/src/applications/releeph/controller/request/ReleephRequestEditController.php @@ -93,7 +93,7 @@ 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 @@ $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 --- a/src/applications/releeph/controller/request/ReleephRequestViewController.php +++ b/src/applications/releeph/controller/request/ReleephRequestViewController.php @@ -73,7 +73,7 @@ $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 --- a/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php +++ b/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php @@ -217,8 +217,8 @@ $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 @@ 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 --- a/src/applications/releeph/editor/ReleephRequestTransactionalEditor.php +++ b/src/applications/releeph/editor/ReleephRequestTransactionalEditor.php @@ -253,7 +253,7 @@ } } - $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 --- a/src/applications/releeph/field/specification/ReleephDiffSizeFieldSpecification.php +++ b/src/applications/releeph/field/specification/ReleephDiffSizeFieldSpecification.php @@ -70,7 +70,7 @@ ' + 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 --- a/src/applications/releeph/field/specification/ReleephIntentFieldSpecification.php +++ b/src/applications/releeph/field/specification/ReleephIntentFieldSpecification.php @@ -83,11 +83,11 @@ } 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 --- a/src/applications/releeph/field/specification/ReleephLevelFieldSpecification.php +++ b/src/applications/releeph/field/specification/ReleephLevelFieldSpecification.php @@ -43,7 +43,7 @@ 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 --- a/src/applications/releeph/field/specification/ReleephReasonFieldSpecification.php +++ b/src/applications/releeph/field/specification/ReleephReasonFieldSpecification.php @@ -47,7 +47,7 @@ $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 --- a/src/applications/releeph/field/specification/ReleephRequestorFieldSpecification.php +++ b/src/applications/releeph/field/specification/ReleephRequestorFieldSpecification.php @@ -35,7 +35,7 @@ } 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 --- a/src/applications/releeph/mail/ReleephRequestReplyHandler.php +++ b/src/applications/releeph/mail/ReleephRequestReplyHandler.php @@ -4,7 +4,7 @@ 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 --- a/src/applications/releeph/storage/ReleephRequest.php +++ b/src/applications/releeph/storage/ReleephRequest.php @@ -131,10 +131,10 @@ // 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 --- a/src/applications/releeph/storage/ReleephRequestTransaction.php +++ b/src/applications/releeph/storage/ReleephRequestTransaction.php @@ -256,7 +256,7 @@ // 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 --- a/src/applications/releeph/view/branch/ReleephBranchTemplate.php +++ b/src/applications/releeph/view/branch/ReleephBranchTemplate.php @@ -174,9 +174,9 @@ $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 --- a/src/applications/repository/PhabricatorRepositoryConfigOptions.php +++ b/src/applications/repository/PhabricatorRepositoryConfigOptions.php @@ -19,13 +19,13 @@ $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 --- a/src/applications/repository/application/PhabricatorApplicationRepositories.php +++ b/src/applications/repository/application/PhabricatorApplicationRepositories.php @@ -18,7 +18,7 @@ } 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 --- a/src/applications/repository/conduit/ConduitAPI_repository_create_Method.php +++ b/src/applications/repository/conduit/ConduitAPI_repository_create_Method.php @@ -11,11 +11,11 @@ } 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 --- a/src/applications/repository/conduit/ConduitAPI_repository_query_Method.php +++ b/src/applications/repository/conduit/ConduitAPI_repository_query_Method.php @@ -8,11 +8,11 @@ } 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 --- a/src/applications/repository/controller/PhabricatorRepositoryController.php +++ b/src/applications/repository/controller/PhabricatorRepositoryController.php @@ -13,7 +13,7 @@ $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 --- a/src/applications/repository/daemon/PhabricatorGitGraphStream.php +++ b/src/applications/repository/daemon/PhabricatorGitGraphStream.php @@ -16,7 +16,7 @@ $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 --- a/src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php +++ b/src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php @@ -110,16 +110,16 @@ $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 @@ $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 @@ $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 --- a/src/applications/repository/engine/PhabricatorRepositoryEngine.php +++ b/src/applications/repository/engine/PhabricatorRepositoryEngine.php @@ -23,7 +23,7 @@ */ 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 --- a/src/applications/repository/graphcache/PhabricatorRepositoryGraphCache.php +++ b/src/applications/repository/graphcache/PhabricatorRepositoryGraphCache.php @@ -123,7 +123,7 @@ // 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 --- a/src/applications/repository/management/PhabricatorRepositoryManagementCacheWorkflow.php +++ b/src/applications/repository/management/PhabricatorRepositoryManagementCacheWorkflow.php @@ -7,7 +7,7 @@ $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 --- a/src/applications/repository/management/PhabricatorRepositoryManagementDiscoverWorkflow.php +++ b/src/applications/repository/management/PhabricatorRepositoryManagementDiscoverWorkflow.php @@ -31,7 +31,7 @@ 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 --- a/src/applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php +++ b/src/applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php @@ -32,7 +32,7 @@ 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 @@ $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 @@ 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 --- a/src/applications/repository/management/PhabricatorRepositoryManagementImportingWorkflow.php +++ b/src/applications/repository/management/PhabricatorRepositoryManagementImportingWorkflow.php @@ -28,8 +28,8 @@ 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 @@ $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 @@ $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 --- a/src/applications/repository/management/PhabricatorRepositoryManagementLookupUsersWorkflow.php +++ b/src/applications/repository/management/PhabricatorRepositoryManagementLookupUsersWorkflow.php @@ -21,7 +21,7 @@ $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 @@ $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 --- a/src/applications/repository/management/PhabricatorRepositoryManagementMarkImportedWorkflow.php +++ b/src/applications/repository/management/PhabricatorRepositoryManagementMarkImportedWorkflow.php @@ -26,7 +26,7 @@ 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 --- a/src/applications/repository/management/PhabricatorRepositoryManagementMirrorWorkflow.php +++ b/src/applications/repository/management/PhabricatorRepositoryManagementMirrorWorkflow.php @@ -28,8 +28,8 @@ 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 --- a/src/applications/repository/management/PhabricatorRepositoryManagementPullWorkflow.php +++ b/src/applications/repository/management/PhabricatorRepositoryManagementPullWorkflow.php @@ -26,7 +26,7 @@ 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 --- a/src/applications/repository/management/PhabricatorRepositoryManagementRefsWorkflow.php +++ b/src/applications/repository/management/PhabricatorRepositoryManagementRefsWorkflow.php @@ -27,8 +27,8 @@ 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 --- a/src/applications/repository/phid/PhabricatorRepositoryPHIDTypeMirror.php +++ b/src/applications/repository/phid/PhabricatorRepositoryPHIDTypeMirror.php @@ -35,7 +35,7 @@ $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 --- a/src/applications/repository/search/PhabricatorRepositoryCommitSearchIndexer.php +++ b/src/applications/repository/search/PhabricatorRepositoryCommitSearchIndexer.php @@ -22,11 +22,11 @@ ->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 --- a/src/applications/repository/storage/PhabricatorRepository.php +++ b/src/applications/repository/storage/PhabricatorRepository.php @@ -176,7 +176,7 @@ 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 @@ $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 @@ // 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 @@ } break; default: - throw new Exception("Unrecognized version control system."); + throw new Exception('Unrecognized version control system.'); } array_unshift($args, $pattern); @@ -480,7 +480,7 @@ $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 @@ $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 @@ 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 --- a/src/applications/repository/storage/PhabricatorRepositoryVCSPassword.php +++ b/src/applications/repository/storage/PhabricatorRepositoryVCSPassword.php @@ -26,7 +26,7 @@ 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 --- a/src/applications/repository/storage/__tests__/PhabricatorRepositoryTestCase.php +++ b/src/applications/repository/storage/__tests__/PhabricatorRepositoryTestCase.php @@ -106,7 +106,7 @@ public function testFilterMercurialDebugOutput() { $map = array( - "" => "", + '' => '', "quack\n" => "quack\n", @@ -143,7 +143,7 @@ "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 --- a/src/applications/repository/worker/PhabricatorRepositoryCommitHeraldWorker.php +++ b/src/applications/repository/worker/PhabricatorRepositoryCommitHeraldWorker.php @@ -201,7 +201,7 @@ $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 --- a/src/applications/repository/worker/PhabricatorRepositoryCommitOwnersWorker.php +++ b/src/applications/repository/worker/PhabricatorRepositoryCommitOwnersWorker.php @@ -92,12 +92,12 @@ $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 @@ $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 @@ 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 --- a/src/applications/repository/worker/commitchangeparser/PhabricatorOwnersPackagePathValidator.php +++ b/src/applications/repository/worker/commitchangeparser/PhabricatorOwnersPackagePathValidator.php @@ -21,11 +21,11 @@ $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 --- a/src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryCommitChangeParserWorker.php +++ b/src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryCommitChangeParserWorker.php @@ -23,7 +23,7 @@ $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 --- a/src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php +++ b/src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php @@ -201,7 +201,7 @@ 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 @@ '((.*?))?@'; $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 @@ } } 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 --- a/src/applications/search/config/PhabricatorSearchConfigOptions.php +++ b/src/applications/search/config/PhabricatorSearchConfigOptions.php @@ -4,11 +4,11 @@ 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 @@ '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 --- a/src/applications/search/controller/PhabricatorApplicationSearchController.php +++ b/src/applications/search/controller/PhabricatorApplicationSearchController.php @@ -50,19 +50,19 @@ 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 @@ // 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 @@ $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 @@ 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 --- a/src/applications/search/controller/PhabricatorSearchAttachController.php +++ b/src/applications/search/controller/PhabricatorSearchAttachController.php @@ -249,17 +249,17 @@ $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 --- a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php +++ b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php @@ -30,7 +30,7 @@ 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 --- a/src/applications/search/engine/PhabricatorSearchEngineElastic.php +++ b/src/applications/search/engine/PhabricatorSearchEngineElastic.php @@ -254,7 +254,7 @@ $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 --- a/src/applications/search/engine/PhabricatorSearchEngineMySQL.php +++ b/src/applications/search/engine/PhabricatorSearchEngineMySQL.php @@ -10,7 +10,7 @@ $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 --- a/src/applications/search/storage/PhabricatorSavedQuery.php +++ b/src/applications/search/storage/PhabricatorSavedQuery.php @@ -29,7 +29,7 @@ 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 --- a/src/applications/settings/panel/PhabricatorSettingsPanelAccount.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelAccount.php @@ -90,7 +90,7 @@ ->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 @@ "| `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 --- a/src/applications/settings/panel/PhabricatorSettingsPanelDiffPreferences.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelDiffPreferences.php @@ -50,9 +50,9 @@ 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 --- a/src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php @@ -312,7 +312,7 @@ $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 @@ $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 --- a/src/applications/settings/panel/PhabricatorSettingsPanelEmailPreferences.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelEmailPreferences.php @@ -217,25 +217,25 @@ 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 @@ 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 --- a/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php @@ -365,7 +365,7 @@ ->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 --- a/src/applications/slowvote/conduit/ConduitAPI_slowvote_info_Method.php +++ b/src/applications/slowvote/conduit/ConduitAPI_slowvote_info_Method.php @@ -7,7 +7,7 @@ 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 --- a/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php +++ b/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php @@ -152,7 +152,7 @@ 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 --- a/src/applications/slowvote/view/SlowvoteEmbedView.php +++ b/src/applications/slowvote/view/SlowvoteEmbedView.php @@ -25,7 +25,7 @@ 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 --- a/src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php +++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php @@ -72,20 +72,20 @@ 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 --- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php +++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php @@ -252,13 +252,13 @@ 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 @@ 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 @@ 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 @@ * @task mail */ protected function buildReplyHandler(PhabricatorLiskDAO $object) { - throw new Exception("Capability not supported."); + throw new Exception('Capability not supported.'); } @@ -1877,7 +1877,7 @@ * @task mail */ protected function getMailSubjectPrefix() { - throw new Exception("Capability not supported."); + throw new Exception('Capability not supported.'); } @@ -1910,7 +1910,7 @@ * @task mail */ protected function buildMailTemplate(PhabricatorLiskDAO $object) { - throw new Exception("Capability not supported."); + throw new Exception('Capability not supported.'); } @@ -1918,7 +1918,7 @@ * @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 --- a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php +++ b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php @@ -76,7 +76,7 @@ } public function getApplicationTransactionCommentObject() { - throw new Exception("Not implemented!"); + throw new Exception('Not implemented!'); } public function getApplicationTransactionViewObject() { @@ -125,7 +125,7 @@ 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 --- a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php +++ b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php @@ -151,7 +151,7 @@ } 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 --- a/src/applications/transactions/view/PhabricatorApplicationTransactionView.php +++ b/src/applications/transactions/view/PhabricatorApplicationTransactionView.php @@ -148,7 +148,7 @@ 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 --- a/src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php +++ b/src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php @@ -285,7 +285,7 @@ $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 --- a/src/applications/uiexample/examples/PHUITimelineExample.php +++ b/src/applications/uiexample/examples/PHUITimelineExample.php @@ -119,7 +119,7 @@ $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 --- 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 @@ } 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 --- a/src/applications/uiexample/examples/PhabricatorBusyExample.php +++ b/src/applications/uiexample/examples/PhabricatorBusyExample.php @@ -7,7 +7,7 @@ } 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 --- a/src/applications/uiexample/examples/PhabricatorHovercardExample.php +++ b/src/applications/uiexample/examples/PhabricatorHovercardExample.php @@ -18,11 +18,11 @@ $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 @@ $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 @@ '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 @@ ->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 --- a/src/applications/xhprof/controller/PhabricatorXHProfProfileController.php +++ b/src/applications/xhprof/controller/PhabricatorXHProfProfileController.php @@ -23,7 +23,7 @@ $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 --- a/src/infrastructure/celerity/CelerityResourceController.php +++ b/src/infrastructure/celerity/CelerityResourceController.php @@ -31,7 +31,7 @@ $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 @@ // 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 --- a/src/infrastructure/celerity/CelerityResourceGraph.php +++ b/src/infrastructure/celerity/CelerityResourceGraph.php @@ -8,7 +8,7 @@ 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 --- a/src/infrastructure/celerity/management/CelerityManagementMapWorkflow.php +++ b/src/infrastructure/celerity/management/CelerityManagementMapWorkflow.php @@ -17,14 +17,14 @@ $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 --- a/src/infrastructure/daemon/bot/PhabricatorBot.php +++ b/src/infrastructure/daemon/bot/PhabricatorBot.php @@ -21,7 +21,7 @@ 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 @@ } 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 --- 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 --- a/src/infrastructure/daemon/bot/adapter/PhabricatorBotBaseStreamingProtocolAdapter.php +++ b/src/infrastructure/daemon/bot/adapter/PhabricatorBotBaseStreamingProtocolAdapter.php @@ -23,7 +23,7 @@ // 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 @@ 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 @@ // 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 @@ $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 --- a/src/infrastructure/daemon/bot/adapter/PhabricatorBotFlowdockProtocolAdapter.php +++ b/src/infrastructure/daemon/bot/adapter/PhabricatorBotFlowdockProtocolAdapter.php @@ -11,7 +11,7 @@ $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 @@ $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 --- a/src/infrastructure/daemon/bot/adapter/PhabricatorCampfireProtocolAdapter.php +++ b/src/infrastructure/daemon/bot/adapter/PhabricatorCampfireProtocolAdapter.php @@ -10,7 +10,7 @@ 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 --- a/src/infrastructure/daemon/bot/adapter/PhabricatorIRCProtocolAdapter.php +++ b/src/infrastructure/daemon/bot/adapter/PhabricatorIRCProtocolAdapter.php @@ -47,7 +47,7 @@ } $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 @@ $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 @@ // 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 @@ 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 @@ } $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 @@ } 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 --- a/src/infrastructure/daemon/bot/handler/PhabricatorBotHandler.php +++ b/src/infrastructure/daemon/bot/handler/PhabricatorBotHandler.php @@ -50,7 +50,7 @@ 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 --- a/src/infrastructure/daemon/bot/handler/PhabricatorBotObjectNameHandler.php +++ b/src/infrastructure/daemon/bot/handler/PhabricatorBotObjectNameHandler.php @@ -126,7 +126,7 @@ 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 --- a/src/infrastructure/daemon/bot/handler/PhabricatorIRCProtocolHandler.php +++ b/src/infrastructure/daemon/bot/handler/PhabricatorIRCProtocolHandler.php @@ -9,7 +9,7 @@ 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 --- a/src/infrastructure/daemon/workers/PhabricatorWorker.php +++ b/src/infrastructure/daemon/workers/PhabricatorWorker.php @@ -187,7 +187,7 @@ 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 --- a/src/infrastructure/daemon/workers/__tests__/PhabricatorTestWorker.php +++ b/src/infrastructure/daemon/workers/__tests__/PhabricatorTestWorker.php @@ -27,10 +27,10 @@ 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 --- a/src/infrastructure/daemon/workers/query/PhabricatorWorkerLeaseQuery.php +++ b/src/infrastructure/daemon/workers/query/PhabricatorWorkerLeaseQuery.php @@ -33,7 +33,7 @@ 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 --- a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php +++ b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php @@ -67,8 +67,8 @@ 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 --- a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerArchiveTask.php +++ b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerArchiveTask.php @@ -12,7 +12,7 @@ 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 --- a/src/infrastructure/edges/query/PhabricatorEdgeQuery.php +++ b/src/infrastructure/edges/query/PhabricatorEdgeQuery.php @@ -160,7 +160,7 @@ 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 @@ 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 --- a/src/infrastructure/edges/util/PhabricatorEdgeGraph.php +++ b/src/infrastructure/edges/util/PhabricatorEdgeGraph.php @@ -11,7 +11,7 @@ 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 --- a/src/infrastructure/env/PhabricatorConfigProxySource.php +++ b/src/infrastructure/env/PhabricatorConfigProxySource.php @@ -10,7 +10,7 @@ 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 --- a/src/infrastructure/env/PhabricatorConfigSource.php +++ b/src/infrastructure/env/PhabricatorConfigSource.php @@ -21,11 +21,11 @@ } 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 --- a/src/infrastructure/env/PhabricatorConfigStackSource.php +++ b/src/infrastructure/env/PhabricatorConfigStackSource.php @@ -19,7 +19,7 @@ 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 --- a/src/infrastructure/env/PhabricatorEnv.php +++ b/src/infrastructure/env/PhabricatorEnv.php @@ -139,7 +139,7 @@ $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 @@ 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 @@ 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 @@ 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 @@ 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 --- a/src/infrastructure/env/__tests__/PhabricatorEnvTestCase.php +++ b/src/infrastructure/env/__tests__/PhabricatorEnvTestCase.php @@ -141,8 +141,8 @@ $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 @@ 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 @@ $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 --- a/src/infrastructure/events/PhabricatorEventListener.php +++ b/src/infrastructure/events/PhabricatorEventListener.php @@ -30,7 +30,7 @@ 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 --- a/src/infrastructure/internationalization/translation/PhabricatorBaseEnglishTranslation.php +++ b/src/infrastructure/internationalization/translation/PhabricatorBaseEnglishTranslation.php @@ -654,9 +654,9 @@ '%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 --- a/src/infrastructure/lint/linter/PhabricatorJavelinLinter.php +++ b/src/infrastructure/lint/linter/PhabricatorJavelinLinter.php @@ -243,7 +243,7 @@ $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 --- a/src/infrastructure/markup/PhabricatorMarkupEngine.php +++ b/src/infrastructure/markup/PhabricatorMarkupEngine.php @@ -190,7 +190,7 @@ 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 --- a/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php +++ b/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php @@ -163,7 +163,7 @@ } if (count($results) > 1) { - throw new Exception("Expected a single result!"); + throw new Exception('Expected a single result!'); } if (!$results) { @@ -182,7 +182,7 @@ */ 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 --- a/src/infrastructure/sms/management/PhabricatorSMSManagementListOutboundWorkflow.php +++ b/src/infrastructure/sms/management/PhabricatorSMSManagementListOutboundWorkflow.php @@ -8,7 +8,7 @@ ->setName('list-outbound') ->setSynopsis('List outbound sms messages sent by Phabricator.') ->setExamples( - "**list-outbound**") + '**list-outbound**') ->setArguments( array( array( @@ -30,7 +30,7 @@ $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 @@ $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 --- a/src/infrastructure/sms/management/PhabricatorSMSManagementShowOutboundWorkflow.php +++ b/src/infrastructure/sms/management/PhabricatorSMSManagementShowOutboundWorkflow.php @@ -8,7 +8,7 @@ ->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 @@ $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 --- a/src/infrastructure/ssh/PhabricatorSSHPassthruCommand.php +++ b/src/infrastructure/ssh/PhabricatorSSHPassthruCommand.php @@ -84,15 +84,15 @@ $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 --- a/src/infrastructure/storage/__tests__/QueryFormattingTestCase.php +++ b/src/infrastructure/storage/__tests__/QueryFormattingTestCase.php @@ -44,7 +44,7 @@ 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 --- a/src/infrastructure/storage/lisk/LiskDAO.php +++ b/src/infrastructure/storage/lisk/LiskDAO.php @@ -487,7 +487,7 @@ 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 @@ 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 @@ 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 @@ $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 @@ */ 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 @@ 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 @@ 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 --- a/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php +++ b/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php @@ -7,7 +7,7 @@ private static $namespaceStack = array(); - const ATTACHABLE = ""; + const ATTACHABLE = ''; /* -( Configuring Storage )------------------------------------------------ */ @@ -41,7 +41,7 @@ $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 --- a/src/infrastructure/storage/lisk/__tests__/LiskFixtureTestCase.php +++ b/src/infrastructure/storage/lisk/__tests__/LiskFixtureTestCase.php @@ -67,7 +67,7 @@ $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 @@ $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 --- a/src/infrastructure/storage/lisk/__tests__/LiskIsolationTestCase.php +++ b/src/infrastructure/storage/lisk/__tests__/LiskIsolationTestCase.php @@ -48,8 +48,8 @@ $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 --- a/src/infrastructure/storage/lisk/__tests__/LiskIsolationTestDAO.php +++ b/src/infrastructure/storage/lisk/__tests__/LiskIsolationTestDAO.php @@ -17,8 +17,8 @@ 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 --- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDestroyWorkflow.php +++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDestroyWorkflow.php @@ -12,8 +12,8 @@ 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 @@ 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 --- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementProbeWorkflow.php +++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementProbeWorkflow.php @@ -14,7 +14,7 @@ $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 @@ } } - $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 --- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementStatusWorkflow.php +++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementStatusWorkflow.php @@ -33,7 +33,7 @@ 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 --- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementUpgradeWorkflow.php +++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementUpgradeWorkflow.php @@ -7,7 +7,7 @@ $this ->setName('upgrade') ->setExamples('**upgrade** [__options__]') - ->setSynopsis("Upgrade database schemata.") + ->setSynopsis('Upgrade database schemata.') ->setArguments( array( array( @@ -38,9 +38,9 @@ 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 @@ 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 @@ 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 --- a/src/infrastructure/testing/PhabricatorTestCase.php +++ b/src/infrastructure/testing/PhabricatorTestCase.php @@ -128,8 +128,8 @@ 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 @@ 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 --- a/src/infrastructure/time/PhabricatorTime.php +++ b/src/infrastructure/time/PhabricatorTime.php @@ -25,7 +25,7 @@ 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 --- a/src/infrastructure/util/PhabricatorHash.php +++ b/src/infrastructure/util/PhabricatorHash.php @@ -30,7 +30,7 @@ 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 @@ 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 --- a/src/infrastructure/util/__tests__/PhabricatorSlugTestCase.php +++ b/src/infrastructure/util/__tests__/PhabricatorSlugTestCase.php @@ -14,7 +14,7 @@ '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 --- a/src/infrastructure/util/password/PhabricatorBcryptPasswordHasher.php +++ b/src/infrastructure/util/password/PhabricatorBcryptPasswordHasher.php @@ -28,7 +28,7 @@ } 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 --- a/src/infrastructure/util/password/PhabricatorIteratedMD5PasswordHasher.php +++ b/src/infrastructure/util/password/PhabricatorIteratedMD5PasswordHasher.php @@ -29,7 +29,7 @@ } 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 --- a/src/view/AphrontDialogView.php +++ b/src/view/AphrontDialogView.php @@ -203,7 +203,7 @@ 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 --- a/src/view/__tests__/PhabricatorAphrontViewTestCase.php +++ b/src/view/__tests__/PhabricatorAphrontViewTestCase.php @@ -18,7 +18,7 @@ $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 --- a/src/view/control/AphrontCursorPagerView.php +++ b/src/view/control/AphrontCursorPagerView.php @@ -89,7 +89,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ array( 'href' => $first_uri, ), - "\xC2\xAB ". pht("First")); + "\xC2\xAB ". pht('First')); } $prev_uri = $this->getPrevPageURI(); @@ -156,7 +156,7 @@ array( 'href' => $prev_uri, ), - "\xE2\x80\xB9 " . pht("Prev")); + "\xE2\x80\xB9 " . pht('Prev')); } $next_uri = $this->getNextPageURI(); @@ -166,7 +166,7 @@ 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 --- a/src/view/control/AphrontPagerView.php +++ b/src/view/control/AphrontPagerView.php @@ -110,7 +110,7 @@ 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 --- a/src/view/form/PHUIFormLayoutView.php +++ b/src/view/form/PHUIFormLayoutView.php @@ -27,7 +27,7 @@ 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 --- a/src/view/form/PHUIFormPageView.php +++ b/src/view/form/PHUIFormPageView.php @@ -85,7 +85,7 @@ $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 @@ 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 --- a/src/view/form/PHUIPagedFormView.php +++ b/src/view/form/PHUIPagedFormView.php @@ -226,7 +226,7 @@ $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 @@ } 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 --- a/src/view/form/control/AphrontFormControl.php +++ b/src/view/form/control/AphrontFormControl.php @@ -133,7 +133,7 @@ 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 @@ 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 --- a/src/view/form/control/AphrontFormDateControl.php +++ b/src/view/form/control/AphrontFormDateControl.php @@ -286,7 +286,7 @@ $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 --- a/src/view/form/control/AphrontFormPolicyControl.php +++ b/src/view/form/control/AphrontFormPolicyControl.php @@ -113,10 +113,10 @@ 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 --- a/src/view/layout/AphrontMultiColumnView.php +++ b/src/view/layout/AphrontMultiColumnView.php @@ -66,7 +66,7 @@ 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 --- a/src/view/layout/AphrontPanelView.php +++ b/src/view/layout/AphrontPanelView.php @@ -78,7 +78,7 @@ 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 --- a/src/view/layout/AphrontSideNavFilterView.php +++ b/src/view/layout/AphrontSideNavFilterView.php @@ -165,10 +165,10 @@ 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 --- a/src/view/layout/PhabricatorActionListView.php +++ b/src/view/layout/PhabricatorActionListView.php @@ -29,7 +29,7 @@ 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 --- a/src/view/layout/PhabricatorSourceCodeView.php +++ b/src/view/layout/PhabricatorSourceCodeView.php @@ -71,7 +71,7 @@ } 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 --- a/src/view/layout/PhabricatorTransactionView.php +++ b/src/view/layout/PhabricatorTransactionView.php @@ -49,7 +49,7 @@ 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 --- a/src/view/page/PhabricatorStandardPageView.php +++ b/src/view/page/PhabricatorStandardPageView.php @@ -101,7 +101,7 @@ 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 --- a/src/view/phui/PHUIButtonBarView.php +++ b/src/view/phui/PHUIButtonBarView.php @@ -27,9 +27,9 @@ 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 --- a/src/view/phui/PHUIFeedStoryView.php +++ b/src/view/phui/PHUIFeedStoryView.php @@ -256,10 +256,10 @@ 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 --- a/src/view/phui/PHUIIconView.php +++ b/src/view/phui/PHUIIconView.php @@ -76,7 +76,7 @@ $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 --- a/src/view/phui/PHUIObjectItemView.php +++ b/src/view/phui/PHUIObjectItemView.php @@ -182,7 +182,7 @@ 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 @@ 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 --- a/src/view/phui/PHUIRemarkupPreviewPanel.php +++ b/src/view/phui/PHUIRemarkupPreviewPanel.php @@ -69,10 +69,10 @@ 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 --- a/src/view/phui/PHUITagView.php +++ b/src/view/phui/PHUITagView.php @@ -92,7 +92,7 @@ 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 --- a/src/view/phui/calendar/PHUICalendarMonthView.php +++ b/src/view/phui/calendar/PHUICalendarMonthView.php @@ -42,7 +42,7 @@ 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 --- a/src/view/widget/hovercard/PhabricatorHovercardView.php +++ b/src/view/widget/hovercard/PhabricatorHovercardView.php @@ -62,14 +62,14 @@ 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 --- a/support/PhabricatorStartup.php +++ b/support/PhabricatorStartup.php @@ -209,7 +209,7 @@ 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 --- a/webroot/index.php +++ b/webroot/index.php @@ -129,7 +129,7 @@ $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,