From 7faae589c3713b7020b89e5a5df5548716508388 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 26 Jan 2017 12:06:54 +0100 Subject: [PATCH] Fixing strict types --- DataStorage/Cache/CacheFactory.php | 2 +- Datatypes/SmartDateTime.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DataStorage/Cache/CacheFactory.php b/DataStorage/Cache/CacheFactory.php index 9985bf002..2f59baf78 100644 --- a/DataStorage/Cache/CacheFactory.php +++ b/DataStorage/Cache/CacheFactory.php @@ -63,7 +63,7 @@ class CacheFactory { switch ($cacheData['type']) { case 'file': - return new FileCache($cacheData); + return new FileCache($cacheData['path']); break; default: throw new \InvalidArgumentException('Cache "' . $cacheData['type'] . '" is not supported.'); diff --git a/Datatypes/SmartDateTime.php b/Datatypes/SmartDateTime.php index 7e6d54701..d2c17b72f 100644 --- a/Datatypes/SmartDateTime.php +++ b/Datatypes/SmartDateTime.php @@ -138,7 +138,7 @@ class SmartDateTime extends \DateTime */ public function getDaysOfMonth() : int { - return cal_days_in_month(CAL_GREGORIAN, $this->format('m'), $this->format('Y')); + return cal_days_in_month(CAL_GREGORIAN, (int) $this->format('m'), (int) $this->format('Y')); } /** @@ -151,7 +151,7 @@ class SmartDateTime extends \DateTime */ public function getFirstDayOfMonth() : int { - return getdate(mktime(null, null, null, $this->format('m'), 1, $this->format('Y')))['wday']; + return getdate(mktime(null, null, null, (int) $this->format('m'), 1, (int) $this->format('Y')))['wday']; } }