Skip to content

Commit

Permalink
Merge pull request #24 from srjlewis/master
Browse files Browse the repository at this point in the history
Compatability with php 8.4
  • Loading branch information
aboudeh87 authored Nov 5, 2024
2 parents af15f88 + 77566b8 commit ff52226
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
}
],
"require": {
"php": ">=7",
"nesbot/carbon": "^2.16|^1.22"
"php": ">=7.1",
"nesbot/carbon": "^2.16|^1.22|^3.0"
},
"autoload": {
"psr-4": {
Expand Down
8 changes: 4 additions & 4 deletions src/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public function __construct(int $day,
int $month,
int $year,
float $julianDay = 0,
Carbon $date = null,
?Carbon $date = null,
int $adjustment = 0)
{
$this->day = $day;
Expand Down Expand Up @@ -330,12 +330,12 @@ public static function setToStringFormat($format)
/**
* get date string
*
* @param string $format
* @param int $numbers
* @param string|null $format
* @param int|null $numbers
*
* @return string
*/
public function format(string $format = null, int $numbers = null)
public function format(?string $format = null, ?int $numbers = null)
{
$numbers = $numbers === null ? static::getDefaultNumbers() : $numbers;
$format = $format === null ? static::getToStringFormat() : $format;
Expand Down
6 changes: 3 additions & 3 deletions src/Hijri.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Hijri
*
* @return \GeniusTS\HijriDate\Date
*/
public static function convertToHijri($date, int $adjustment = null)
public static function convertToHijri($date, ?int $adjustment = null)
{
if (! $date instanceof Carbon)
{
Expand All @@ -48,7 +48,7 @@ public static function convertToHijri($date, int $adjustment = null)
*
* @return \Carbon\Carbon
*/
public static function convertToGregorian(int $day, int $month, int $year, int $adjustment = null)
public static function convertToGregorian(int $day, int $month, int $year, ?int $adjustment = null)
{
return static::toGregorian($day, $month, $year, static::getAdjustment($adjustment));
}
Expand Down Expand Up @@ -117,7 +117,7 @@ public static function setDefaultAdjustment(int $adjustment)
*
* @return int
*/
protected static function getAdjustment(int $adjustment = null)
protected static function getAdjustment(?int $adjustment = null)
{
return $adjustment === null ? static::getDefaultAdjustment() : $adjustment;
}
Expand Down

0 comments on commit ff52226

Please sign in to comment.