0012540: upgrade to PHP 7.1.x (Tinebase_DateTime)
authorPhilipp Schüle <p.schuele@metaways.de>
Fri, 20 Jan 2017 11:05:59 +0000 (12:05 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Tue, 31 Jan 2017 16:00:09 +0000 (17:00 +0100)
https://forge.tine20.org/view.php?id=12540

Change-Id: Ia73fc0e88d34099e3af7fc39a5f46e4608d62b66
Reviewed-on: http://gerrit.tine20.com/customers/4155
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/DateTime.php

index 7ea4909..a340740 100644 (file)
@@ -430,10 +430,15 @@ class Tinebase_DateTime extends DateTime
      * (non-PHPdoc)
      * @see DateTime::setTime()
      * @note PHP 5.3.0 changed the return value on success from NULL to DateTime.
+     * @note PHP 7.1 added param $microseconds
      */
-    public function setTime($hour, $minute, $second = 0)
+    public function setTime($hour, $minute, $second = 0, $microseconds = null)
     {
-        parent::setTime($hour, $minute, $second);
+        if (PHP_VERSION_ID < 70100) {
+            parent::setTime($hour, $minute, $second);
+        } else {
+            parent::setTime($hour, $minute, $second, $microseconds);
+        }
         return $this;
     }