From 22b9a3f66f77b17913ab5b4b53e6612d716f44ce Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Sat, 3 Dec 2016 11:35:04 +0900 Subject: [PATCH] Drop PHP version checked according to our new requirement of PHP 5.5 --- src/PhpSpreadsheet/Shared/TimeZone.php | 30 +------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/src/PhpSpreadsheet/Shared/TimeZone.php b/src/PhpSpreadsheet/Shared/TimeZone.php index 0518d051..078cb6ff 100644 --- a/src/PhpSpreadsheet/Shared/TimeZone.php +++ b/src/PhpSpreadsheet/Shared/TimeZone.php @@ -75,30 +75,6 @@ class TimeZone return self::$timezone; } - /** - * Return the Timezone transition for the specified timezone and timestamp - * - * @param DateTimeZone $objTimezone The timezone for finding the transitions - * @param int $timestamp PHP date/time value for finding the current transition - * @return array The current transition details - */ - private static function getTimezoneTransitions($objTimezone, $timestamp) - { - $allTransitions = $objTimezone->getTransitions(); - $transitions = []; - foreach ($allTransitions as $key => $transition) { - if ($transition['ts'] > $timestamp) { - $transitions[] = ($key > 0) ? $allTransitions[$key - 1] : $transition; - break; - } - if (empty($transitions)) { - $transitions[] = end($allTransitions); - } - } - - return $transitions; - } - /** * Return the Timezone offset used for date/time conversions to/from UST * This requires both the timezone and the calculated date/time to allow for local DST @@ -123,11 +99,7 @@ class TimeZone } $objTimezone = new \DateTimeZone($timezone); - if (version_compare(PHP_VERSION, '5.3.0') >= 0) { - $transitions = $objTimezone->getTransitions($timestamp, $timestamp); - } else { - $transitions = self::getTimezoneTransitions($objTimezone, $timestamp); - } + $transitions = $objTimezone->getTransitions($timestamp, $timestamp); return (count($transitions) > 0) ? $transitions[0]['offset'] : 0; }