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']; } }