Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Nielsvanpach authored and github-actions[bot] committed Mar 11, 2024
1 parent 683e399 commit e1df42f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Calendars/IslamicCalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Carbon\CarbonImmutable;
use Carbon\CarbonPeriod;
use RuntimeException;
use Spatie\Holidays\Countries\Country;
use Spatie\Holidays\Exceptions\InvalidYear;

Expand Down Expand Up @@ -50,7 +49,7 @@ protected function getHoliday(array $collection, int $year, int $totalDays): Car

foreach ($dates as $date) {
$start = CarbonImmutable::createFromFormat('Y-m-d', "{$year}-{$date}")->startOfDay();
$end = $start->addDays($totalDays-1)->startOfDay();
$end = $start->addDays($totalDays - 1)->startOfDay();
$periods[] = CarbonPeriod::create($start, '1 day', $end);
}

Expand All @@ -60,7 +59,7 @@ protected function getHoliday(array $collection, int $year, int $totalDays): Car
protected function getOverlapping(array $collection, int $year, $totalDays): ?string
{
try {
$date = $collection[$year-1];
$date = $collection[$year - 1];
} catch (\Exception) {
throw InvalidYear::range($this->countryCode(), 1970, 2037);
}
Expand All @@ -70,7 +69,7 @@ protected function getOverlapping(array $collection, int $year, $totalDays): ?st
}

$start = CarbonImmutable::createFromFormat('Y-m-d', "{$year}-{$date}")->startOfDay();
$end = $start->addDays($totalDays-1)->startOfDay();
$end = $start->addDays($totalDays - 1)->startOfDay();

if ($end->year !== $year) {
return $date;
Expand Down

0 comments on commit e1df42f

Please sign in to comment.