diff --git a/src/applications/audit/view/PhabricatorAuditCommitListView.php b/src/applications/audit/view/PhabricatorAuditCommitListView.php index b964872802..dc674cec8b 100644 --- a/src/applications/audit/view/PhabricatorAuditCommitListView.php +++ b/src/applications/audit/view/PhabricatorAuditCommitListView.php @@ -73,7 +73,7 @@ final class PhabricatorAuditCommitListView extends AphrontView { $commit->getCommitData()->getSummary(), PhabricatorAuditCommitStatusConstants::getStatusName( $commit->getAuditStatus()), - array_interleave(', ', $auditors), + phutil_implode_html(', ', $auditors), phabricator_datetime($commit->getEpoch(), $this->user), ); } diff --git a/src/applications/audit/view/PhabricatorAuditListView.php b/src/applications/audit/view/PhabricatorAuditListView.php index a4e4ba3452..5a7ef11a1f 100644 --- a/src/applications/audit/view/PhabricatorAuditListView.php +++ b/src/applications/audit/view/PhabricatorAuditListView.php @@ -129,7 +129,7 @@ final class PhabricatorAuditListView extends AphrontView { } $reasons = $audit->getAuditReasons(); - $reasons = array_interleave(phutil_tag('br'), $reasons); + $reasons = phutil_implode_html(phutil_tag('br'), $reasons); $status_code = $audit->getAuditStatus(); $status = PhabricatorAuditStatusConstants::getStatusName($status_code); diff --git a/src/applications/base/controller/PhabricatorController.php b/src/applications/base/controller/PhabricatorController.php index e3d5d15196..41c371a2e5 100644 --- a/src/applications/base/controller/PhabricatorController.php +++ b/src/applications/base/controller/PhabricatorController.php @@ -277,7 +277,7 @@ abstract class PhabricatorController extends AphrontController { $items[] = $this->getHandle($phid)->renderLink(); } - return array_interleave($style_map[$style], $items); + return phutil_implode_html($style_map[$style], $items); } protected function buildApplicationMenu() { diff --git a/src/applications/config/view/PhabricatorSetupIssueView.php b/src/applications/config/view/PhabricatorSetupIssueView.php index 203a62b81b..5fa0cd61d5 100644 --- a/src/applications/config/view/PhabricatorSetupIssueView.php +++ b/src/applications/config/view/PhabricatorSetupIssueView.php @@ -44,7 +44,7 @@ final class PhabricatorSetupIssueView extends AphrontView { ), array( phutil_tag('p', array(), $run_these), - phutil_tag('pre', array(), array_interleave("\n", $commands)), + phutil_tag('pre', array(), phutil_implode_html("\n", $commands)), )); } @@ -155,7 +155,7 @@ final class PhabricatorSetupIssueView extends AphrontView { 'phabricator/ $ ./bin/config set %s value', $key); } - $update = phutil_tag('pre', array(), array_interleave("\n", $update)); + $update = phutil_tag('pre', array(), phutil_implode_html("\n", $update)); } else { $update = array(); foreach ($configs as $config) { diff --git a/src/applications/differential/field/specification/DifferentialCommitsFieldSpecification.php b/src/applications/differential/field/specification/DifferentialCommitsFieldSpecification.php index ae8339c05c..b5e6e2a37b 100644 --- a/src/applications/differential/field/specification/DifferentialCommitsFieldSpecification.php +++ b/src/applications/differential/field/specification/DifferentialCommitsFieldSpecification.php @@ -26,7 +26,7 @@ final class DifferentialCommitsFieldSpecification $links[] = $this->getHandle($commit_phid)->renderLink(); } - return array_interleave(phutil_tag('br'), $links); + return phutil_implode_html(phutil_tag('br'), $links); } private function getCommitPHIDs() { diff --git a/src/applications/differential/field/specification/DifferentialDependenciesFieldSpecification.php b/src/applications/differential/field/specification/DifferentialDependenciesFieldSpecification.php index 43f387bb57..d32047ee22 100644 --- a/src/applications/differential/field/specification/DifferentialDependenciesFieldSpecification.php +++ b/src/applications/differential/field/specification/DifferentialDependenciesFieldSpecification.php @@ -26,7 +26,7 @@ final class DifferentialDependenciesFieldSpecification $links[] = $this->getHandle($revision_phids)->renderLink(); } - return array_interleave(phutil_tag('br'), $links); + return phutil_implode_html(phutil_tag('br'), $links); } private function getDependentRevisionPHIDs() { diff --git a/src/applications/differential/field/specification/DifferentialDependsOnFieldSpecification.php b/src/applications/differential/field/specification/DifferentialDependsOnFieldSpecification.php index 05c8ebef91..b195641432 100644 --- a/src/applications/differential/field/specification/DifferentialDependsOnFieldSpecification.php +++ b/src/applications/differential/field/specification/DifferentialDependsOnFieldSpecification.php @@ -26,7 +26,7 @@ final class DifferentialDependsOnFieldSpecification $links[] = $this->getHandle($revision_phids)->renderLink(); } - return array_interleave(phutil_tag('br'), $links); + return phutil_implode_html(phutil_tag('br'), $links); } private function getDependentRevisionPHIDs() { diff --git a/src/applications/differential/field/specification/DifferentialFieldSpecification.php b/src/applications/differential/field/specification/DifferentialFieldSpecification.php index d1b6dbdb3b..3521998248 100644 --- a/src/applications/differential/field/specification/DifferentialFieldSpecification.php +++ b/src/applications/differential/field/specification/DifferentialFieldSpecification.php @@ -283,7 +283,7 @@ abstract class DifferentialFieldSpecification { $links[] = $handle->renderLink(); } - return array_interleave(', ', $links); + return phutil_implode_html(', ', $links); } diff --git a/src/applications/differential/field/specification/DifferentialManiphestTasksFieldSpecification.php b/src/applications/differential/field/specification/DifferentialManiphestTasksFieldSpecification.php index 38379da8f2..3112f0f379 100644 --- a/src/applications/differential/field/specification/DifferentialManiphestTasksFieldSpecification.php +++ b/src/applications/differential/field/specification/DifferentialManiphestTasksFieldSpecification.php @@ -29,7 +29,7 @@ final class DifferentialManiphestTasksFieldSpecification $links[] = $this->getHandle($task_phid)->renderLink(); } - return array_interleave(phutil_tag('br'), $links); + return phutil_implode_html(phutil_tag('br'), $links); } private function getManiphestTaskPHIDs() { diff --git a/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php b/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php index 91cfbebabd..1fe2a13e32 100644 --- a/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php @@ -160,7 +160,7 @@ final class DifferentialChangesetTwoUpRenderer 'colspan' => 2, 'class' => 'show-more', ), - array_interleave( + phutil_implode_html( " \xE2\x80\xA2 ", // Bullet $contents)), phutil_tag( diff --git a/src/applications/differential/view/DifferentialInlineCommentView.php b/src/applications/differential/view/DifferentialInlineCommentView.php index 0fa497fa59..f9ff40e2b7 100644 --- a/src/applications/differential/view/DifferentialInlineCommentView.php +++ b/src/applications/differential/view/DifferentialInlineCommentView.php @@ -178,7 +178,7 @@ final class DifferentialInlineCommentView extends AphrontView { $links = phutil_tag( 'span', array('class' => 'differential-inline-comment-links'), - array_interleave(" \xC2\xB7 ", $links)); + phutil_implode_html(" \xC2\xB7 ", $links)); } else { $links = null; } diff --git a/src/applications/differential/view/DifferentialLocalCommitsView.php b/src/applications/differential/view/DifferentialLocalCommitsView.php index d1207252d2..2d9b33391f 100644 --- a/src/applications/differential/view/DifferentialLocalCommitsView.php +++ b/src/applications/differential/view/DifferentialLocalCommitsView.php @@ -74,7 +74,7 @@ final class DifferentialLocalCommitsView extends AphrontView { } $parents[$k] = substr($parent, 0, 16); } - $parents = array_interleave(phutil_tag('br'), $parents); + $parents = phutil_implode_html(phutil_tag('br'), $parents); $row[] = phutil_tag('td', array(), $parents); $author = nonempty( diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php index 8726c5a91c..60960934d2 100644 --- a/src/applications/diffusion/controller/DiffusionCommitController.php +++ b/src/applications/diffusion/controller/DiffusionCommitController.php @@ -449,9 +449,7 @@ final class DiffusionCommitController extends DiffusionController { foreach ($parents as $parent) { $parent_links[] = $handles[$parent->getPHID()]->renderLink(); } - $props['Parents'] = array_interleave( - " \xC2\xB7 ", - $parent_links); + $props['Parents'] = phutil_implode_html(" \xC2\xB7 ", $parent_links); } $request = $this->getDiffusionRequest(); @@ -488,7 +486,7 @@ final class DiffusionCommitController extends DiffusionController { foreach ($task_phids as $phid) { $task_list[] = $handles[$phid]->renderLink(); } - $task_list = array_interleave(phutil_tag('br'), $task_list); + $task_list = phutil_implode_html(phutil_tag('br'), $task_list); $props['Tasks'] = $task_list; } @@ -497,7 +495,7 @@ final class DiffusionCommitController extends DiffusionController { foreach ($proj_phids as $phid) { $proj_list[] = $handles[$phid]->renderLink(); } - $proj_list = array_interleave(phutil_tag('br'), $proj_list); + $proj_list = phutil_implode_html(phutil_tag('br'), $proj_list); $props['Projects'] = $proj_list; } @@ -938,7 +936,7 @@ final class DiffusionCommitController extends DiffusionController { $ref); } - return array_interleave(', ', $ref_links); + return phutil_implode_html(', ', $ref_links); } private function buildRawDiffResponse(DiffusionRequest $drequest) { diff --git a/src/applications/help/controller/PhabricatorHelpKeyboardShortcutController.php b/src/applications/help/controller/PhabricatorHelpKeyboardShortcutController.php index 7638535ce4..06ea9e9d0e 100644 --- a/src/applications/help/controller/PhabricatorHelpKeyboardShortcutController.php +++ b/src/applications/help/controller/PhabricatorHelpKeyboardShortcutController.php @@ -27,7 +27,7 @@ final class PhabricatorHelpKeyboardShortcutController foreach ($shortcut['keys'] as $stroke) { $keystrokes[] = phutil_tag('kbd', array(), $stroke); } - $keystrokes = array_interleave(' or ', $keystrokes); + $keystrokes = phutil_implode_html(' or ', $keystrokes); $rows[] = phutil_tag( 'tr', array(), diff --git a/src/applications/macro/controller/PhabricatorMacroViewController.php b/src/applications/macro/controller/PhabricatorMacroViewController.php index 770ae16a1c..94e0c4691f 100644 --- a/src/applications/macro/controller/PhabricatorMacroViewController.php +++ b/src/applications/macro/controller/PhabricatorMacroViewController.php @@ -147,7 +147,7 @@ final class PhabricatorMacroViewController foreach ($subscribers as $subscriber) { $sub_view[] = $this->getHandle($subscriber)->renderLink(); } - $sub_view = array_interleave(', ', $sub_view); + $sub_view = phutil_implode_html(', ', $sub_view); } else { $sub_view = phutil_tag('em', array(), pht('None')); } diff --git a/src/applications/maniphest/controller/ManiphestTaskEditController.php b/src/applications/maniphest/controller/ManiphestTaskEditController.php index 23fcf30bee..cd3b13dc8e 100644 --- a/src/applications/maniphest/controller/ManiphestTaskEditController.php +++ b/src/applications/maniphest/controller/ManiphestTaskEditController.php @@ -456,7 +456,7 @@ final class ManiphestTaskEditController extends ManiphestController { if ($files) { $file_display = mpull($files, 'getName'); - $file_display = array_interleave(phutil_tag('br'), $file_display); + $file_display = phutil_implode_html(phutil_tag('br'), $file_display); $form->appendChild( id(new AphrontFormMarkupControl()) diff --git a/src/applications/owners/controller/PhabricatorOwnersDetailController.php b/src/applications/owners/controller/PhabricatorOwnersDetailController.php index 417cc58764..7381a20c1a 100644 --- a/src/applications/owners/controller/PhabricatorOwnersDetailController.php +++ b/src/applications/owners/controller/PhabricatorOwnersDetailController.php @@ -64,7 +64,7 @@ final class PhabricatorOwnersDetailController foreach ($owners as $owner) { $owner_links[] = $handles[$owner->getUserPHID()]->renderLink(); } - $owner_links = array_interleave(phutil_tag('br'), $owner_links); + $owner_links = phutil_implode_html(phutil_tag('br'), $owner_links); $rows[] = array('Owners', $owner_links); $rows[] = array( @@ -98,7 +98,7 @@ final class PhabricatorOwnersDetailController $repo_name, $path_link); } - $path_links = array_interleave(phutil_tag('br'), $path_links); + $path_links = phutil_implode_html(phutil_tag('br'), $path_links); $rows[] = array('Paths', $path_links); $table = new AphrontTableView($rows); diff --git a/src/applications/owners/controller/PhabricatorOwnersListController.php b/src/applications/owners/controller/PhabricatorOwnersListController.php index 8c622c1867..babe04b9c1 100644 --- a/src/applications/owners/controller/PhabricatorOwnersListController.php +++ b/src/applications/owners/controller/PhabricatorOwnersListController.php @@ -238,7 +238,7 @@ final class PhabricatorOwnersListController $pkg_owners[$key] = phutil_tag('strong', array(), $pkg_owners[$key]); } } - $pkg_owners = array_interleave(phutil_tag('br'), $pkg_owners); + $pkg_owners = phutil_implode_html(phutil_tag('br'), $pkg_owners); $pkg_paths = idx($paths, $package->getID(), array()); foreach ($pkg_paths as $key => $path) { @@ -265,7 +265,7 @@ final class PhabricatorOwnersListController $pkg_paths[$key] = $path->getPath(); } } - $pkg_paths = array_interleave(phutil_tag('br'), $pkg_paths); + $pkg_paths = phutil_implode_html(phutil_tag('br'), $pkg_paths); $rows[] = array( phutil_tag( diff --git a/src/docs/developer/rendering_html.diviner b/src/docs/developer/rendering_html.diviner index 185c43caf9..617192d319 100644 --- a/src/docs/developer/rendering_html.diviner +++ b/src/docs/developer/rendering_html.diviner @@ -108,13 +108,13 @@ must to maintain backward compatibility.) If you need to build a list of items with some element in between each of them (like a middot, comma, or vertical bar) you can use -@{function:array_interleave}: +@{function:phutil_implode_html}: // Render links with commas between them. phutil_tag( 'div', array(), - array_interleave(', ', $list_of_links)); + phutil_implode_html(', ', $list_of_links)); = AphrontView Classes = diff --git a/src/view/layout/PhabricatorTimelineEventView.php b/src/view/layout/PhabricatorTimelineEventView.php index 97c1970d61..0bb29a2bbd 100644 --- a/src/view/layout/PhabricatorTimelineEventView.php +++ b/src/view/layout/PhabricatorTimelineEventView.php @@ -296,7 +296,7 @@ final class PhabricatorTimelineEventView extends AphrontView { array( 'class' => 'phabricator-timeline-extra', ), - array_interleave(" \xC2\xB7 ", $extra)); + phutil_implode_html(" \xC2\xB7 ", $extra)); } return $extra;