Skip to content

Commit

Permalink
Fix for empty variable check. (again).
Browse files Browse the repository at this point in the history
Signed-off-by: Sacha Telgenhof <[email protected]>
  • Loading branch information
stelgenhof committed Jan 21, 2018
1 parent 6bcfbda commit 2b5bc1c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Yasumi/Provider/AbstractProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ public function isWorkingDay($date)
// If no data is defined for this Holiday Provider, the function falls back to the global weekend definition.
// @TODO Ideally avoid late static binding here (static::ID)
if ($date instanceof DateTime) {
$weekend_days = !empty(self::WEEKEND_DATA[static::ID]) ? self::WEEKEND_DATA[static::ID] : [0, 6];
$weekend_data = self::WEEKEND_DATA;
$weekend_days = isset($weekend_data[$this::ID]) ? $weekend_data[$this::ID] : [0, 6];

if (in_array((int)$date->format('w'), $weekend_days, true)) {
return false;
Expand Down

0 comments on commit 2b5bc1c

Please sign in to comment.