diff options
| author | Greg Roach <fisharebest@gmail.com> | 2016-12-23 21:15:42 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2016-12-23 21:15:42 +0000 |
| commit | 13abd6f3a37322f885d85df150e105d27ad81f8d (patch) | |
| tree | f023015b458c95273afe5876246adf141de169ca /app/Date | |
| parent | 2c55bacfbfed3c49d3f2ac181fb519d24ffe2803 (diff) | |
| download | webtrees-13abd6f3a37322f885d85df150e105d27ad81f8d.tar.gz webtrees-13abd6f3a37322f885d85df150e105d27ad81f8d.tar.bz2 webtrees-13abd6f3a37322f885d85df150e105d27ad81f8d.zip | |
Code style - short array syntax
Diffstat (limited to 'app/Date')
| -rw-r--r-- | app/Date/CalendarDate.php | 38 | ||||
| -rw-r--r-- | app/Date/FrenchDate.php | 22 | ||||
| -rw-r--r-- | app/Date/HijriDate.php | 18 | ||||
| -rw-r--r-- | app/Date/JalaliDate.php | 22 | ||||
| -rw-r--r-- | app/Date/JewishDate.php | 22 |
5 files changed, 61 insertions, 61 deletions
diff --git a/app/Date/CalendarDate.php b/app/Date/CalendarDate.php index 427edfcb99..5f4809b9d0 100644 --- a/app/Date/CalendarDate.php +++ b/app/Date/CalendarDate.php @@ -33,10 +33,10 @@ use Fisharebest\Webtrees\I18N; */ class CalendarDate { /** @var int[] Convert GEDCOM month names to month numbers */ - public static $MONTH_ABBREV = array('' => 0, 'JAN' => 1, 'FEB' => 2, 'MAR' => 3, 'APR' => 4, 'MAY' => 5, 'JUN' => 6, 'JUL' => 7, 'AUG' => 8, 'SEP' => 9, 'OCT' => 10, 'NOV' => 11, 'DEC' => 12); + public static $MONTH_ABBREV = ['' => 0, 'JAN' => 1, 'FEB' => 2, 'MAR' => 3, 'APR' => 4, 'MAY' => 5, 'JUN' => 6, 'JUL' => 7, 'AUG' => 8, 'SEP' => 9, 'OCT' => 10, 'NOV' => 11, 'DEC' => 12]; /** @var string[] Convert numbers to/from roman numerals */ - protected static $roman_numerals = array(1000 => 'M', 900 => 'CM', 500 => 'D', 400 => 'CD', 100 => 'C', 90 => 'XC', 50 => 'L', 40 => 'XL', 10 => 'X', 9 => 'IX', 5 => 'V', 4 => 'IV', 1 => 'I'); + protected static $roman_numerals = [1000 => 'M', 900 => 'CM', 500 => 'D', 400 => 'CD', 100 => 'C', 90 => 'XC', 50 => 'L', 40 => 'XL', 10 => 'X', 9 => 'IX', 5 => 'V', 4 => 'IV', 1 => 'I']; /** @var CalendarInterface The calendar system used to represent this date */ protected $calendar; @@ -172,7 +172,7 @@ class CalendarDate { static $translated_month_names; if ($translated_month_names === null) { - $translated_month_names = array( + $translated_month_names = [ 0 => '', 1 => I18N::translateContext('NOMINATIVE', 'January'), 2 => I18N::translateContext('NOMINATIVE', 'February'), @@ -186,7 +186,7 @@ class CalendarDate { 10 => I18N::translateContext('NOMINATIVE', 'October'), 11 => I18N::translateContext('NOMINATIVE', 'November'), 12 => I18N::translateContext('NOMINATIVE', 'December'), - ); + ]; } return $translated_month_names[$month_number]; @@ -206,7 +206,7 @@ class CalendarDate { static $translated_month_names; if ($translated_month_names === null) { - $translated_month_names = array( + $translated_month_names = [ 0 => '', 1 => I18N::translateContext('GENITIVE', 'January'), 2 => I18N::translateContext('GENITIVE', 'February'), @@ -220,7 +220,7 @@ class CalendarDate { 10 => I18N::translateContext('GENITIVE', 'October'), 11 => I18N::translateContext('GENITIVE', 'November'), 12 => I18N::translateContext('GENITIVE', 'December'), - ); + ]; } return $translated_month_names[$month_number]; @@ -240,7 +240,7 @@ class CalendarDate { static $translated_month_names; if ($translated_month_names === null) { - $translated_month_names = array( + $translated_month_names = [ 0 => '', 1 => I18N::translateContext('LOCATIVE', 'January'), 2 => I18N::translateContext('LOCATIVE', 'February'), @@ -254,7 +254,7 @@ class CalendarDate { 10 => I18N::translateContext('LOCATIVE', 'October'), 11 => I18N::translateContext('LOCATIVE', 'November'), 12 => I18N::translateContext('LOCATIVE', 'December'), - ); + ]; } return $translated_month_names[$month_number]; @@ -274,7 +274,7 @@ class CalendarDate { static $translated_month_names; if ($translated_month_names === null) { - $translated_month_names = array( + $translated_month_names = [ 0 => '', 1 => I18N::translateContext('INSTRUMENTAL', 'January'), 2 => I18N::translateContext('INSTRUMENTAL', 'February'), @@ -288,7 +288,7 @@ class CalendarDate { 10 => I18N::translateContext('INSTRUMENTAL', 'October'), 11 => I18N::translateContext('INSTRUMENTAL', 'November'), 12 => I18N::translateContext('INSTRUMENTAL', 'December'), - ); + ]; } return $translated_month_names[$month_number]; @@ -306,7 +306,7 @@ class CalendarDate { static $translated_month_names; if ($translated_month_names === null) { - $translated_month_names = array( + $translated_month_names = [ 0 => '', 1 => I18N::translateContext('Abbreviation for January', 'Jan'), 2 => I18N::translateContext('Abbreviation for February', 'Feb'), @@ -320,7 +320,7 @@ class CalendarDate { 10 => I18N::translateContext('Abbreviation for October', 'Oct'), 11 => I18N::translateContext('Abbreviation for November', 'Nov'), 12 => I18N::translateContext('Abbreviation for December', 'Dec'), - ); + ]; } return $translated_month_names[$month_number]; @@ -337,7 +337,7 @@ class CalendarDate { static $translated_day_names; if ($translated_day_names === null) { - $translated_day_names = array( + $translated_day_names = [ 0 => I18N::translate('Monday'), 1 => I18N::translate('Tuesday'), 2 => I18N::translate('Wednesday'), @@ -345,7 +345,7 @@ class CalendarDate { 4 => I18N::translate('Friday'), 5 => I18N::translate('Saturday'), 6 => I18N::translate('Sunday'), - ); + ]; } return $translated_day_names[$day_number]; @@ -362,7 +362,7 @@ class CalendarDate { static $translated_day_names; if ($translated_day_names === null) { - $translated_day_names = array( + $translated_day_names = [ 0 => /* I18N: abbreviation for Monday */ I18N::translate('Mon'), 1 => /* I18N: abbreviation for Tuesday */ I18N::translate('Tue'), 2 => /* I18N: abbreviation for Wednesday */ I18N::translate('Wed'), @@ -370,7 +370,7 @@ class CalendarDate { 4 => /* I18N: abbreviation for Friday */ I18N::translate('Fri'), 5 => /* I18N: abbreviation for Saturday */ I18N::translate('Sat'), 6 => /* I18N: abbreviation for Sunday */ I18N::translate('Sun'), - ); + ]; } return $translated_day_names[$day_number]; @@ -554,10 +554,10 @@ class CalendarDate { $format = preg_replace('/%[djlDNSwz][,]?/', '', $format); } if (!$this->m) { - $format = str_replace(array('%F', '%m', '%M', '%n', '%t'), '', $format); + $format = str_replace(['%F', '%m', '%M', '%n', '%t'], '', $format); } if (!$this->y) { - $format = str_replace(array('%t', '%L', '%G', '%y', '%Y'), '', $format); + $format = str_replace(['%t', '%L', '%G', '%y', '%Y'], '', $format); } // If we’ve trimmed the format, also trim the punctuation if (!$this->d || !$this->m || !$this->y) { @@ -845,7 +845,7 @@ class CalendarDate { * @return int[] */ protected function nextMonth() { - return array($this->m === $this->calendar->monthsInYear() ? $this->nextYear($this->y) : $this->y, ($this->m % $this->calendar->monthsInYear()) + 1); + return [$this->m === $this->calendar->monthsInYear() ? $this->nextYear($this->y) : $this->y, ($this->m % $this->calendar->monthsInYear()) + 1]; } /** diff --git a/app/Date/FrenchDate.php b/app/Date/FrenchDate.php index ecd6ddddd9..07459302bb 100644 --- a/app/Date/FrenchDate.php +++ b/app/Date/FrenchDate.php @@ -23,7 +23,7 @@ use Fisharebest\Webtrees\I18N; */ class FrenchDate extends CalendarDate { /** @var int[] Convert GEDCOM month names to month numbers */ - public static $MONTH_ABBREV = array('' => 0, 'VEND' => 1, 'BRUM' => 2, 'FRIM' => 3, 'NIVO' => 4, 'PLUV' => 5, 'VENT' => 6, 'GERM' => 7, 'FLOR' => 8, 'PRAI' => 9, 'MESS' => 10, 'THER' => 11, 'FRUC' => 12, 'COMP' => 13); + public static $MONTH_ABBREV = ['' => 0, 'VEND' => 1, 'BRUM' => 2, 'FRIM' => 3, 'NIVO' => 4, 'PLUV' => 5, 'VENT' => 6, 'GERM' => 7, 'FLOR' => 8, 'PRAI' => 9, 'MESS' => 10, 'THER' => 11, 'FRUC' => 12, 'COMP' => 13]; /** * Create a date from either: @@ -50,7 +50,7 @@ class FrenchDate extends CalendarDate { static $translated_month_names; if ($translated_month_names === null) { - $translated_month_names = array( + $translated_month_names = [ 0 => '', 1 => /* I18N: a month in the French republican calendar */ I18N::translateContext('NOMINATIVE', 'Vendemiaire'), 2 => /* I18N: a month in the French republican calendar */ I18N::translateContext('NOMINATIVE', 'Brumaire'), @@ -65,7 +65,7 @@ class FrenchDate extends CalendarDate { 11 => /* I18N: a month in the French republican calendar */ I18N::translateContext('NOMINATIVE', 'Thermidor'), 12 => /* I18N: a month in the French republican calendar */ I18N::translateContext('NOMINATIVE', 'Fructidor'), 13 => /* I18N: a month in the French republican calendar */ I18N::translateContext('NOMINATIVE', 'jours complementaires'), - ); + ]; } return $translated_month_names[$month_number]; @@ -83,7 +83,7 @@ class FrenchDate extends CalendarDate { static $translated_month_names; if ($translated_month_names === null) { - $translated_month_names = array( + $translated_month_names = [ 0 => '', 1 => /* I18N: a month in the French republican calendar */ I18N::translateContext('GENITIVE', 'Vendemiaire'), 2 => /* I18N: a month in the French republican calendar */ I18N::translateContext('GENITIVE', 'Brumaire'), @@ -98,7 +98,7 @@ class FrenchDate extends CalendarDate { 11 => /* I18N: a month in the French republican calendar */ I18N::translateContext('GENITIVE', 'Thermidor'), 12 => /* I18N: a month in the French republican calendar */ I18N::translateContext('GENITIVE', 'Fructidor'), 13 => /* I18N: a month in the French republican calendar */ I18N::translateContext('GENITIVE', 'jours complementaires'), - ); + ]; } return $translated_month_names[$month_number]; @@ -116,7 +116,7 @@ class FrenchDate extends CalendarDate { static $translated_month_names; if ($translated_month_names === null) { - $translated_month_names = array( + $translated_month_names = [ 0 => '', 1 => /* I18N: a month in the French republican calendar */ I18N::translateContext('LOCATIVE', 'Vendemiaire'), 2 => /* I18N: a month in the French republican calendar */ I18N::translateContext('LOCATIVE', 'Brumaire'), @@ -131,7 +131,7 @@ class FrenchDate extends CalendarDate { 11 => /* I18N: a month in the French republican calendar */ I18N::translateContext('LOCATIVE', 'Thermidor'), 12 => /* I18N: a month in the French republican calendar */ I18N::translateContext('LOCATIVE', 'Fructidor'), 13 => /* I18N: a month in the French republican calendar */ I18N::translateContext('LOCATIVE', 'jours complementaires'), - ); + ]; } return $translated_month_names[$month_number]; @@ -149,7 +149,7 @@ class FrenchDate extends CalendarDate { static $translated_month_names; if ($translated_month_names === null) { - $translated_month_names = array( + $translated_month_names = [ 0 => '', 1 => /* I18N: a month in the French republican calendar */ I18N::translateContext('INSTRUMENTAL', 'Vendemiaire'), 2 => /* I18N: a month in the French republican calendar */ I18N::translateContext('INSTRUMENTAL', 'Brumaire'), @@ -164,7 +164,7 @@ class FrenchDate extends CalendarDate { 11 => /* I18N: a month in the French republican calendar */ I18N::translateContext('INSTRUMENTAL', 'Thermidor'), 12 => /* I18N: a month in the French republican calendar */ I18N::translateContext('INSTRUMENTAL', 'Fructidor'), 13 => /* I18N: a month in the French republican calendar */ I18N::translateContext('INSTRUMENTAL', 'jours complementaires'), - ); + ]; } return $translated_month_names[$month_number]; @@ -193,7 +193,7 @@ class FrenchDate extends CalendarDate { static $translated_day_names; if ($translated_day_names === null) { - $translated_day_names = array( + $translated_day_names = [ 0 => /* I18N: The first day in the French republican calendar */ I18N::translate('Primidi'), 1 => /* I18N: The second day in the French republican calendar */ I18N::translate('Duodi'), 2 => /* I18N: The third day in the French republican calendar */ I18N::translate('Tridi'), @@ -204,7 +204,7 @@ class FrenchDate extends CalendarDate { 7 => /* I18N: The eighth day in the French republican calendar */ I18N::translate('Octidi'), 8 => /* I18N: The ninth day in the French republican calendar */ I18N::translate('Nonidi'), 9 => /* I18N: The tenth day in the French republican calendar */ I18N::translate('Decidi'), - ); + ]; } return $translated_day_names[$day_number]; diff --git a/app/Date/HijriDate.php b/app/Date/HijriDate.php index 97a1090ef9..6df472e32e 100644 --- a/app/Date/HijriDate.php +++ b/app/Date/HijriDate.php @@ -26,7 +26,7 @@ use Fisharebest\Webtrees\I18N; */ class HijriDate extends CalendarDate { /** @var int[] Convert GEDCOM month names to month numbers */ - public static $MONTH_ABBREV = array('' => 0, 'MUHAR' => 1, 'SAFAR' => 2, 'RABIA' => 3, 'RABIT' => 4, 'JUMAA' => 5, 'JUMAT' => 6, 'RAJAB' => 7, 'SHAAB' => 8, 'RAMAD' => 9, 'SHAWW' => 10, 'DHUAQ' => 11, 'DHUAH' => 12); + public static $MONTH_ABBREV = ['' => 0, 'MUHAR' => 1, 'SAFAR' => 2, 'RABIA' => 3, 'RABIT' => 4, 'JUMAA' => 5, 'JUMAT' => 6, 'RAJAB' => 7, 'SHAAB' => 8, 'RAMAD' => 9, 'SHAWW' => 10, 'DHUAQ' => 11, 'DHUAH' => 12]; /** * Create a date from either: @@ -53,7 +53,7 @@ class HijriDate extends CalendarDate { static $translated_month_names; if ($translated_month_names === null) { - $translated_month_names = array( + $translated_month_names = [ 0 => '', 1 => /* I18N: http://en.wikipedia.org/wiki/Muharram */ I18N::translateContext('NOMINATIVE', 'Muharram'), 2 => /* I18N: http://en.wikipedia.org/wiki/Safar */ I18N::translateContext('NOMINATIVE', 'Safar'), @@ -67,7 +67,7 @@ class HijriDate extends CalendarDate { 10 => /* I18N: http://en.wikipedia.org/wiki/Shawwal */ I18N::translateContext('NOMINATIVE', 'Shawwal'), 11 => /* I18N: http://en.wikipedia.org/wiki/Dhu_al-Qi%27dah */ I18N::translateContext('NOMINATIVE', 'Dhu al-Qi’dah'), 12 => /* I18N: http://en.wikipedia.org/wiki/Dhu_al-Hijjah */ I18N::translateContext('NOMINATIVE', 'Dhu al-Hijjah'), - ); + ]; } return $translated_month_names[$month_number]; @@ -85,7 +85,7 @@ class HijriDate extends CalendarDate { static $translated_month_names; if ($translated_month_names === null) { - $translated_month_names = array( + $translated_month_names = [ 0 => '', 1 => /* I18N: http://en.wikipedia.org/wiki/Muharram */ I18N::translateContext('GENITIVE', 'Muharram'), 2 => /* I18N: http://en.wikipedia.org/wiki/Safar */ I18N::translateContext('GENITIVE', 'Safar'), @@ -99,7 +99,7 @@ class HijriDate extends CalendarDate { 10 => /* I18N: http://en.wikipedia.org/wiki/Shawwal */ I18N::translateContext('GENITIVE', 'Shawwal'), 11 => /* I18N: http://en.wikipedia.org/wiki/Dhu_al-Qi%27dah */ I18N::translateContext('GENITIVE', 'Dhu al-Qi’dah'), 12 => /* I18N: http://en.wikipedia.org/wiki/Dhu_al-Hijjah */ I18N::translateContext('GENITIVE', 'Dhu al-Hijjah'), - ); + ]; } return $translated_month_names[$month_number]; @@ -117,7 +117,7 @@ class HijriDate extends CalendarDate { static $translated_month_names; if ($translated_month_names === null) { - $translated_month_names = array( + $translated_month_names = [ 0 => '', 1 => /* I18N: http://en.wikipedia.org/wiki/Muharram */ I18N::translateContext('LOCATIVE', 'Muharram'), 2 => /* I18N: http://en.wikipedia.org/wiki/Safar */ I18N::translateContext('LOCATIVE', 'Safar'), @@ -131,7 +131,7 @@ class HijriDate extends CalendarDate { 10 => /* I18N: http://en.wikipedia.org/wiki/Shawwal */ I18N::translateContext('LOCATIVE', 'Shawwal'), 11 => /* I18N: http://en.wikipedia.org/wiki/Dhu_al-Qi%27dah */ I18N::translateContext('LOCATIVE', 'Dhu al-Qi’dah'), 12 => /* I18N: http://en.wikipedia.org/wiki/Dhu_al-Hijjah */ I18N::translateContext('LOCATIVE', 'Dhu al-Hijjah'), - ); + ]; } return $translated_month_names[$month_number]; @@ -149,7 +149,7 @@ class HijriDate extends CalendarDate { static $translated_month_names; if ($translated_month_names === null) { - $translated_month_names = array( + $translated_month_names = [ 0 => '', 1 => /* I18N: http://en.wikipedia.org/wiki/Muharram */ I18N::translateContext('INSTRUMENTAL', 'Muharram'), 2 => /* I18N: http://en.wikipedia.org/wiki/Safar */ I18N::translateContext('INSTRUMENTAL', 'Safar'), @@ -163,7 +163,7 @@ class HijriDate extends CalendarDate { 10 => /* I18N: http://en.wikipedia.org/wiki/Shawwal */ I18N::translateContext('INSTRUMENTAL', 'Shawwal'), 11 => /* I18N: http://en.wikipedia.org/wiki/Dhu_al-Qi%27dah */ I18N::translateContext('INSTRUMENTAL', 'Dhu al-Qi’dah'), 12 => /* I18N: http://en.wikipedia.org/wiki/Dhu_al-Hijjah */ I18N::translateContext('INSTRUMENTAL', 'Dhu al-Hijjah'), - ); + ]; } return $translated_month_names[$month_number]; diff --git a/app/Date/JalaliDate.php b/app/Date/JalaliDate.php index 6eb62fd93e..8414aa2b67 100644 --- a/app/Date/JalaliDate.php +++ b/app/Date/JalaliDate.php @@ -23,7 +23,7 @@ use Fisharebest\Webtrees\I18N; */ class JalaliDate extends CalendarDate { /** @var int[] Convert GEDCOM month names to month numbers */ - public static $MONTH_ABBREV = array('' => 0, 'FARVA' => 1, 'ORDIB' => 2, 'KHORD' => 3, 'TIR' => 4, 'MORDA' => 5, 'SHAHR' => 6, 'MEHR' => 7, 'ABAN' => 8, 'AZAR' => 9, 'DEY' => 10, 'BAHMA' => 11, 'ESFAN' => 12); + public static $MONTH_ABBREV = ['' => 0, 'FARVA' => 1, 'ORDIB' => 2, 'KHORD' => 3, 'TIR' => 4, 'MORDA' => 5, 'SHAHR' => 6, 'MEHR' => 7, 'ABAN' => 8, 'AZAR' => 9, 'DEY' => 10, 'BAHMA' => 11, 'ESFAN' => 12]; /** * Create a date from either: @@ -50,7 +50,7 @@ class JalaliDate extends CalendarDate { static $translated_month_names; if ($translated_month_names === null) { - $translated_month_names = array( + $translated_month_names = [ 0 => '', 1 => /* I18N: 1st month in the Persian/Jalali calendar */ I18N::translateContext('NOMINATIVE', 'Farvardin'), 2 => /* I18N: 2nd month in the Persian/Jalali calendar */ I18N::translateContext('NOMINATIVE', 'Ordibehesht'), @@ -64,7 +64,7 @@ class JalaliDate extends CalendarDate { 10 => /* I18N: 10th month in the Persian/Jalali calendar */ I18N::translateContext('NOMINATIVE', 'Dey'), 11 => /* I18N: 11th month in the Persian/Jalali calendar */ I18N::translateContext('NOMINATIVE', 'Bahman'), 12 => /* I18N: 12th month in the Persian/Jalali calendar */ I18N::translateContext('NOMINATIVE', 'Esfand'), - ); + ]; } return $translated_month_names[$month_number]; @@ -82,7 +82,7 @@ class JalaliDate extends CalendarDate { static $translated_month_names; if ($translated_month_names === null) { - $translated_month_names = array( + $translated_month_names = [ 0 => '', 1 => /* I18N: 1st month in the Persian/Jalali calendar */ I18N::translateContext('GENITIVE', 'Farvardin'), 2 => /* I18N: 2nd month in the Persian/Jalali calendar */ I18N::translateContext('GENITIVE', 'Ordibehesht'), @@ -96,7 +96,7 @@ class JalaliDate extends CalendarDate { 10 => /* I18N: 10th month in the Persian/Jalali calendar */ I18N::translateContext('GENITIVE', 'Dey'), 11 => /* I18N: 11th month in the Persian/Jalali calendar */ I18N::translateContext('GENITIVE', 'Bahman'), 12 => /* I18N: 12th month in the Persian/Jalali calendar */ I18N::translateContext('GENITIVE', 'Esfand'), - ); + ]; } return $translated_month_names[$month_number]; @@ -114,7 +114,7 @@ class JalaliDate extends CalendarDate { static $translated_month_names; if ($translated_month_names === null) { - $translated_month_names = array( + $translated_month_names = [ 0 => '', 1 => /* I18N: 1st month in the Persian/Jalali calendar */ I18N::translateContext('LOCATIVE', 'Farvardin'), 2 => /* I18N: 2nd month in the Persian/Jalali calendar */ I18N::translateContext('LOCATIVE', 'Ordibehesht'), @@ -128,7 +128,7 @@ class JalaliDate extends CalendarDate { 10 => /* I18N: 10th month in the Persian/Jalali calendar */ I18N::translateContext('LOCATIVE', 'Dey'), 11 => /* I18N: 11th month in the Persian/Jalali calendar */ I18N::translateContext('LOCATIVE', 'Bahman'), 12 => /* I18N: 12th month in the Persian/Jalali calendar */ I18N::translateContext('LOCATIVE', 'Esfand'), - ); + ]; } return $translated_month_names[$month_number]; @@ -146,7 +146,7 @@ class JalaliDate extends CalendarDate { static $translated_month_names; if ($translated_month_names === null) { - $translated_month_names = array( + $translated_month_names = [ 0 => '', 1 => /* I18N: 1st month in the Persian/Jalali calendar */ I18N::translateContext('INSTRUMENTAL', 'Farvardin'), 2 => /* I18N: 2nd month in the Persian/Jalali calendar */ I18N::translateContext('INSTRUMENTAL', 'Ordibehesht'), @@ -160,7 +160,7 @@ class JalaliDate extends CalendarDate { 10 => /* I18N: 10th month in the Persian/Jalali calendar */ I18N::translateContext('INSTRUMENTAL', 'Dey'), 11 => /* I18N: 11th month in the Persian/Jalali calendar */ I18N::translateContext('INSTRUMENTAL', 'Bahman'), 12 => /* I18N: 12th month in the Persian/Jalali calendar */ I18N::translateContext('INSTRUMENTAL', 'Esfand'), - ); + ]; } return $translated_month_names[$month_number]; @@ -178,7 +178,7 @@ class JalaliDate extends CalendarDate { static $translated_month_names; if ($translated_month_names === null) { - $translated_month_names = array( + $translated_month_names = [ 0 => '', 1 => I18N::translateContext('Abbreviation for Persian month: Farvardin', 'Far'), 2 => I18N::translateContext('Abbreviation for Persian month: Ordibehesht', 'Ord'), @@ -192,7 +192,7 @@ class JalaliDate extends CalendarDate { 10 => I18N::translateContext('Abbreviation for Persian month: Dey', 'Dey'), 11 => I18N::translateContext('Abbreviation for Persian month: Bahman', 'Bah'), 12 => I18N::translateContext('Abbreviation for Persian month: Esfand', 'Esf'), - ); + ]; } return $translated_month_names[$month_number]; diff --git a/app/Date/JewishDate.php b/app/Date/JewishDate.php index 590cf27818..38077e3b3e 100644 --- a/app/Date/JewishDate.php +++ b/app/Date/JewishDate.php @@ -23,7 +23,7 @@ use Fisharebest\Webtrees\I18N; */ class JewishDate extends CalendarDate { /** @var int[] Convert GEDCOM month names to month numbers */ - public static $MONTH_ABBREV = array('' => 0, 'TSH' => 1, 'CSH' => 2, 'KSL' => 3, 'TVT' => 4, 'SHV' => 5, 'ADR' => 6, 'ADS' => 7, 'NSN' => 8, 'IYR' => 9, 'SVN' => 10, 'TMZ' => 11, 'AAV' => 12, 'ELL' => 13); + public static $MONTH_ABBREV = ['' => 0, 'TSH' => 1, 'CSH' => 2, 'KSL' => 3, 'TVT' => 4, 'SHV' => 5, 'ADR' => 6, 'ADS' => 7, 'NSN' => 8, 'IYR' => 9, 'SVN' => 10, 'TMZ' => 11, 'AAV' => 12, 'ELL' => 13]; /** * Create a date from either: @@ -92,7 +92,7 @@ class JewishDate extends CalendarDate { static $translated_month_names; if ($translated_month_names === null) { - $translated_month_names = array( + $translated_month_names = [ 0 => '', 1 => /* I18N: a month in the Jewish calendar */ I18N::translateContext('NOMINATIVE', 'Tishrei'), 2 => /* I18N: a month in the Jewish calendar */ I18N::translateContext('NOMINATIVE', 'Heshvan'), @@ -108,7 +108,7 @@ class JewishDate extends CalendarDate { 11 => /* I18N: a month in the Jewish calendar */ I18N::translateContext('NOMINATIVE', 'Tamuz'), 12 => /* I18N: a month in the Jewish calendar */ I18N::translateContext('NOMINATIVE', 'Av'), 13 => /* I18N: a month in the Jewish calendar */ I18N::translateContext('NOMINATIVE', 'Elul'), - ); + ]; } if ($month_number === 7 && $leap_year) { @@ -130,7 +130,7 @@ class JewishDate extends CalendarDate { static $translated_month_names; if ($translated_month_names === null) { - $translated_month_names = array( + $translated_month_names = [ 0 => '', 1 => /* I18N: a month in the Jewish calendar */ I18N::translateContext('GENITIVE', 'Tishrei'), 2 => /* I18N: a month in the Jewish calendar */ I18N::translateContext('GENITIVE', 'Heshvan'), @@ -146,7 +146,7 @@ class JewishDate extends CalendarDate { 11 => /* I18N: a month in the Jewish calendar */ I18N::translateContext('GENITIVE', 'Tamuz'), 12 => /* I18N: a month in the Jewish calendar */ I18N::translateContext('GENITIVE', 'Av'), 13 => /* I18N: a month in the Jewish calendar */ I18N::translateContext('GENITIVE', 'Elul'), - ); + ]; } if ($month_number === 7 && $leap_year) { @@ -168,7 +168,7 @@ class JewishDate extends CalendarDate { static $translated_month_names; if ($translated_month_names === null) { - $translated_month_names = array( + $translated_month_names = [ 0 => '', 1 => /* I18N: a month in the Jewish calendar */ I18N::translateContext('LOCATIVE', 'Tishrei'), 2 => /* I18N: a month in the Jewish calendar */ I18N::translateContext('LOCATIVE', 'Heshvan'), @@ -184,7 +184,7 @@ class JewishDate extends CalendarDate { 11 => /* I18N: a month in the Jewish calendar */ I18N::translateContext('LOCATIVE', 'Tamuz'), 12 => /* I18N: a month in the Jewish calendar */ I18N::translateContext('LOCATIVE', 'Av'), 13 => /* I18N: a month in the Jewish calendar */ I18N::translateContext('LOCATIVE', 'Elul'), - ); + ]; } if ($month_number === 7 && $leap_year) { @@ -206,7 +206,7 @@ class JewishDate extends CalendarDate { static $translated_month_names; if ($translated_month_names === null) { - $translated_month_names = array( + $translated_month_names = [ 0 => '', 1 => /* I18N: a month in the Jewish calendar */ I18N::translateContext('INSTRUMENTAL', 'Tishrei'), 2 => /* I18N: a month in the Jewish calendar */ I18N::translateContext('INSTRUMENTAL', 'Heshvan'), @@ -222,7 +222,7 @@ class JewishDate extends CalendarDate { 11 => /* I18N: a month in the Jewish calendar */ I18N::translateContext('INSTRUMENTAL', 'Tamuz'), 12 => /* I18N: a month in the Jewish calendar */ I18N::translateContext('INSTRUMENTAL', 'Av'), 13 => /* I18N: a month in the Jewish calendar */ I18N::translateContext('INSTRUMENTAL', 'Elul'), - ); + ]; } if ($month_number === 7 && $leap_year) { @@ -251,9 +251,9 @@ class JewishDate extends CalendarDate { */ protected function nextMonth() { if ($this->m == 6 && !$this->isLeapYear()) { - return array($this->y, 8); + return [$this->y, 8]; } else { - return array($this->y + ($this->m == 13 ? 1 : 0), ($this->m % 13) + 1); + return [$this->y + ($this->m == 13 ? 1 : 0), ($this->m % 13) + 1]; } } } |
