Skip to content

Commit ff52226

Browse files
authored
Merge pull request #24 from srjlewis/master
Compatability with php 8.4
2 parents af15f88 + 77566b8 commit ff52226

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
}
1111
],
1212
"require": {
13-
"php": ">=7",
14-
"nesbot/carbon": "^2.16|^1.22"
13+
"php": ">=7.1",
14+
"nesbot/carbon": "^2.16|^1.22|^3.0"
1515
},
1616
"autoload": {
1717
"psr-4": {

src/Date.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public function __construct(int $day,
239239
int $month,
240240
int $year,
241241
float $julianDay = 0,
242-
Carbon $date = null,
242+
?Carbon $date = null,
243243
int $adjustment = 0)
244244
{
245245
$this->day = $day;
@@ -330,12 +330,12 @@ public static function setToStringFormat($format)
330330
/**
331331
* get date string
332332
*
333-
* @param string $format
334-
* @param int $numbers
333+
* @param string|null $format
334+
* @param int|null $numbers
335335
*
336336
* @return string
337337
*/
338-
public function format(string $format = null, int $numbers = null)
338+
public function format(?string $format = null, ?int $numbers = null)
339339
{
340340
$numbers = $numbers === null ? static::getDefaultNumbers() : $numbers;
341341
$format = $format === null ? static::getToStringFormat() : $format;

src/Hijri.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Hijri
2828
*
2929
* @return \GeniusTS\HijriDate\Date
3030
*/
31-
public static function convertToHijri($date, int $adjustment = null)
31+
public static function convertToHijri($date, ?int $adjustment = null)
3232
{
3333
if (! $date instanceof Carbon)
3434
{
@@ -48,7 +48,7 @@ public static function convertToHijri($date, int $adjustment = null)
4848
*
4949
* @return \Carbon\Carbon
5050
*/
51-
public static function convertToGregorian(int $day, int $month, int $year, int $adjustment = null)
51+
public static function convertToGregorian(int $day, int $month, int $year, ?int $adjustment = null)
5252
{
5353
return static::toGregorian($day, $month, $year, static::getAdjustment($adjustment));
5454
}
@@ -117,7 +117,7 @@ public static function setDefaultAdjustment(int $adjustment)
117117
*
118118
* @return int
119119
*/
120-
protected static function getAdjustment(int $adjustment = null)
120+
protected static function getAdjustment(?int $adjustment = null)
121121
{
122122
return $adjustment === null ? static::getDefaultAdjustment() : $adjustment;
123123
}

0 commit comments

Comments
 (0)