From 2b5bc1cdfabd59d70a8cd31e1da915a0b6b90397 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Sun, 21 Jan 2018 17:21:12 +0900 Subject: [PATCH] Fix for empty variable check. (again). Signed-off-by: Sacha Telgenhof --- src/Yasumi/Provider/AbstractProvider.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Yasumi/Provider/AbstractProvider.php b/src/Yasumi/Provider/AbstractProvider.php index 9aa22864e..8f65f010a 100755 --- a/src/Yasumi/Provider/AbstractProvider.php +++ b/src/Yasumi/Provider/AbstractProvider.php @@ -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;