From c47117028f96d66875c4497446b7c1ecc02a0843 Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 2 Jan 2024 14:36:54 +1300 Subject: [PATCH] Remove pass-by-reference We have removed a bunch of these (added for php4.x support) with no issues - it's only where there is inheritance we have hit issues --- CRM/Utils/Date.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/CRM/Utils/Date.php b/CRM/Utils/Date.php index e4d89c0d33..fcb0ec2337 100644 --- a/CRM/Utils/Date.php +++ b/CRM/Utils/Date.php @@ -167,7 +167,7 @@ class CRM_Utils_Date { * 0-based array with abbreviated weekday names * */ - public static function getAbbrWeekdayNames() { + public static function getAbbrWeekdayNames(): array { $key = 'abbrDays_' . \CRM_Core_I18n::getLocale(); if (empty(\Civi::$statics[__CLASS__][$key])) { $intl_formatter = IntlDateFormatter::create(CRM_Core_I18n::getLocale(), IntlDateFormatter::MEDIUM, IntlDateFormatter::MEDIUM, NULL, IntlDateFormatter::GREGORIAN, 'E'); @@ -204,7 +204,7 @@ class CRM_Utils_Date { * 0-based array with full weekday names * */ - public static function getFullWeekdayNames() { + public static function getFullWeekdayNames(): array { $key = 'fullDays_' . \CRM_Core_I18n::getLocale(); if (empty(\Civi::$statics[__CLASS__][$key])) { $intl_formatter = IntlDateFormatter::create(CRM_Core_I18n::getLocale(), IntlDateFormatter::MEDIUM, IntlDateFormatter::MEDIUM, NULL, IntlDateFormatter::GREGORIAN, 'EEEE'); @@ -258,13 +258,12 @@ class CRM_Utils_Date { /** * Return abbreviated month names according to the locale. * - * @param bool $month + * @param bool|string $month * - * @return array + * @return array|string * 1-based array with abbreviated month names - * */ - public static function &getAbbrMonthNames($month = FALSE) { + public static function getAbbrMonthNames($month = FALSE) { $key = 'abbrMonthNames_' . \CRM_Core_I18n::getLocale(); if (empty(\Civi::$statics[__CLASS__][$key])) { // Note: IntlDateFormatter provides even more strings than `strftime()` or `l10n/*/civicrm.mo`. @@ -291,7 +290,7 @@ class CRM_Utils_Date { * 1-based array with full month names * */ - public static function &getFullMonthNames() { + public static function getFullMonthNames(): array { $key = 'fullMonthNames_' . \CRM_Core_I18n::getLocale(); if (empty(\Civi::$statics[__CLASS__][$key])) { // Note: IntlDateFormatter provides even more strings than `strftime()` or `l10n/*/civicrm.mo`. -- 2.25.1