From ae1b85f9618a8efa48ab34fd9470f3387a660d68 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Sun, 2 Oct 2016 15:21:52 +0900 Subject: [PATCH] Fix code style --- src/PhpSpreadsheet/Calculation/DateTime.php | 6 +++--- tests/data/Calculation/DateTime/DATEDIF.php | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/PhpSpreadsheet/Calculation/DateTime.php b/src/PhpSpreadsheet/Calculation/DateTime.php index 5d9614a1..cb2b5ab2 100644 --- a/src/PhpSpreadsheet/Calculation/DateTime.php +++ b/src/PhpSpreadsheet/Calculation/DateTime.php @@ -740,13 +740,13 @@ class DateTime $PHPEndDateObject->modify('+1 year'); // Get the result - $retVal = $PHPEndDateObject->diff($PHPStartDateObject)->days; + $retVal = $PHPEndDateObject->diff($PHPStartDateObject)->days; // Adjust for leap years cases $isLeapEndYear = $PHPEndDateObject->format('L'); $limit = new \DateTime($PHPEndDateObject->format('Y-02-29')); - if (!$isLeapStartYear && !$wasLeapEndYear && $isLeapEndYear && $PHPEndDateObject >= $limit ) { - $retVal--; + if (!$isLeapStartYear && !$wasLeapEndYear && $isLeapEndYear && $PHPEndDateObject >= $limit) { + --$retVal; } } break; diff --git a/tests/data/Calculation/DateTime/DATEDIF.php b/tests/data/Calculation/DateTime/DATEDIF.php index e8776c0f..4e2288c6 100644 --- a/tests/data/Calculation/DateTime/DATEDIF.php +++ b/tests/data/Calculation/DateTime/DATEDIF.php @@ -5,31 +5,31 @@ return [ '2016-01-01', '2016-12-31', 'YD', - 365 + 365, ], [ '2015-01-01', '2015-12-31', 'YD', - 364 + 364, ], [ '2015-01-01', '2016-12-31', 'YD', - 364 + 364, ], [ '2016-01-01', '2017-12-31', 'YD', - 365 + 365, ], [ '2017-01-01', '2018-12-31', 'YD', - 364 + 364, ], [ 'ABC',