Skip to content

Commit 9fdfd5e

Browse files
authored
Merge pull request #19 from BinarCode/feat/update_php_8_4
fix: Fix americanDate function deprecated for php 8.4
2 parents 15be8ac + 2503f61 commit 9fdfd5e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/helpers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ function telescopeException(Throwable $exception, $message = null): void
6767
}
6868

6969
if (! function_exists('americanDate')) {
70-
function americanDate(CarbonInterface $date = null, string $format = 'm/d/Y', $default = null): string|Closure|null
70+
function americanDate(?CarbonInterface $date = null, string $format = 'm/d/Y', $default = null): string|Closure|null
7171
{
7272
try {
7373
if (is_null($date)) {
7474
if (! is_null($default)) {
7575
return $default;
7676
}
7777

78-
return function (CarbonInterface $value = null) use ($format, $default) {
78+
return function (?CarbonInterface $value = null) use ($format, $default) {
7979
if (is_null($value)) {
8080
return $default;
8181
}

0 commit comments

Comments
 (0)