1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-28 08:20:57 +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 $this->renderConfirmDialog($account);
return $this->renderConfirmDialog();
}
private function getDoneURI() {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -14,7 +14,7 @@ final class PhabricatorPHPConfigSetupCheck extends PhabricatorSetupCheck {
protected function executeChecks() {
if (empty($_SERVER['REMOTE_ADDR'])) {
$doc_href = PhabricatorEnv::getDocLink('Configuring a Preamble Script');
$doc_href = PhabricatorEnv::getDoclink('Configuring a Preamble Script');
$summary = pht(
'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_domain = PhabricatorEnv::getEnvConfig($file_key);
if (!$file_domain) {
$doc_href = PhabricatorEnv::getDocLink('Configuring a File Domain');
$doc_href = PhabricatorEnv::getDoclink('Configuring a File Domain');
$this->newIssue('security.'.$file_key)
->setName(pht('Alternate File Domain Not Configured'))

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -357,7 +357,7 @@ abstract class DiffusionController extends PhabricatorController {
$stable_commit = $drequest->getStableCommit();
$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_key = "diffusion".

View file

@ -59,7 +59,7 @@ final class DiffusionHistoryController extends DiffusionController {
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setTable($history_table);
$header = $this->buildHeader($drequest, $repository);
$header = $this->buildHeader($drequest);
$crumbs = $this->buildCrumbs(
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(
'Use %s to start daemons. See %s.',

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -139,7 +139,7 @@ abstract class PhabricatorApplicationSearchEngine extends Phobject {
* Executes the saved query.
*
* @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) {
$saved = clone $original;
@ -469,7 +469,7 @@ abstract class PhabricatorApplicationSearchEngine extends Phobject {
public function loadAllNamedQueries() {
$viewer = $this->requireViewer();
$builtin = $this->getBuiltinQueries($viewer);
$builtin = $this->getBuiltinQueries();
if ($this->namedQueries === null) {
$named_queries = id(new PhabricatorNamedQueryQuery())

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -105,7 +105,7 @@ final class AphrontSideNavFilterView extends AphrontView {
$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())
->setName($name)
->setType($type);

View file

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

View file

@ -369,38 +369,4 @@ final class PHUICalendarDayView extends AphrontView {
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');
$singletons = array();
$allday = false;
foreach ($this->events as $event) {
$start_epoch = $event->getEpochStart();
@ -81,7 +80,7 @@ final class PHUICalendarListView extends AphrontTagView {
array(
'class' => 'phui-calendar-list-title',
),
$this->getEventTitle($event, $allday));
$this->getEventTitle($event));
$time = phutil_tag(
'span',
array(