1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Fix errors found by PHPStan

Test Plan: Ran `phpstan analyze -a autoload.php phabricator/src`.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, hach-que

Differential Revision: https://secure.phabricator.com/D17371
This commit is contained in:
Jakub Vrana 2017-02-17 10:10:15 +00:00 committed by vrana
parent b2739710ba
commit a778151f28
80 changed files with 92 additions and 147 deletions

View file

@ -61,7 +61,7 @@ final class PhabricatorAuthUnlinkController
return id(new AphrontRedirectResponse())->setURI($this->getDoneURI()); return id(new AphrontRedirectResponse())->setURI($this->getDoneURI());
} }
return $this->renderConfirmDialog($account); return $this->renderConfirmDialog();
} }
private function getDoneURI() { private function getDoneURI() {

View file

@ -40,7 +40,7 @@ final class PhabricatorBadgesAwardController
->setTransactionType(PhabricatorBadgesTransaction::TYPE_AWARD) ->setTransactionType(PhabricatorBadgesTransaction::TYPE_AWARD)
->setNewValue($award_phids); ->setNewValue($award_phids);
$editor = id(new PhabricatorBadgesEditor($badge)) $editor = id(new PhabricatorBadgesEditor())
->setActor($viewer) ->setActor($viewer)
->setContentSourceFromRequest($request) ->setContentSourceFromRequest($request)
->setContinueOnNoEffect(true) ->setContinueOnNoEffect(true)

View file

@ -40,7 +40,7 @@ final class PhabricatorBadgesEditRecipientsController
->setTransactionType(PhabricatorBadgesTransaction::TYPE_AWARD) ->setTransactionType(PhabricatorBadgesTransaction::TYPE_AWARD)
->setNewValue($award_phids); ->setNewValue($award_phids);
$editor = id(new PhabricatorBadgesEditor($badge)) $editor = id(new PhabricatorBadgesEditor())
->setActor($viewer) ->setActor($viewer)
->setContentSourceFromRequest($request) ->setContentSourceFromRequest($request)
->setContinueOnNoEffect(true) ->setContinueOnNoEffect(true)

View file

@ -37,7 +37,7 @@ final class PhabricatorBadgesRemoveRecipientsController
->setTransactionType(PhabricatorBadgesTransaction::TYPE_REVOKE) ->setTransactionType(PhabricatorBadgesTransaction::TYPE_REVOKE)
->setNewValue(array($remove_phid)); ->setNewValue(array($remove_phid));
$editor = id(new PhabricatorBadgesEditor($badge)) $editor = id(new PhabricatorBadgesEditor())
->setActor($viewer) ->setActor($viewer)
->setContentSourceFromRequest($request) ->setContentSourceFromRequest($request)
->setContinueOnNoEffect(true) ->setContinueOnNoEffect(true)

View file

@ -251,7 +251,7 @@ abstract class PhabricatorApplication
} }
final protected function getInboundEmailSupportLink() { final protected function getInboundEmailSupportLink() {
return PhabricatorEnv::getDocLink('Configuring Inbound Email'); return PhabricatorEnv::getDoclink('Configuring Inbound Email');
} }
public function getAppEmailBlurb() { public function getAppEmailBlurb() {

View file

@ -7,9 +7,7 @@ final class CalendarTimeUtilTestCase extends PhabricatorTestCase {
$u->overrideTimezoneIdentifier('America/Los_Angeles'); $u->overrideTimezoneIdentifier('America/Los_Angeles');
$days = $this->getAllDays(); $days = $this->getAllDays();
foreach ($days as $day) { foreach ($days as $day) {
$data = CalendarTimeUtil::getCalendarWidgetTimestamps( $data = CalendarTimeUtil::getTimestamps($u, $day, 1);
$u,
$day);
$this->assertEqual( $this->assertEqual(
'000000', '000000',

View file

@ -14,7 +14,7 @@ final class PhabricatorCalendarExternalInvitee
PhabricatorUser $actor, $event) { PhabricatorUser $actor, $event) {
return id(new PhabricatorCalendarEventInvitee()) return id(new PhabricatorCalendarEventInvitee())
->setInviterPHID($actor->getPHID()) ->setInviterPHID($actor->getPHID())
->setStatus(self::STATUS_INVITED) ->setStatus(PhabricatorCalendarEventInvitee::STATUS_INVITED)
->setEventPHID($event->getPHID()); ->setEventPHID($event->getPHID());
} }

View file

@ -154,7 +154,7 @@ abstract class PhabricatorConduitController extends PhabricatorController {
$parts[] = "\n\n"; $parts[] = "\n\n";
$parts[] = 'require_once '; $parts[] = 'require_once ';
$parts[] = phutil_var_export($libphutil_path, true); $parts[] = phutil_var_export($libphutil_path);
$parts[] = ";\n\n"; $parts[] = ";\n\n";
$parts[] = '$api_token = "'; $parts[] = '$api_token = "';
@ -168,7 +168,7 @@ abstract class PhabricatorConduitController extends PhabricatorController {
$parts[] = ');'; $parts[] = ');';
} else { } else {
$params = $this->simplifyParams($params); $params = $this->simplifyParams($params);
$params = phutil_var_export($params, true); $params = phutil_var_export($params);
$parts[] = phutil_tag('strong', array('class' => 'real'), $params); $parts[] = phutil_tag('strong', array('class' => 'real'), $params);
$parts[] = ';'; $parts[] = ';';
} }
@ -178,7 +178,7 @@ abstract class PhabricatorConduitController extends PhabricatorController {
$parts[] = phutil_tag( $parts[] = phutil_tag(
'strong', 'strong',
array('class' => 'real'), array('class' => 'real'),
phutil_var_export(PhabricatorEnv::getURI('/'), true)); phutil_var_export(PhabricatorEnv::getURI('/')));
$parts[] = ");\n"; $parts[] = ");\n";
$parts[] = '$client->setConduitToken($api_token);'; $parts[] = '$client->setConduitToken($api_token);';
@ -188,7 +188,7 @@ abstract class PhabricatorConduitController extends PhabricatorController {
$parts[] = phutil_tag( $parts[] = phutil_tag(
'strong', 'strong',
array('class' => 'real'), array('class' => 'real'),
phutil_var_export($method->getAPIMethodName(), true)); phutil_var_export($method->getAPIMethodName()));
$parts[] = ', '; $parts[] = ', ';
$parts[] = '$api_parameters'; $parts[] = '$api_parameters';
$parts[] = ");\n"; $parts[] = ");\n";

View file

@ -16,7 +16,7 @@ final class PhabricatorDaemonsSetupCheck extends PhabricatorSetupCheck {
->execute(); ->execute();
if (!$task_daemon) { if (!$task_daemon) {
$doc_href = PhabricatorEnv::getDocLink('Managing Daemons with phd'); $doc_href = PhabricatorEnv::getDoclink('Managing Daemons with phd');
$summary = pht( $summary = pht(
'You must start the Phabricator daemons to send email, rebuild '. 'You must start the Phabricator daemons to send email, rebuild '.

View file

@ -14,7 +14,7 @@ final class PhabricatorPHPConfigSetupCheck extends PhabricatorSetupCheck {
protected function executeChecks() { protected function executeChecks() {
if (empty($_SERVER['REMOTE_ADDR'])) { if (empty($_SERVER['REMOTE_ADDR'])) {
$doc_href = PhabricatorEnv::getDocLink('Configuring a Preamble Script'); $doc_href = PhabricatorEnv::getDoclink('Configuring a Preamble Script');
$summary = pht( $summary = pht(
'You likely need to fix your preamble script so '. 'You likely need to fix your preamble script so '.

View file

@ -52,7 +52,7 @@ final class PhabricatorSecuritySetupCheck extends PhabricatorSetupCheck {
$file_key = 'security.alternate-file-domain'; $file_key = 'security.alternate-file-domain';
$file_domain = PhabricatorEnv::getEnvConfig($file_key); $file_domain = PhabricatorEnv::getEnvConfig($file_key);
if (!$file_domain) { if (!$file_domain) {
$doc_href = PhabricatorEnv::getDocLink('Configuring a File Domain'); $doc_href = PhabricatorEnv::getDoclink('Configuring a File Domain');
$this->newIssue('security.'.$file_key) $this->newIssue('security.'.$file_key)
->setName(pht('Alternate File Domain Not Configured')) ->setName(pht('Alternate File Domain Not Configured'))

View file

@ -16,7 +16,7 @@ final class PhabricatorStorageSetupCheck extends PhabricatorSetupCheck {
$this->checkS3(); $this->checkS3();
if (!$chunk_engine_active) { if (!$chunk_engine_active) {
$doc_href = PhabricatorEnv::getDocLink('Configuring File Storage'); $doc_href = PhabricatorEnv::getDoclink('Configuring File Storage');
$message = pht( $message = pht(
'Large file storage has not been configured, which will limit '. 'Large file storage has not been configured, which will limit '.

View file

@ -21,7 +21,7 @@ final class PhabricatorConfigClusterDatabasesController
->setText(pht('Documentation'))); ->setText(pht('Documentation')));
$crumbs = $this $crumbs = $this
->buildApplicationCrumbs($nav) ->buildApplicationCrumbs()
->addTextCrumb($title) ->addTextCrumb($title)
->setBorder(true); ->setBorder(true);

View file

@ -21,7 +21,7 @@ final class PhabricatorConfigClusterNotificationsController
->setText(pht('Documentation'))); ->setText(pht('Documentation')));
$crumbs = $this $crumbs = $this
->buildApplicationCrumbs($nav) ->buildApplicationCrumbs()
->addTextCrumb($title) ->addTextCrumb($title)
->setBorder(true); ->setBorder(true);

View file

@ -22,7 +22,7 @@ final class PhabricatorConfigClusterRepositoriesController
->setText(pht('Documentation'))); ->setText(pht('Documentation')));
$crumbs = $this $crumbs = $this
->buildApplicationCrumbs($nav) ->buildApplicationCrumbs()
->addTextCrumb(pht('Repository Servers')) ->addTextCrumb(pht('Repository Servers'))
->setBorder(true); ->setBorder(true);

View file

@ -49,7 +49,7 @@ final class PhabricatorConfigIssueListController
->setProfileHeader(true); ->setProfileHeader(true);
$crumbs = $this $crumbs = $this
->buildApplicationCrumbs($nav) ->buildApplicationCrumbs()
->addTextCrumb(pht('Setup Issues')) ->addTextCrumb(pht('Setup Issues'))
->setBorder(true); ->setBorder(true);

View file

@ -20,7 +20,7 @@ final class PhabricatorSyntaxHighlightingConfigOptions
} }
public function getOptions() { public function getOptions() {
$caches_href = PhabricatorEnv::getDocLink('Managing Caches'); $caches_href = PhabricatorEnv::getDoclink('Managing Caches');
return array( return array(
$this->newOption( $this->newOption(

View file

@ -9,6 +9,7 @@ final class PhabricatorConfigKeySchema
private $unique; private $unique;
private $table; private $table;
private $indexType; private $indexType;
private $property;
public function setIndexType($index_type) { public function setIndexType($index_type) {
$this->indexType = $index_type; $this->indexType = $index_type;

View file

@ -50,9 +50,6 @@ final class ConpherenceCreateThreadConduitAPIMethod
if ($errors) { if ($errors) {
foreach ($errors as $error_code) { foreach ($errors as $error_code) {
switch ($error_code) { switch ($error_code) {
case ConpherenceEditor::ERROR_EMPTY_TITLE:
throw new ConduitException('ERR_EMPTY_TITLE');
break;
case ConpherenceEditor::ERROR_EMPTY_PARTICIPANTS: case ConpherenceEditor::ERROR_EMPTY_PARTICIPANTS:
throw new ConduitException('ERR_EMPTY_PARTICIPANT_PHIDS'); throw new ConduitException('ERR_EMPTY_PARTICIPANT_PHIDS');
break; break;

View file

@ -36,7 +36,7 @@ final class PhabricatorDashboardManageController
$crumbs->addTextCrumb(pht('Manage')); $crumbs->addTextCrumb(pht('Manage'));
$header = $this->buildHeaderView(); $header = $this->buildHeaderView();
$curtain = $this->buildCurtainview($dashboard); $curtain = $this->buildCurtainView($dashboard);
$properties = $this->buildPropertyView($dashboard); $properties = $this->buildPropertyView($dashboard);
$timeline = $this->buildTransactionTimeline( $timeline = $this->buildTransactionTimeline(

View file

@ -88,7 +88,6 @@ final class PhabricatorDashboardPanelRenderingEngine extends Phobject {
public function renderPanel() { public function renderPanel() {
$panel = $this->getPanel(); $panel = $this->getPanel();
$viewer = $this->getViewer();
if (!$panel) { if (!$panel) {
return $this->renderErrorPanel( return $this->renderErrorPanel(
@ -117,7 +116,7 @@ final class PhabricatorDashboardPanelRenderingEngine extends Phobject {
} }
} }
return $this->renderNormalPanel($viewer, $panel, $this); return $this->renderNormalPanel();
} catch (Exception $ex) { } catch (Exception $ex) {
return $this->renderErrorPanel( return $this->renderErrorPanel(
$panel->getName(), $panel->getName(),

View file

@ -111,8 +111,8 @@ abstract class DifferentialCustomField
* @task diff * @task diff
*/ */
public function renderDiffPropertyViewLabel(DifferentialDiff $diff) { public function renderDiffPropertyViewLabel(DifferentialDiff $diff) {
if ($this->proxy) { if ($this->getProxy()) {
return $this->proxy->renderDiffPropertyViewLabel($diff); return $this->getProxy()->renderDiffPropertyViewLabel($diff);
} }
return $this->getFieldName(); return $this->getFieldName();
} }
@ -122,8 +122,8 @@ abstract class DifferentialCustomField
* @task diff * @task diff
*/ */
public function renderDiffPropertyViewValue(DifferentialDiff $diff) { public function renderDiffPropertyViewValue(DifferentialDiff $diff) {
if ($this->proxy) { if ($this->getProxy()) {
return $this->proxy->renderDiffPropertyViewValue($diff); return $this->getProxy()->renderDiffPropertyViewValue($diff);
} }
throw new PhabricatorCustomFieldImplementationIncompleteException($this); throw new PhabricatorCustomFieldImplementationIncompleteException($this);
} }

View file

@ -20,7 +20,7 @@ final class DifferentialRevisionRequiredActionResultBucket
$this->objects = $objects; $this->objects = $objects;
$phids = $query->getEvaluatedParameter('responsiblePHIDs', array()); $phids = $query->getEvaluatedParameter('responsiblePHIDs');
if (!$phids) { if (!$phids) {
throw new Exception( throw new Exception(
pht( pht(

View file

@ -201,7 +201,7 @@ final class DiffusionDiffQueryConduitAPIMethod
$effective_commit = $this->getEffectiveCommit($request); $effective_commit = $this->getEffectiveCommit($request);
if (!$effective_commit) { if (!$effective_commit) {
return $this->getEmptyResult(1); return $this->getEmptyResult();
} }
$raw_query = DiffusionRawDiffQuery::newFromDiffusionRequest($drequest) $raw_query = DiffusionRawDiffQuery::newFromDiffusionRequest($drequest)
@ -209,7 +209,7 @@ final class DiffusionDiffQueryConduitAPIMethod
$raw_diff = $raw_query->executeInline(); $raw_diff = $raw_query->executeInline();
if (!$raw_diff) { if (!$raw_diff) {
return $this->getEmptyResult(2); return $this->getEmptyResult();
} }
$parser = $this->getDefaultParser(); $parser = $this->getDefaultParser();

View file

@ -44,7 +44,7 @@ final class DiffusionBrowseController extends DiffusionController {
$is_file = ($reason == DiffusionBrowseResultSet::REASON_IS_FILE); $is_file = ($reason == DiffusionBrowseResultSet::REASON_IS_FILE);
if ($is_file) { if ($is_file) {
return $this->browseFile($results); return $this->browseFile();
} else { } else {
$paths = $results->getPaths(); $paths = $results->getPaths();
$paths = $pager->sliceResults($paths); $paths = $pager->sliceResults($paths);

View file

@ -357,7 +357,7 @@ abstract class DiffusionController extends PhabricatorController {
$stable_commit = $drequest->getStableCommit(); $stable_commit = $drequest->getStableCommit();
$stable_commit_hash = PhabricatorHash::digestForIndex($stable_commit); $stable_commit_hash = PhabricatorHash::digestForIndex($stable_commit);
$readme_path_hash = PhabricatorHash::digestForindex($readme_path); $readme_path_hash = PhabricatorHash::digestForIndex($readme_path);
$cache = PhabricatorCaches::getMutableStructureCache(); $cache = PhabricatorCaches::getMutableStructureCache();
$cache_key = "diffusion". $cache_key = "diffusion".

View file

@ -59,7 +59,7 @@ final class DiffusionHistoryController extends DiffusionController {
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setTable($history_table); ->setTable($history_table);
$header = $this->buildHeader($drequest, $repository); $header = $this->buildHeader($drequest);
$crumbs = $this->buildCrumbs( $crumbs = $this->buildCrumbs(
array( array(

View file

@ -241,7 +241,7 @@ final class DiffusionRepositoryStatusManagementPanel
} }
} }
$doc_href = PhabricatorEnv::getDocLink('Managing Daemons with phd'); $doc_href = PhabricatorEnv::getDoclink('Managing Daemons with phd');
$daemon_instructions = pht( $daemon_instructions = pht(
'Use %s to start daemons. See %s.', 'Use %s to start daemons. See %s.',

View file

@ -17,7 +17,7 @@ final class DiffusionCommitRequiredActionResultBucket
$this->objects = $objects; $this->objects = $objects;
$phids = $query->getEvaluatedParameter('responsiblePHIDs', array()); $phids = $query->getEvaluatedParameter('responsiblePHIDs');
if (!$phids) { if (!$phids) {
throw new Exception( throw new Exception(
pht( pht(

View file

@ -43,7 +43,7 @@ final class DivinerAtom extends Phobject {
$this->getContext(), $this->getContext(),
$this->getName(), $this->getName(),
$this->getFile(), $this->getFile(),
sprintf('%08', $this->getLine()), sprintf('%08d', $this->getLine()),
)); ));
} }

View file

@ -94,7 +94,7 @@ final class DivinerDefaultRenderer extends DivinerRenderer {
$this->pushAtomStack($atom); $this->pushAtomStack($atom);
$description = $engine->markupText($text); $description = $engine->markupText($text);
$this->popAtomStack($atom); $this->popAtomStack();
return phutil_tag( return phutil_tag(
'div', 'div',

View file

@ -61,7 +61,7 @@ abstract class DivinerWorkflow extends PhabricatorManagementWorkflow {
} }
foreach (idx($book, 'groups', array()) as $group) { foreach (idx($book, 'groups', array()) as $group) {
PhutilTypeSpec::checkmap( PhutilTypeSpec::checkMap(
$group, $group,
array( array(
'name' => 'string', 'name' => 'string',

View file

@ -3,7 +3,7 @@
abstract class HeraldController extends PhabricatorController { abstract class HeraldController extends PhabricatorController {
public function buildApplicationMenu() { public function buildApplicationMenu() {
return $this->buildSideNavView(true)->getMenu(); return $this->buildSideNavView()->getMenu();
} }
protected function buildApplicationCrumbs() { protected function buildApplicationCrumbs() {

View file

@ -40,11 +40,6 @@ final class HeraldRuleQuery extends PhabricatorCursorPagedPolicyAwareQuery {
return $this; return $this;
} }
public function withExecutableRules($executable) {
$this->executable = $executable;
return $this;
}
public function withDisabled($disabled) { public function withDisabled($disabled) {
$this->disabled = $disabled; $this->disabled = $disabled;
return $this; return $this;

View file

@ -213,7 +213,7 @@ final class LegalpadDocumentEditController extends LegalpadController {
->setPolicies($policies) ->setPolicies($policies)
->setName('can_edit')); ->setName('can_edit'));
$crumbs = $this->buildApplicationCrumbs($this->buildSideNav()); $crumbs = $this->buildApplicationCrumbs();
$submit = new AphrontFormSubmitControl(); $submit = new AphrontFormSubmitControl();
if ($is_create) { if ($is_create) {
$submit->setValue(pht('Create Document')); $submit->setValue(pht('Create Document'));

View file

@ -54,7 +54,7 @@ final class LegalpadDocumentManageController extends LegalpadController {
$add_comment = $this->buildAddCommentView($document, $comment_form_id); $add_comment = $this->buildAddCommentView($document, $comment_form_id);
$crumbs = $this->buildApplicationCrumbs($this->buildSideNav()); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb( $crumbs->addTextCrumb(
$document->getMonogram(), $document->getMonogram(),
'/'.$document->getMonogram()); '/'.$document->getMonogram());

View file

@ -52,9 +52,6 @@ final class LegalpadDocumentBody extends LegalpadDAO
case self::MARKUP_FIELD_TEXT: case self::MARKUP_FIELD_TEXT:
$text = $this->getText(); $text = $this->getText();
break; break;
case self::MARKUP_FIELD_TITLE:
$text = $this->getTitle();
break;
default: default:
throw new Exception(pht('Unknown field: %s', $field)); throw new Exception(pht('Unknown field: %s', $field));
break; break;

View file

@ -98,8 +98,10 @@ abstract class PhabricatorTestDataGenerator extends Phobject {
->loadOneWhere('1 = 1 ORDER BY RAND() LIMIT 1'); ->loadOneWhere('1 = 1 ORDER BY RAND() LIMIT 1');
} catch (PhutilMissingSymbolException $ex) { } catch (PhutilMissingSymbolException $ex) {
throw new PhutilMissingSymbolException( throw new PhutilMissingSymbolException(
$classname,
pht('class'),
pht( pht(
'Unable to load symbol %s: this class does not exit.', 'Unable to load symbol %s: this class does not exist.',
$classname)); $classname));
} }
} }

View file

@ -3,7 +3,7 @@
abstract class ManiphestController extends PhabricatorController { abstract class ManiphestController extends PhabricatorController {
public function buildApplicationMenu() { public function buildApplicationMenu() {
return $this->buildSideNavView(true)->getMenu(); return $this->buildSideNavView()->getMenu();
} }
public function buildSideNavView() { public function buildSideNavView() {

View file

@ -219,7 +219,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
$status = $task->getStatus(); $status = $task->getStatus();
$status_name = ManiphestTaskStatus::renderFullDescription( $status_name = ManiphestTaskStatus::renderFullDescription(
$status, $priority_name, $priority_color); $status, $priority_name);
$view->addProperty(PHUIHeaderView::PROPERTY_STATUS, $status_name); $view->addProperty(PHUIHeaderView::PROPERTY_STATUS, $status_name);
$view->setHeaderIcon(ManiphestTaskStatus::getStatusIcon( $view->setHeaderIcon(ManiphestTaskStatus::getStatusIcon(

View file

@ -10,8 +10,7 @@ final class ManiphestConfiguredCustomField
public function createFields($object) { public function createFields($object) {
$config = PhabricatorEnv::getEnvConfig( $config = PhabricatorEnv::getEnvConfig(
'maniphest.custom-field-definitions', 'maniphest.custom-field-definitions');
array());
$fields = PhabricatorStandardCustomField::buildStandardFields( $fields = PhabricatorStandardCustomField::buildStandardFields(
$this, $this,
$config); $config);

View file

@ -15,7 +15,7 @@ final class PhabricatorMailImplementationPHPMailerAdapter
$this->mailer = new PHPMailer($use_exceptions = true); $this->mailer = new PHPMailer($use_exceptions = true);
$this->mailer->CharSet = 'utf-8'; $this->mailer->CharSet = 'utf-8';
$encoding = PhabricatorEnv::getEnvConfig('phpmailer.smtp-encoding', '8bit'); $encoding = PhabricatorEnv::getEnvConfig('phpmailer.smtp-encoding');
$this->mailer->Encoding = $encoding; $this->mailer->Encoding = $encoding;
// By default, PHPMailer sends one mail per recipient. We handle // By default, PHPMailer sends one mail per recipient. We handle

View file

@ -18,7 +18,7 @@ class PhabricatorMailImplementationPHPMailerLiteAdapter
$this->mailer = new PHPMailerLite($use_exceptions = true); $this->mailer = new PHPMailerLite($use_exceptions = true);
$this->mailer->CharSet = 'utf-8'; $this->mailer->CharSet = 'utf-8';
$encoding = PhabricatorEnv::getEnvConfig('phpmailer.smtp-encoding', '8bit'); $encoding = PhabricatorEnv::getEnvConfig('phpmailer.smtp-encoding');
$this->mailer->Encoding = $encoding; $this->mailer->Encoding = $encoding;
// By default, PHPMailerLite sends one mail per recipient. We handle // By default, PHPMailerLite sends one mail per recipient. We handle

View file

@ -41,7 +41,7 @@ final class PhabricatorMetaMTAAttachment extends Phobject {
public function toDictionary() { public function toDictionary() {
return array( return array(
'filename' => $this->getFilename(), 'filename' => $this->getFilename(),
'mimetype' => $this->getMimetype(), 'mimetype' => $this->getMimeType(),
'data' => $this->getData(), 'data' => $this->getData(),
); );
} }

View file

@ -9,9 +9,7 @@ final class PhabricatorOwnersConfiguredCustomField
} }
public function createFields($object) { public function createFields($object) {
$config = PhabricatorEnv::getEnvConfig( $config = PhabricatorEnv::getEnvConfig('owners.custom-field-definitions');
'owners.custom-field-definitions',
array());
$fields = PhabricatorStandardCustomField::buildStandardFields( $fields = PhabricatorStandardCustomField::buildStandardFields(
$this, $this,

View file

@ -292,7 +292,7 @@ final class PhabricatorPasteQuery
foreach ($pastes as $paste) { foreach ($pastes as $paste) {
$key = $this->getSnippetCacheKey($paste); $key = $this->getSnippetCacheKey($paste);
if (isset($caches[$key])) { if (isset($caches[$key])) {
$snippet_data = phutil_json_decode($caches[$key], true); $snippet_data = phutil_json_decode($caches[$key]);
$snippet = new PhabricatorPasteSnippet( $snippet = new PhabricatorPasteSnippet(
phutil_safe_html($snippet_data['content']), phutil_safe_html($snippet_data['content']),
$snippet_data['type'], $snippet_data['type'],

View file

@ -15,7 +15,7 @@ final class PhabricatorPasteTitleTransaction
public function getTitle() { public function getTitle() {
$old = $this->getOldValue(); $old = $this->getOldValue();
$new = $this->getNeWValue(); $new = $this->getNewValue();
if (strlen($old) && strlen($new)) { if (strlen($old) && strlen($new)) {
return pht( return pht(
@ -38,7 +38,7 @@ final class PhabricatorPasteTitleTransaction
public function getTitleForFeed() { public function getTitleForFeed() {
$old = $this->getOldValue(); $old = $this->getOldValue();
$new = $this->getNeWValue(); $new = $this->getNewValue();
if (strlen($old) && strlen($new)) { if (strlen($old) && strlen($new)) {
return pht( return pht(

View file

@ -11,7 +11,7 @@ final class PhabricatorUserConfiguredCustomField
public function createFields($object) { public function createFields($object) {
return PhabricatorStandardCustomField::buildStandardFields( return PhabricatorStandardCustomField::buildStandardFields(
$this, $this,
PhabricatorEnv::getEnvConfig('user.custom-field-definitions', array())); PhabricatorEnv::getEnvConfig('user.custom-field-definitions'));
} }
public function newStorageObject() { public function newStorageObject() {

View file

@ -172,7 +172,7 @@ final class PhamePost extends PhameDAO
} }
public function getSlug() { public function getSlug() {
return PhabricatorSlug::normalizeProjectSlug($this->getTitle(), true); return PhabricatorSlug::normalizeProjectSlug($this->getTitle());
} }
public function getHeaderImageURI() { public function getHeaderImageURI() {

View file

@ -5,7 +5,7 @@
* PhabricatorPHIDConstants::PHID_TYPE_UNKNOWN if it fails to look up the type * PhabricatorPHIDConstants::PHID_TYPE_UNKNOWN if it fails to look up the type
* *
* @param phid Anything. * @param phid Anything.
* @return A value from PhabricatorPHIDConstants (ideally) * @return string A value from PhabricatorPHIDConstants (ideally)
*/ */
function phid_get_type($phid) { function phid_get_type($phid) {
$matches = null; $matches = null;

View file

@ -67,7 +67,7 @@ final class PholioMockViewController extends PholioController {
$timeline->setMock($mock); $timeline->setMock($mock);
$curtain = $this->buildCurtainView($mock); $curtain = $this->buildCurtainView($mock);
$details = $this->buildDescriptionView($mock, $engine); $details = $this->buildDescriptionView($mock);
require_celerity_resource('pholio-css'); require_celerity_resource('pholio-css');
require_celerity_resource('pholio-inline-comments-css'); require_celerity_resource('pholio-inline-comments-css');

View file

@ -10,6 +10,7 @@ final class PhragmentFragment extends PhragmentDAO
protected $editPolicy; protected $editPolicy;
private $latestVersion = self::ATTACHABLE; private $latestVersion = self::ATTACHABLE;
private $file = self::ATTACHABLE;
protected function getConfiguration() { protected function getConfiguration() {
return array( return array(

View file

@ -38,9 +38,7 @@ final class PhrictionInfoConduitAPIMethod extends PhrictionConduitAPIMethod {
throw new ConduitException('ERR-BAD-DOCUMENT'); throw new ConduitException('ERR-BAD-DOCUMENT');
} }
return $this->buildDocumentInfoDictionary( return $this->buildDocumentInfoDictionary($document);
$document,
$document->getContent());
} }
} }

View file

@ -85,7 +85,7 @@ final class PhabricatorPolicyExplainController
return null; return null;
} }
if (!PhabricatorSpacesNamespaceQuery::getSpacesExist($viewer)) { if (!PhabricatorSpacesNamespaceQuery::getSpacesExist()) {
return null; return null;
} }

View file

@ -83,7 +83,7 @@ final class PonderQuestionViewController extends PonderController {
->setContentID($content_id) ->setContentID($content_id)
->setCount(count($xactions)); ->setCount(count($xactions));
$crumbs = $this->buildApplicationCrumbs($this->buildSideNavView()); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb('Q'.$id, '/Q'.$id); $crumbs->addTextCrumb('Q'.$id, '/Q'.$id);
$crumbs->setBorder(true); $crumbs->setBorder(true);

View file

@ -48,7 +48,7 @@ final class PhabricatorProjectMembersAddController
'+' => array_fuse($member_phids), '+' => array_fuse($member_phids),
)); ));
$editor = id(new PhabricatorProjectTransactionEditor($project)) $editor = id(new PhabricatorProjectTransactionEditor())
->setActor($viewer) ->setActor($viewer)
->setContentSourceFromRequest($request) ->setContentSourceFromRequest($request)
->setContinueOnNoEffect(true) ->setContinueOnNoEffect(true)

View file

@ -49,7 +49,7 @@ final class PhabricatorProjectMembersRemoveController
'-' => array($remove_phid => $remove_phid), '-' => array($remove_phid => $remove_phid),
)); ));
$editor = id(new PhabricatorProjectTransactionEditor($project)) $editor = id(new PhabricatorProjectTransactionEditor())
->setActor($viewer) ->setActor($viewer)
->setContentSourceFromRequest($request) ->setContentSourceFromRequest($request)
->setContinueOnNoEffect(true) ->setContinueOnNoEffect(true)

View file

@ -53,7 +53,7 @@ final class PhabricatorProjectSilenceController
$edge_action => array($viewer_phid => $viewer_phid), $edge_action => array($viewer_phid => $viewer_phid),
)); ));
$editor = id(new PhabricatorProjectTransactionEditor($project)) $editor = id(new PhabricatorProjectTransactionEditor())
->setActor($viewer) ->setActor($viewer)
->setContentSourceFromRequest($request) ->setContentSourceFromRequest($request)
->setContinueOnNoEffect(true) ->setContinueOnNoEffect(true)

View file

@ -67,7 +67,7 @@ final class PhabricatorProjectUpdateController
->setMetadataValue('edge:type', $type_member) ->setMetadataValue('edge:type', $type_member)
->setNewValue($member_spec); ->setNewValue($member_spec);
$editor = id(new PhabricatorProjectTransactionEditor($project)) $editor = id(new PhabricatorProjectTransactionEditor())
->setActor($viewer) ->setActor($viewer)
->setContentSourceFromRequest($request) ->setContentSourceFromRequest($request)
->setContinueOnNoEffect(true) ->setContinueOnNoEffect(true)

View file

@ -64,7 +64,7 @@ final class PhabricatorProjectWatchController
->setMetadataValue('edge:type', $type_watcher) ->setMetadataValue('edge:type', $type_watcher)
->setNewValue($member_spec); ->setNewValue($member_spec);
$editor = id(new PhabricatorProjectTransactionEditor($project)) $editor = id(new PhabricatorProjectTransactionEditor())
->setActor($viewer) ->setActor($viewer)
->setContentSourceFromRequest($request) ->setContentSourceFromRequest($request)
->setContinueOnNoEffect(true) ->setContinueOnNoEffect(true)

View file

@ -11,9 +11,7 @@ final class PhabricatorProjectConfiguredCustomField
public function createFields($object) { public function createFields($object) {
return PhabricatorStandardCustomField::buildStandardFields( return PhabricatorStandardCustomField::buildStandardFields(
$this, $this,
PhabricatorEnv::getEnvConfig( PhabricatorEnv::getEnvConfig('projects.custom-field-definitions'));
'projects.custom-field-definitions',
array()));
} }
} }

View file

@ -269,7 +269,7 @@ final class PhabricatorProjectIconSet
'The project icon ("%s") with special attribute "%s" must '. 'The project icon ("%s") with special attribute "%s" must '.
'not be disabled', 'not be disabled',
$key, $key,
self::SPECIAL_MIILESTONE)); self::SPECIAL_MILESTONE));
} }
$milestone = $value; $milestone = $value;
} else { } else {

View file

@ -229,11 +229,11 @@ final class ReleephRequestQuery
); );
case self::STATUS_NEEDS_REVERT: case self::STATUS_NEEDS_REVERT:
return array( return array(
ReleephRequestStatus::NEEDS_REVERT, ReleephRequestStatus::STATUS_NEEDS_REVERT,
); );
case self::STATUS_REVERTED: case self::STATUS_REVERTED:
return array( return array(
ReleephRequestStatus::REVERTED, ReleephRequestStatus::STATUS_REVERTED,
); );
default: default:
throw new Exception(pht("Unknown status '%s'!", $this->status)); throw new Exception(pht("Unknown status '%s'!", $this->status));

View file

@ -30,11 +30,6 @@ final class PhabricatorRepositoryURIQuery
return $this; return $this;
} }
public function withObjectHashes(array $hashes) {
$this->objectHashes = $hashes;
return $this;
}
public function newResultObject() { public function newResultObject() {
return new PhabricatorRepositoryURI(); return new PhabricatorRepositoryURI();
} }

View file

@ -577,7 +577,7 @@ final class PhabricatorRepositoryURI
self::IO_READWRITE => 200, self::IO_READWRITE => 200,
self::IO_READ => 100, self::IO_READ => 100,
); );
$score += idx($io_points, $this->getEffectiveIoType(), 0); $score += idx($io_points, $this->getEffectiveIOType(), 0);
$protocol_points = array( $protocol_points = array(
self::BUILTIN_PROTOCOL_SSH => 30, self::BUILTIN_PROTOCOL_SSH => 30,

View file

@ -139,7 +139,7 @@ abstract class PhabricatorApplicationSearchEngine extends Phobject {
* Executes the saved query. * Executes the saved query.
* *
* @param PhabricatorSavedQuery The saved query to operate on. * @param PhabricatorSavedQuery The saved query to operate on.
* @return The result of the query. * @return PhabricatorQuery The result of the query.
*/ */
public function buildQueryFromSavedQuery(PhabricatorSavedQuery $original) { public function buildQueryFromSavedQuery(PhabricatorSavedQuery $original) {
$saved = clone $original; $saved = clone $original;
@ -469,7 +469,7 @@ abstract class PhabricatorApplicationSearchEngine extends Phobject {
public function loadAllNamedQueries() { public function loadAllNamedQueries() {
$viewer = $this->requireViewer(); $viewer = $this->requireViewer();
$builtin = $this->getBuiltinQueries($viewer); $builtin = $this->getBuiltinQueries();
if ($this->namedQueries === null) { if ($this->namedQueries === null) {
$named_queries = id(new PhabricatorNamedQueryQuery()) $named_queries = id(new PhabricatorNamedQueryQuery())

View file

@ -218,7 +218,7 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
$edit_mode = $request->getURIData('itemEditMode'); $edit_mode = $request->getURIData('itemEditMode');
} }
$available_modes = $this->getViewerEditModes($viewer); $available_modes = $this->getViewerEditModes();
if ($available_modes) { if ($available_modes) {
$available_modes = array_fuse($available_modes); $available_modes = array_fuse($available_modes);
if (isset($available_modes[$edit_mode])) { if (isset($available_modes[$edit_mode])) {
@ -731,7 +731,7 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
private function buildMenuEditModeContent() { private function buildMenuEditModeContent() {
$viewer = $this->getViewer(); $viewer = $this->getViewer();
$modes = $this->getViewerEditModes($viewer); $modes = $this->getViewerEditModes();
if (!$modes) { if (!$modes) {
return new Aphront404Response(); return new Aphront404Response();
} }

View file

@ -59,8 +59,8 @@ final class PhabricatorSavedQuery extends PhabricatorSearchDAO
return $this; return $this;
} }
public function getEvaluatedParameter($key, $default = null) { public function getEvaluatedParameter($key) {
return $this->assertAttachedKey($this->parameterMap, $key, $default); return $this->assertAttachedKey($this->parameterMap, $key);
} }

View file

@ -28,7 +28,7 @@ final class PhabricatorSlowvoteVoteController
if ($request->isAjax()) { if ($request->isAjax()) {
$vote = $request->getInt('vote'); $vote = $request->getInt('vote');
$votes = array_keys($old_votes); $votes = array_keys($old_votes);
$votes = array_fuse($votes, $votes); $votes = array_fuse($votes);
if ($poll->getMethod() == PhabricatorSlowvotePoll::METHOD_PLURALITY) { if ($poll->getMethod() == PhabricatorSlowvotePoll::METHOD_PLURALITY) {
if (idx($votes, $vote, false)) { if (idx($votes, $vote, false)) {
@ -68,7 +68,7 @@ final class PhabricatorSlowvoteVoteController
} }
$votes = $request->getArr('vote'); $votes = $request->getArr('vote');
$votes = array_fuse($votes, $votes); $votes = array_fuse($votes);
$this->updateVotes($viewer, $poll, $old_votes, $votes); $this->updateVotes($viewer, $poll, $old_votes, $votes);

View file

@ -9,7 +9,7 @@ final class PhabricatorSpacesListController
public function handleRequest(AphrontRequest $request) { public function handleRequest(AphrontRequest $request) {
$request = $this->getRequest(); $request = $this->getRequest();
$controller = id(new PhabricatorApplicationSearchController($request)) $controller = id(new PhabricatorApplicationSearchController())
->setQueryKey($request->getURIData('queryKey')) ->setQueryKey($request->getURIData('queryKey'))
->setSearchEngine(new PhabricatorSpacesNamespaceSearchEngine()) ->setSearchEngine(new PhabricatorSpacesNamespaceSearchEngine())
->setNavigation($this->buildSideNavView()); ->setNavigation($this->buildSideNavView());

View file

@ -14,6 +14,7 @@ final class PhabricatorTokensToken extends PhabricatorTokenDAO
protected $tokenImagePHID; protected $tokenImagePHID;
protected $builtinKey; protected $builtinKey;
private $tokenImageFile = self::ATTACHABLE;
const STATUS_ACTIVE = 'active'; const STATUS_ACTIVE = 'active';
const STATUS_ARCHIVED = 'archived'; const STATUS_ARCHIVED = 'archived';

View file

@ -12,6 +12,7 @@ class PhabricatorApplicationTransactionCommentView extends AphrontView {
private $previewTimelineID; private $previewTimelineID;
private $previewToggleID; private $previewToggleID;
private $formID; private $formID;
private $statusID;
private $commentID; private $commentID;
private $draft; private $draft;
private $requestURI; private $requestURI;

View file

@ -6,11 +6,11 @@ abstract class PhabricatorStreamingProtocolAdapter
protected $readHandles; protected $readHandles;
protected $multiHandle; protected $multiHandle;
protected $authtoken; protected $authtoken;
protected $inRooms = array();
private $readBuffers; private $readBuffers;
private $server; private $server;
private $active; private $active;
private $inRooms = array();
public function getServiceName() { public function getServiceName() {
$uri = new PhutilURI($this->server); $uri = new PhutilURI($this->server);

View file

@ -242,7 +242,7 @@ abstract class LiskDAO extends Phobject {
* Get an existing, cached connection for this object. * Get an existing, cached connection for this object.
* *
* @param mode Connection mode. * @param mode Connection mode.
* @return AprontDatabaseConnection|null Connection, if it exists in cache. * @return AphrontDatabaseConnection|null Connection, if it exists in cache.
* @task conn * @task conn
*/ */
protected function getEstablishedConnection($mode) { protected function getEstablishedConnection($mode) {
@ -953,7 +953,7 @@ abstract class LiskDAO extends Phobject {
* @param string 'r' for read, 'w' for read/write. * @param string 'r' for read, 'w' for read/write.
* @param bool True to force a new connection. The connection will not * @param bool True to force a new connection. The connection will not
* be retrieved from or saved into the connection cache. * be retrieved from or saved into the connection cache.
* @return LiskDatabaseConnection Lisk connection object. * @return AphrontDatabaseConnection Lisk connection object.
* *
* @task info * @task info
*/ */

View file

@ -260,7 +260,7 @@ abstract class PhabricatorPasswordHasher extends Phobject {
/** /**
* Get the best (strongest) available hasher. * Get the best (strongest) available hasher.
* *
* @return PhabicatorPasswordHasher Best hasher. * @return PhabricatorPasswordHasher Best hasher.
* @task hashing * @task hashing
*/ */
public static function getBestHasher() { public static function getBestHasher() {
@ -282,7 +282,7 @@ abstract class PhabricatorPasswordHasher extends Phobject {
/** /**
* Get the hashser for a given stored hash. * Get the hashser for a given stored hash.
* *
* @return PhabicatorPasswordHasher Corresponding hasher. * @return PhabricatorPasswordHasher Corresponding hasher.
* @task hashing * @task hashing
*/ */
public static function getHasherForHash(PhutilOpaqueEnvelope $hash) { public static function getHasherForHash(PhutilOpaqueEnvelope $hash) {

View file

@ -85,7 +85,7 @@ class AphrontFormTextAreaControl extends AphrontFormControl {
array( array(
'name' => $this->getName(), 'name' => $this->getName(),
'disabled' => $this->getDisabled() ? 'disabled' : null, 'disabled' => $this->getDisabled() ? 'disabled' : null,
'readonly' => $this->getReadonly() ? 'readonly' : null, 'readonly' => $this->getReadOnly() ? 'readonly' : null,
'class' => $classes, 'class' => $classes,
'style' => $this->getControlStyle(), 'style' => $this->getControlStyle(),
'id' => $this->getID(), 'id' => $this->getID(),

View file

@ -105,7 +105,7 @@ final class AphrontSideNavFilterView extends AphrontView {
$key, $name, $uri, PHUIListItemView::TYPE_BUTTON); $key, $name, $uri, PHUIListItemView::TYPE_BUTTON);
} }
private function addThing($key, $name, $uri, $type, $icon) { private function addThing($key, $name, $uri, $type, $icon = null) {
$item = id(new PHUIListItemView()) $item = id(new PHUIListItemView())
->setName($name) ->setName($name)
->setType($type); ->setType($type);

View file

@ -182,7 +182,7 @@ final class PHUITimelineView extends AphrontView {
} }
if ($this->shouldTerminate) { if ($this->shouldTerminate) {
$events[] = self::renderEnder(true); $events[] = self::renderEnder();
} }
return $events; return $events;

View file

@ -369,38 +369,4 @@ final class PHUICalendarDayView extends AphrontView {
return $date; return $date;
} }
private function findTodayClusters() {
$events = msort($this->todayEvents, 'getEpochStart');
$clusters = array();
foreach ($events as $event) {
$destination_cluster_key = null;
$event_start = $event->getEpochStart() - (30 * 60);
$event_end = $event->getEpochEnd() + (30 * 60);
foreach ($clusters as $key => $cluster) {
foreach ($cluster as $clustered_event) {
$compare_event_start = $clustered_event->getEpochStart();
$compare_event_end = $clustered_event->getEpochEnd();
if ($event_start < $compare_event_end
&& $event_end > $compare_event_start) {
$destination_cluster_key = $key;
break;
}
}
}
if ($destination_cluster_key !== null) {
$clusters[$destination_cluster_key][] = $event;
} else {
$next_cluster = array();
$next_cluster[] = $event;
$clusters[] = $next_cluster;
}
}
return $clusters;
}
} }

View file

@ -57,7 +57,6 @@ final class PHUICalendarListView extends AphrontTagView {
Javelin::initBehavior('phabricator-tooltips'); Javelin::initBehavior('phabricator-tooltips');
$singletons = array(); $singletons = array();
$allday = false;
foreach ($this->events as $event) { foreach ($this->events as $event) {
$start_epoch = $event->getEpochStart(); $start_epoch = $event->getEpochStart();
@ -81,7 +80,7 @@ final class PHUICalendarListView extends AphrontTagView {
array( array(
'class' => 'phui-calendar-list-title', 'class' => 'phui-calendar-list-title',
), ),
$this->getEventTitle($event, $allday)); $this->getEventTitle($event));
$time = phutil_tag( $time = phutil_tag(
'span', 'span',
array( array(