From dd7dcbca578826d8c6b08b1b633bb2af2b34113d Mon Sep 17 00:00:00 2001 From: Meezaan-ud-Din A Wal-Ikram Date: Sat, 28 Dec 2024 16:49:45 +0400 Subject: [PATCH] Make compatible with php 8.2 --- src/Models/Astronomical/Calculator.php | 2 +- src/Models/Astronomical/Diyanet.php | 10 +++++----- .../Astronomical/HighJudiciaryCouncilOfSaudiArabia.php | 10 +++++----- src/Models/Astronomical/UmmAlQura.php | 10 +++++----- src/Models/Date/Hijri.php | 2 -- src/Models/Mathematical/Calculator.php | 8 ++++---- 6 files changed, 20 insertions(+), 22 deletions(-) diff --git a/src/Models/Astronomical/Calculator.php b/src/Models/Astronomical/Calculator.php index fb7c78b..635b10c 100644 --- a/src/Models/Astronomical/Calculator.php +++ b/src/Models/Astronomical/Calculator.php @@ -3,11 +3,11 @@ namespace IslamicNetwork\Calendar\Models\Astronomical; use DateTime; +use Exception; use IslamicNetwork\Calendar\Models\Date\Gregorian; use IslamicNetwork\Calendar\Models\Date\Hijri; use IslamicNetwork\Calendar\Models\Date\Julian; use IslamicNetwork\Calendar\Types; -use Exception; class Calculator { diff --git a/src/Models/Astronomical/Diyanet.php b/src/Models/Astronomical/Diyanet.php index 499b00e..57a40ec 100644 --- a/src/Models/Astronomical/Diyanet.php +++ b/src/Models/Astronomical/Diyanet.php @@ -2,15 +2,15 @@ namespace IslamicNetwork\Calendar\Models\Astronomical; -use IslamicNetwork\Calendar\Data\Astronomical; use DateTime; +use IslamicNetwork\Calendar\Data\Astronomical; class Diyanet extends Calculator { - public const string ID = 'DIYANET'; - public const string NAME = 'Diyanet İşleri Başkanlığı'; - public const string DESCRIPTION = 'The Islamic Calendar of Tukey based on astronomical data provided by Turkish Presidency of Religious Affairs (Diyanet İşleri Başkanlığı.'; - public const string VALIDITY_PERIOD = '1 Muharram 1318 AH (1 May 1900) to 29 Şaban 1449 AH (26 January 2028)'; + public const ID = 'DIYANET'; + public const NAME = 'Diyanet İşleri Başkanlığı'; + public const DESCRIPTION = 'The Islamic Calendar of Tukey based on astronomical data provided by Turkish Presidency of Religious Affairs (Diyanet İşleri Başkanlığı.'; + public const VALIDITY_PERIOD = '1 Muharram 1318 AH (1 May 1900) to 29 Şaban 1449 AH (26 January 2028)'; public function __construct() { $this->validGregorianFrom = DateTime::createFromFormat('d-m-Y', '01-05-1900'); diff --git a/src/Models/Astronomical/HighJudiciaryCouncilOfSaudiArabia.php b/src/Models/Astronomical/HighJudiciaryCouncilOfSaudiArabia.php index 904ff80..3fa257a 100644 --- a/src/Models/Astronomical/HighJudiciaryCouncilOfSaudiArabia.php +++ b/src/Models/Astronomical/HighJudiciaryCouncilOfSaudiArabia.php @@ -2,20 +2,20 @@ namespace IslamicNetwork\Calendar\Models\Astronomical; +use DateTime; use IslamicNetwork\Calendar\Data\Astronomical; use IslamicNetwork\Calendar\Helpers\Date; use IslamicNetwork\Calendar\Models\Date\Gregorian; use IslamicNetwork\Calendar\Models\Date\Hijri; use IslamicNetwork\Calendar\Models\Date\Julian; use IslamicNetwork\Calendar\Types; -use DateTime; class HighJudiciaryCouncilOfSaudiArabia extends Calculator { - public const string ID = 'HJCoSA'; - public const string NAME = 'Majlis al-Qadāʾ al-Aʿlā (High Judiciary Council of Saudi Arabia)'; - public const string DESCRIPTION = 'This calendar is based on the Umm al-Qura calendar, but the dates for the months of Muḥarram, Ramaḍān, Shawwāl and Dhu ʾl-Ḥijja are adjusted after reported sightings of the lunar crescent announced by the Majlis al-Qadāʾ al-Aʿlā (High Judiciary Council of Saudi Arabia). Please also see https://webspace.science.uu.nl/~gent0113/islam/ummalqura_adjust.htm for more details.'; - public const string VALIDITY_PERIOD = '1356 AH (14 March 1937 CE) to 1500 AH (16 November 2077 CE)'; + public const ID = 'HJCoSA'; + public const NAME = 'Majlis al-Qadāʾ al-Aʿlā (High Judiciary Council of Saudi Arabia)'; + public const DESCRIPTION = 'This calendar is based on the Umm al-Qura calendar, but the dates for the months of Muḥarram, Ramaḍān, Shawwāl and Dhu ʾl-Ḥijja are adjusted after reported sightings of the lunar crescent announced by the Majlis al-Qadāʾ al-Aʿlā (High Judiciary Council of Saudi Arabia). Please also see https://webspace.science.uu.nl/~gent0113/islam/ummalqura_adjust.htm for more details.'; + public const VALIDITY_PERIOD = '1356 AH (14 March 1937 CE) to 1500 AH (16 November 2077 CE)'; public array $adjustments = [ // Gregorian => Announced Hijri Date. All days in dd-mm-yyyy diff --git a/src/Models/Astronomical/UmmAlQura.php b/src/Models/Astronomical/UmmAlQura.php index b78b018..feba5af 100644 --- a/src/Models/Astronomical/UmmAlQura.php +++ b/src/Models/Astronomical/UmmAlQura.php @@ -2,15 +2,15 @@ namespace IslamicNetwork\Calendar\Models\Astronomical; -use IslamicNetwork\Calendar\Data\Astronomical; use DateTime; +use IslamicNetwork\Calendar\Data\Astronomical; class UmmAlQura extends Calculator { - public const string ID = 'UAQ'; - public const string NAME = 'Umm al-Qura'; - public const string DESCRIPTION = 'The Umm Al-Qura Calender based on astronomical data provided by the Umm al-Qura University in Makkah, Saudi Arabia. Strictly speaking, this calendar is intended for civil purposes only. Please keep in mind that the first visual sighting of the lunar crescent (hilāl) can occur up to two days after the date predicted by the Umm al-Qura calendar.'; - public const string VALIDITY_PERIOD = '1356 AH (14 March 1937 CE) to 1500 AH (16 November 2077 CE)'; + public const ID = 'UAQ'; + public const NAME = 'Umm al-Qura'; + public const DESCRIPTION = 'The Umm Al-Qura Calender based on astronomical data provided by the Umm al-Qura University in Makkah, Saudi Arabia. Strictly speaking, this calendar is intended for civil purposes only. Please keep in mind that the first visual sighting of the lunar crescent (hilāl) can occur up to two days after the date predicted by the Umm al-Qura calendar.'; + public const VALIDITY_PERIOD = '1356 AH (14 March 1937 CE) to 1500 AH (16 November 2077 CE)'; public function __construct() { diff --git a/src/Models/Date/Hijri.php b/src/Models/Date/Hijri.php index c7d1caf..af0fcf9 100644 --- a/src/Models/Date/Hijri.php +++ b/src/Models/Date/Hijri.php @@ -2,8 +2,6 @@ namespace IslamicNetwork\Calendar\Models\Date; -use IslamicNetwork\Calendar\Helpers; - class Hijri { /** diff --git a/src/Models/Mathematical/Calculator.php b/src/Models/Mathematical/Calculator.php index 5b5598c..4493832 100644 --- a/src/Models/Mathematical/Calculator.php +++ b/src/Models/Mathematical/Calculator.php @@ -10,15 +10,15 @@ class Calculator { - public const string ID = 'MATHEMATICAL'; + public const ID = 'MATHEMATICAL'; - public const string NAME = 'Mathematical calculator based on a calculation written by Layth A. Ibraheem'; + public const NAME = 'Mathematical calculator based on a calculation written by Layth A. Ibraheem'; - public const string DESCRIPTION = 'This has been the default calendar used by the AlAdhan API until January 2025. It is purely mathematical does not + public const DESCRIPTION = 'This has been the default calendar used by the AlAdhan API until January 2025. It is purely mathematical does not keep track of the number of days in a month, so adjusting it to match the actual hilaal sightings is not possible. It still works if you are happy wth some inconsistencies, but is no longer the default calendar. This calendar allows for adjustments.'; - public const string VALIDITY_PERIOD = 'No restrictions'; + public const VALIDITY_PERIOD = 'No restrictions'; /** * Get Hijri Date from Gregorian Date