From dbe65e78c8282721e21c1910392f34732c1184e7 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 4 Jan 2017 15:11:36 +0100 Subject: [PATCH] Change y_change to int --- Datatypes/SmartDateTime.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Datatypes/SmartDateTime.php b/Datatypes/SmartDateTime.php index cdceca19b..815bac57d 100644 --- a/Datatypes/SmartDateTime.php +++ b/Datatypes/SmartDateTime.php @@ -90,7 +90,7 @@ class SmartDateTime extends \DateTime */ public function smartModify(int $y, int $m = 0, int $d = 0, int $calendar = CAL_GREGORIAN) : SmartDateTime { - $y_change = floor(((int) $this->format('m') - 1 + $m) / 12); + $y_change = (int) floor(((int) $this->format('m') - 1 + $m) / 12); $y_change = ((int) $this->format('m') - 1 + $m) < 0 && ((int) $this->format('m') - 1 + $m) % 12 === 0 ? $y_change - 1 : $y_change; $y_new = (int) $this->format('Y') + $y + $y_change; $m_new = ((int) $this->format('m') + $m) % 12;