From 7a6c5b0d1b0a19bb90a57a74bb8f1a2d0c60784a Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Thu, 25 Aug 2016 11:13:49 +0900 Subject: [PATCH] Fix code style --- src/PhpSpreadsheet/Shared/Date.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/PhpSpreadsheet/Shared/Date.php b/src/PhpSpreadsheet/Shared/Date.php index f14655d8..8757e50c 100644 --- a/src/PhpSpreadsheet/Shared/Date.php +++ b/src/PhpSpreadsheet/Shared/Date.php @@ -114,9 +114,9 @@ class Date * Set the Default timezone to use for dates * * @param string|\DateTimeZone $timeZone The timezone to set for all Excel datetimestamp to PHP DateTime Object conversions - * @return boolean Success or failure * @throws \Exception * @return bool Success or failure + * @return bool Success or failure */ public static function setDefaultTimezone($timeZone) { @@ -147,9 +147,9 @@ class Date * Validate a timezone * * @param string|\DateTimeZone $timeZone The timezone to validate, either as a timezone string or object - * @return \DateTimeZone The timezone as a timezone object * @throws \Exception * @return \DateTimeZone The timezone as a timezone object + * @return \DateTimeZone The timezone as a timezone object */ protected static function validateTimeZone($timeZone) { @@ -164,7 +164,7 @@ class Date /** * Convert a MS serialized datetime value from Excel to a PHP Date/Time object * - * @param integer|float $excelTimestamp MS Excel serialized date/time value + * @param int|float $excelTimestamp MS Excel serialized date/time value * @param \DateTimeZone|string|null $timeZone The timezone to assume for the Excel timestamp, * if you don't want to treat it as a UTC value * Use the default (UST) unless you absolutely need a conversion @@ -203,7 +203,7 @@ class Date /** * Convert a MS serialized datetime value from Excel to a unix timestamp * - * @param integer|float $excelTimestamp MS Excel serialized date/time value + * @param int|float $excelTimestamp MS Excel serialized date/time value * @param \DateTimeZone|string|null $timeZone The timezone to assume for the Excel timestamp, * if you don't want to treat it as a UTC value * Use the default (UST) unless you absolutely need a conversion @@ -220,7 +220,7 @@ class Date * Convert a date from PHP to an MS Excel serialized date/time value * * @param mixed $dateValue Unix Timestamp or PHP DateTime object or a string - * @return float|boolean Excel date/time value + * @return float|bool Excel date/time value * or boolean FALSE on failure */ public static function PHPToExcel($dateValue = 0) @@ -265,6 +265,7 @@ class Date if (!is_numeric($dateValue)) { return false; } + return self::dateTimeToExcel(new \DateTime('@' . $dateValue)); }