Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Helpers/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function toDetailBS(Carbon $date)
$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);
Expand Down
2 changes: 1 addition & 1 deletion src/Providers/NepalidateServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class NepalidateServiceProvider extends ServiceProvider
*/
public function boot()
{
//
//
}

/**
Expand Down
12 changes: 6 additions & 6 deletions src/Services/DateConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ public function formattedNepaliNumber($value)
/**
* 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)
{
Expand All @@ -251,9 +251,9 @@ protected function is_in_range_eng($yy, $mm, $dd)
/**
* 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)
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/DateConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
$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();
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Doubles/DateConverterTestDouble.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public function isInRangeEng($yy, $mm, $dd): bool
{
try {
$this->is_in_range_eng($yy, $mm, $dd);

return true;
} catch (\Throwable $th) {
return false;
Expand All @@ -21,6 +22,7 @@ public function isInRangeNep($yy, $mm, $dd): bool
{
try {
$this->is_in_range_nep($yy, $mm, $dd);

return true;
} catch (\Throwable $th) {
return false;
Expand Down