Skip to content

Commit

Permalink
Fix phpstan fail test
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-wolf-gb committed Feb 12, 2024
1 parent 7685704 commit 80ef304
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Countries/Tunisia.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Spatie\Holidays\Countries;

use Carbon\CarbonImmutable;
use RuntimeException;

class Tunisia extends Country
{
Expand Down Expand Up @@ -388,7 +389,7 @@ protected function getIslamicHolidays(
$currentYearHolidays = is_array($holidays[$year]) ? $holidays[$year] : [$holidays[$year]];

foreach ($currentYearHolidays as $currentYearHoliday) {
$currentYearHoliday = CarbonImmutable::createFromFormat('Y-m-d', "{$year}-{$currentYearHoliday}")
$currentYearHoliday = CarbonImmutable::createFromFormat('Y-m-d', "$year-$currentYearHoliday")

Check failure on line 392 in src/Countries/Tunisia.php

View workflow job for this annotation

GitHub Actions / phpstan

Ternary operator condition is always true.
?: throw new RuntimeException('Date could not be created.');

$islamicHolidays = array_merge($islamicHolidays, $this->prepareHolidays(
Expand Down

0 comments on commit 80ef304

Please sign in to comment.