1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-03 19:31:02 +01:00

Replace all array_combine(x, x) with array_fuse(x) in Phabricator

Summary: Fixes various array_combine() warnings for PHP < 5.4

Test Plan: lint/unit/grep

Reviewers: btrahan, vrana, chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D4660
This commit is contained in:
epriestley 2013-01-25 17:06:55 -08:00
parent 4d22c9104f
commit f6622f43e6
9 changed files with 11 additions and 11 deletions

View file

@ -109,7 +109,7 @@ final class DifferentialCommentEditor extends PhabricatorEditor {
$revision->loadRelationships();
$reviewer_phids = $revision->getReviewers();
if ($reviewer_phids) {
$reviewer_phids = array_combine($reviewer_phids, $reviewer_phids);
$reviewer_phids = array_fuse($reviewer_phids);
}
$metadata = array();

View file

@ -65,7 +65,7 @@ final class PhabricatorMacroListController
}
if ($authors) {
$author_phids = array_combine($authors, $authors);
$author_phids = array_fuse($authors);
} else {
$author_phids = array();
}

View file

@ -804,7 +804,7 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
return array();
}
$phids = array_combine($phids, $phids);
$phids = array_fuse($phids);
// Exclude PHIDs explicitly marked for exclusion. We use this to prevent

View file

@ -59,7 +59,7 @@ final class PhortuneMonthYearExpiryControl extends AphrontFormControl {
$current_year = $this->getCurrentYear();
$years = range($current_year, $current_year + 20);
$years = array_combine($years, $years);
$years = array_fuse($years);
if ($this->getMonthInputValue()) {
$selected_month = $this->getMonthInputValue();

View file

@ -62,7 +62,7 @@ final class PhabricatorSettingsPanelAccount
}
$timezone_ids = DateTimeZone::listIdentifiers();
$timezone_id_map = array_combine($timezone_ids, $timezone_ids);
$timezone_id_map = array_fuse($timezone_ids);
$form = new AphrontFormView();
$form

View file

@ -522,7 +522,7 @@ abstract class PhabricatorApplicationTransactionEditor
protected function getPHIDTransactionNewValue(
PhabricatorApplicationTransaction $xaction) {
$old = array_combine($xaction->getOldValue(), $xaction->getOldValue());
$old = array_fuse($xaction->getOldValue());
$new = $xaction->getNewValue();
$new_add = idx($new, '+', array());
@ -531,7 +531,7 @@ abstract class PhabricatorApplicationTransactionEditor
unset($new['-']);
$new_set = idx($new, '=', null);
if ($new_set !== null) {
$new_set = array_combine($new_set, $new_set);
$new_set = array_fuse($new_set);
}
unset($new['=']);

View file

@ -183,7 +183,7 @@ final class CeleritySpriteGenerator {
// Reorder the sprites so less-specific rules generate earlier in the sheet.
// Otherwise we end up with blue "a.black" buttons because the blue rules
// have the same specificity but appear later.
$gradients = array_combine($gradients, $gradients);
$gradients = array_fuse($gradients);
$gradients = array_select_keys(
$gradients,
array(

View file

@ -102,7 +102,7 @@ abstract class PhabricatorWorker {
final public static function waitForTasks(array $task_ids) {
$task_table = new PhabricatorWorkerActiveTask();
$waiting = array_combine($task_ids, $task_ids);
$waiting = array_fuse($task_ids);
while ($waiting) {
$conn_w = $task_table->establishConnection('w');

View file

@ -181,7 +181,7 @@ final class AphrontFormDateControl extends AphrontFormControl {
$max_year = $this->getMaxYear();
$days = range(1, 31);
$days = array_combine($days, $days);
$days = array_fuse($days);
$months = array(
1 => 'Jan',
@ -199,7 +199,7 @@ final class AphrontFormDateControl extends AphrontFormControl {
);
$years = range($this->getMinYear(), $this->getMaxYear());
$years = array_combine($years, $years);
$years = array_fuse($years);
$days_sel = AphrontFormSelectControl::renderSelectTag(
$this->getDayInputValue(),