diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 44def0cba1..e7f99dd42e 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -929,8 +929,7 @@ phutil_register_library_map(array( ), 'function' => array( - '__phabricator_date_format' => 'view/utils', - '__phabricator_format_local_time' => 'view/utils', + '_phabricator_date_format' => 'view/utils', '_qsprintf_check_scalar_type' => 'storage/qsprintf', '_qsprintf_check_type' => 'storage/qsprintf', 'celerity_generate_unique_node_id' => 'infrastructure/celerity/api', @@ -938,6 +937,7 @@ phutil_register_library_map(array( 'javelin_render_tag' => 'infrastructure/javelin/markup', 'phabricator_date' => 'view/utils', 'phabricator_datetime' => 'view/utils', + 'phabricator_format_local_time' => 'view/utils', 'phabricator_format_relative_time' => 'view/utils', 'phabricator_format_units_generic' => 'view/utils', 'phabricator_on_relative_date' => 'view/utils', diff --git a/src/applications/maniphest/controller/report/ManiphestReportController.php b/src/applications/maniphest/controller/report/ManiphestReportController.php index 711f366aaa..6537ed9339 100644 --- a/src/applications/maniphest/controller/report/ManiphestReportController.php +++ b/src/applications/maniphest/controller/report/ManiphestReportController.php @@ -145,7 +145,7 @@ final class ManiphestReportController extends ManiphestController { continue; } - $day_bucket = __phabricator_format_local_time( + $day_bucket = phabricator_format_local_time( $row['dateCreated'], $user, 'z'); @@ -179,7 +179,7 @@ final class ManiphestReportController extends ManiphestController { foreach ($stats as $bucket => $info) { $epoch = $day_buckets[$bucket]; - $week_bucket = __phabricator_format_local_time( + $week_bucket = phabricator_format_local_time( $epoch, $user, 'W'); @@ -195,14 +195,14 @@ final class ManiphestReportController extends ManiphestController { $last_week_epoch = $epoch; } - $month_bucket = __phabricator_format_local_time( + $month_bucket = phabricator_format_local_time( $epoch, $user, 'm'); if ($month_bucket != $last_month) { if ($month) { $rows[] = $this->formatBurnRow( - __phabricator_format_local_time($last_month_epoch, $user, 'F, Y'), + phabricator_format_local_time($last_month_epoch, $user, 'F, Y'), $month); $rowc[] = 'month'; } diff --git a/src/infrastructure/daemon/irc/bot/PhabricatorIRCBot.php b/src/infrastructure/daemon/irc/bot/PhabricatorIRCBot.php index 1bd9f6e1b8..6356b8a40d 100644 --- a/src/infrastructure/daemon/irc/bot/PhabricatorIRCBot.php +++ b/src/infrastructure/daemon/irc/bot/PhabricatorIRCBot.php @@ -240,7 +240,7 @@ final class PhabricatorIRCBot extends PhabricatorDaemon { } } - public function __destroy() { + public function __destruct() { $this->write("QUIT Goodbye.\r\n"); fclose($this->socket); } diff --git a/src/view/utils/viewutils.php b/src/view/utils/viewutils.php index 9fa8f534c6..5eafbc14ed 100644 --- a/src/view/utils/viewutils.php +++ b/src/view/utils/viewutils.php @@ -17,10 +17,10 @@ */ function phabricator_date($epoch, $user) { - return __phabricator_format_local_time( + return phabricator_format_local_time( $epoch, $user, - __phabricator_date_format($epoch)); + _phabricator_date_format($epoch)); } function phabricator_on_relative_date($epoch, $user) { @@ -51,20 +51,20 @@ function phabricator_relative_date($epoch, $user, $on = false) { } function phabricator_time($epoch, $user) { - return __phabricator_format_local_time( + return phabricator_format_local_time( $epoch, $user, 'g:i A'); } function phabricator_datetime($epoch, $user) { - return __phabricator_format_local_time( + return phabricator_format_local_time( $epoch, $user, - __phabricator_date_format($epoch).', g:i A'); + _phabricator_date_format($epoch).', g:i A'); } -function __phabricator_date_format($epoch) { +function _phabricator_date_format($epoch) { $format = 'M j Y'; $now = time(); if ($epoch <= $now && $epoch > $now - 30 * 24 * 60 * 60) { @@ -74,7 +74,7 @@ function __phabricator_date_format($epoch) { } /** - * Internal date rendering method. Do not call this directly; instead, call + * This function does not usually need to be called directly. Instead, call * @{function:phabricator_date}, @{function:phabricator_time}, or * @{function:phabricator_datetime}. * @@ -83,7 +83,7 @@ function __phabricator_date_format($epoch) { * @param string Date format, as per DateTime class. * @return string Formatted, local date/time. */ -function __phabricator_format_local_time($epoch, $user, $format) { +function phabricator_format_local_time($epoch, $user, $format) { if (!$epoch) { // If we're missing date information for something, the DateTime class will // throw an exception when we try to construct an object. Since this is a