Skip to content

Commit

Permalink
Type cast to integer as Yasumi::create() requires an integer.
Browse files Browse the repository at this point in the history
Signed-off-by: Sacha Telgenhof <[email protected]>
  • Loading branch information
stelgenhof committed Feb 25, 2018
1 parent 32849c2 commit 2130ab9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Yasumi/Yasumi.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static function nextWorkingDay(
while ($workingDays > 0) {
$date = $date->add(new \DateInterval('P1D'));
if (! $provider || $provider->getYear() !== \getdate()['year']) {
$provider = self::create($class, $date->format('Y'));
$provider = self::create($class, (int)$date->format('Y'));
}
if ($provider->isWorkingDay($date)) {
$workingDays--;
Expand Down Expand Up @@ -288,7 +288,7 @@ public static function prevWorkingDay(
while ($workingDays > 0) {
$date = $date->sub(new \DateInterval('P1D'));
if (! $provider || $provider->getYear() !== \getdate()['year']) {
$provider = self::create($class, $date->format('Y'));
$provider = self::create($class, (int)$date->format('Y'));
}
if ($provider->isWorkingDay($date)) {
$workingDays--;
Expand Down

0 comments on commit 2130ab9

Please sign in to comment.