Skip to content

Commit

Permalink
Make compatible with php 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
meezaan committed Dec 28, 2024
1 parent 8349873 commit dd7dcbc
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/Models/Astronomical/Calculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
10 changes: 5 additions & 5 deletions src/Models/Astronomical/Diyanet.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
10 changes: 5 additions & 5 deletions src/Models/Astronomical/HighJudiciaryCouncilOfSaudiArabia.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/Models/Astronomical/UmmAlQura.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
2 changes: 0 additions & 2 deletions src/Models/Date/Hijri.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace IslamicNetwork\Calendar\Models\Date;

use IslamicNetwork\Calendar\Helpers;

class Hijri
{
/**
Expand Down
8 changes: 4 additions & 4 deletions src/Models/Mathematical/Calculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dd7dcbc

Please sign in to comment.