Skip to content

Commit 9b54dd9

Browse files
committed
Replace catch (Throwable) with catch (Throwable $throwable)
1 parent 2418e18 commit 9b54dd9

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"calendar", "datetime convert", "jalali", "shamsi", "gregorian", "gregorian to jalali", "jalali to gregorian"
77
],
88
"type": "library",
9-
"version": "0.3.0",
109
"homepage": "https://github.com/nabeghe/dati-php",
1110
"license": "MIT",
1211
"autoload": {

src/Dati.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public static function diffDetails($datetime1, $datetime2)
161161
$diff = $dt1->diff($dt2);
162162
$details = array_intersect_key((array) $diff, array_flip(['y', 'm', 'd', 'h', 'i', 's']));
163163
return $details;
164-
} catch (Throwable $throwable) {
164+
} catch (Throwable $e) {
165165
}
166166

167167
return null;
@@ -221,7 +221,7 @@ public static function fromJalali($datetime, $format = null, $timezone = null)
221221
$shamsi_timestamp = $formatter->parse($datetime);
222222
$formatter->setCalendar(IntlDateFormatter::GREGORIAN);
223223
return $formatter->format($shamsi_timestamp) ?: null;
224-
} catch (Throwable) {
224+
} catch (Throwable $throwable) {
225225
}
226226

227227
return null;
@@ -433,7 +433,7 @@ public static function toJalali($datetime, $format = null, $timezone = null)
433433
);
434434

435435
return $formatter->format($datetime_obj) ?: null;
436-
} catch (Throwable) {
436+
} catch (Throwable $e) {
437437
}
438438

439439
return null;

0 commit comments

Comments
 (0)