diff --git a/src/Helpers/helper.php b/src/Helpers/helper.php index 85c797ed6150fe686207302bee2d681f6885dc22..bc94607e58231a2bc47e7e04f1758e15987079e8 100644 --- a/src/Helpers/helper.php +++ b/src/Helpers/helper.php @@ -52,7 +52,7 @@ if (! function_exists('toDetailBS')) { $bs_array = NepaliDate::create($date)->toBSArray(); $to_detail_bs = null; - if (!empty($bs_array) && is_array($bs_array)) { + if (! empty($bs_array) && is_array($bs_array)) { $json = json_encode($bs_array); if ($json !== false) { $to_detail_bs = json_decode($json); diff --git a/src/Providers/NepalidateServiceProvider.php b/src/Providers/NepalidateServiceProvider.php index 1c1fcf553f75ce3aafa26aeba24a90a37cae169f..7135dd5655caee2c042feabb08b8af4e226ada8e 100644 --- a/src/Providers/NepalidateServiceProvider.php +++ b/src/Providers/NepalidateServiceProvider.php @@ -13,7 +13,7 @@ class NepalidateServiceProvider extends ServiceProvider */ public function boot() { - // + // } /** diff --git a/src/Services/DateConverter.php b/src/Services/DateConverter.php index 4e91d1fcfdafee60105267923b42c6ab532d5b48..7e45ffd5637f76e490cb7f28fd69d88a77137974 100644 --- a/src/Services/DateConverter.php +++ b/src/Services/DateConverter.php @@ -229,9 +229,9 @@ abstract class DateConverter /** * Check if date range is in english. * - * @param int $yy - * @param int $mm - * @param int $dd + * @param int $yy + * @param int $mm + * @param int $dd */ protected function is_in_range_eng($yy, $mm, $dd) { @@ -251,9 +251,9 @@ abstract class DateConverter /** * Check if date is with in nepali data range. * - * @param int $yy - * @param int $mm - * @param int $dd + * @param int $yy + * @param int $mm + * @param int $dd */ protected function is_in_range_nep($yy, $mm, $dd) { diff --git a/tests/Unit/DateConverterTest.php b/tests/Unit/DateConverterTest.php index f6e646c1eeb25d2765a765d21c99f0838d998c1c..98e4370dec56b0ffc9319882989d420c35b9092e 100644 --- a/tests/Unit/DateConverterTest.php +++ b/tests/Unit/DateConverterTest.php @@ -64,8 +64,8 @@ test('date converter validates english date range correctly', function () { $converter = new DateConverterTestDouble(); // Valid dates should pass should return true - expect(fn() => $converter->isInRangeEng(1944, 1, 1))->not->toBeTrue(); - expect(fn() => $converter->isInRangeEng(2033, 12, 31))->not->toBeTrue(); + expect(fn () => $converter->isInRangeEng(1944, 1, 1))->not->toBeTrue(); + expect(fn () => $converter->isInRangeEng(2033, 12, 31))->not->toBeTrue(); // Invalid dates should return false expect($converter->isInRangeEng(1943, 12, 31))->toBeFalse(); diff --git a/tests/Unit/Doubles/DateConverterTestDouble.php b/tests/Unit/Doubles/DateConverterTestDouble.php index 18f9196624ecc657ca074e3802e40c432e0465f7..38a0be647608b4fb1240a60c637884769dc6e264 100644 --- a/tests/Unit/Doubles/DateConverterTestDouble.php +++ b/tests/Unit/Doubles/DateConverterTestDouble.php @@ -11,6 +11,7 @@ class DateConverterTestDouble extends DateConverter { try { $this->is_in_range_eng($yy, $mm, $dd); + return true; } catch (\Throwable $th) { return false; @@ -21,6 +22,7 @@ class DateConverterTestDouble extends DateConverter { try { $this->is_in_range_nep($yy, $mm, $dd); + return true; } catch (\Throwable $th) { return false;