From e300554905a8b76503892a2fadb359ce7b1791b8 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 10 Jan 2019 14:28:32 +0000 Subject: [PATCH] refactor: remove php7 code --- src/PublicHolidays.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PublicHolidays.php b/src/PublicHolidays.php index 0beb1df..182be9e 100644 --- a/src/PublicHolidays.php +++ b/src/PublicHolidays.php @@ -33,14 +33,14 @@ public static function getDate(Carbon $carbon) return $holiday['date'] === $carbon->format('Y-m-d'); }); - return array_values($filtered)[0] ?? null; + return reset($filtered) ?: null; } /** * @param string $region * @return array */ - public static function region(string $region) + public static function region($region) { return static::all()[$region]['events']; } @@ -48,7 +48,7 @@ public static function region(string $region) /** * @param string $region */ - public static function setRegion(string $region) + public static function setRegion($region) { static::$region = $region; }