diff --git a/src/aphront/console/core/DarkConsoleCore.php b/src/aphront/console/core/DarkConsoleCore.php index 38a6f0f0fb..1786447786 100644 --- a/src/aphront/console/core/DarkConsoleCore.php +++ b/src/aphront/console/core/DarkConsoleCore.php @@ -1,7 +1,7 @@ getConsoleVisible(); if (!isset($plugins[$selected])) { - reset($plugins); - $selected = key($plugins); + $selected = head_key($plugins); } $tabs = array(); diff --git a/src/applications/conduit/controller/console/PhabricatorConduitConsoleController.php b/src/applications/conduit/controller/console/PhabricatorConduitConsoleController.php index 010c03ba87..ab945a3a82 100644 --- a/src/applications/conduit/controller/console/PhabricatorConduitConsoleController.php +++ b/src/applications/conduit/controller/console/PhabricatorConduitConsoleController.php @@ -34,7 +34,7 @@ final class PhabricatorConduitConsoleController $methods = $this->getAllMethods(); if (empty($methods[$this->method])) { - $this->method = key($methods); + $this->method = head_key($methods); } $this->setFilter('method/'.$this->method); diff --git a/src/applications/diffusion/controller/external/DiffusionExternalController.php b/src/applications/diffusion/controller/external/DiffusionExternalController.php index 4590fb2f13..8ae8dcdba1 100644 --- a/src/applications/diffusion/controller/external/DiffusionExternalController.php +++ b/src/applications/diffusion/controller/external/DiffusionExternalController.php @@ -52,8 +52,7 @@ final class DiffusionExternalController extends DiffusionController { } arsort($matches); - reset($matches); - $best_match = key($matches); + $best_match = head_key($matches); if ($best_match) { $repository = $repositories[$best_match]; diff --git a/src/applications/herald/controller/home/HeraldHomeController.php b/src/applications/herald/controller/home/HeraldHomeController.php index 8d15a70ad4..ba7d877715 100644 --- a/src/applications/herald/controller/home/HeraldHomeController.php +++ b/src/applications/herald/controller/home/HeraldHomeController.php @@ -46,7 +46,7 @@ final class HeraldHomeController extends HeraldController { $content_type_map = HeraldContentTypeConfig::getContentTypeMap(); if (empty($content_type_map[$this->contentType])) { - $this->contentType = key($content_type_map); + $this->contentType = head_key($content_type_map); } $content_desc = $content_type_map[$this->contentType]; diff --git a/src/applications/herald/controller/new/HeraldNewController.php b/src/applications/herald/controller/new/HeraldNewController.php index be74cfdec7..5909604032 100644 --- a/src/applications/herald/controller/new/HeraldNewController.php +++ b/src/applications/herald/controller/new/HeraldNewController.php @@ -33,8 +33,7 @@ final class HeraldNewController extends HeraldController { $content_type_map = HeraldContentTypeConfig::getContentTypeMap(); if (empty($content_type_map[$this->contentType])) { - reset($content_type_map); - $this->contentType = key($content_type_map); + $this->contentType = head_key($content_type_map); } $rule_type_map = HeraldRuleTypeConfig::getRuleTypeMap(); diff --git a/src/applications/maniphest/controller/report/ManiphestReportController.php b/src/applications/maniphest/controller/report/ManiphestReportController.php index 91a95a96e4..fc8818124b 100644 --- a/src/applications/maniphest/controller/report/ManiphestReportController.php +++ b/src/applications/maniphest/controller/report/ManiphestReportController.php @@ -173,7 +173,7 @@ final class ManiphestReportController extends ManiphestController { $week = null; $month = null; - $last = key($stats) - 1; + $last = last_key($stats) - 1; $period = $template; foreach ($stats as $bucket => $info) { @@ -182,7 +182,7 @@ final class ManiphestReportController extends ManiphestController { $week_bucket = phabricator_format_local_time( $epoch, $user, - 'W'); + 'YW'); if ($week_bucket != $last_week) { if ($week) { $rows[] = $this->formatBurnRow( @@ -198,7 +198,7 @@ final class ManiphestReportController extends ManiphestController { $month_bucket = phabricator_format_local_time( $epoch, $user, - 'm'); + 'Ym'); if ($month_bucket != $last_month) { if ($month) { $rows[] = $this->formatBurnRow( diff --git a/src/applications/repository/controller/edit/PhabricatorRepositoryEditController.php b/src/applications/repository/controller/edit/PhabricatorRepositoryEditController.php index 1e5e0f790b..da29909d43 100644 --- a/src/applications/repository/controller/edit/PhabricatorRepositoryEditController.php +++ b/src/applications/repository/controller/edit/PhabricatorRepositoryEditController.php @@ -46,8 +46,7 @@ final class PhabricatorRepositoryEditController $this->repository = $repository; if (!isset($views[$this->view])) { - reset($views); - $this->view = key($views); + $this->view = head_key($views); } $nav = new AphrontSideNavView(); diff --git a/src/applications/repository/daemon/commitdiscovery/svn/PhabricatorRepositorySvnCommitDiscoveryDaemon.php b/src/applications/repository/daemon/commitdiscovery/svn/PhabricatorRepositorySvnCommitDiscoveryDaemon.php index 360e80713e..c3a7a2fbfe 100644 --- a/src/applications/repository/daemon/commitdiscovery/svn/PhabricatorRepositorySvnCommitDiscoveryDaemon.php +++ b/src/applications/repository/daemon/commitdiscovery/svn/PhabricatorRepositorySvnCommitDiscoveryDaemon.php @@ -33,8 +33,8 @@ final class PhabricatorRepositorySvnCommitDiscoveryDaemon $uri); $results = $this->parseSVNLogXML($xml); - $commit = key($results); - $epoch = reset($results); + $commit = head_key($results); + $epoch = head($results); if ($this->isKnownCommit($commit)) { return false; diff --git a/src/applications/uiexample/controller/render/PhabricatorUIExampleRenderController.php b/src/applications/uiexample/controller/render/PhabricatorUIExampleRenderController.php index 25294c5e1b..3cd4165565 100644 --- a/src/applications/uiexample/controller/render/PhabricatorUIExampleRenderController.php +++ b/src/applications/uiexample/controller/render/PhabricatorUIExampleRenderController.php @@ -41,8 +41,7 @@ final class PhabricatorUIExampleRenderController } if (!$selected) { - reset($classes); - $selected = key($classes); + $selected = head_key($classes); } $nav = new AphrontSideNavView();