diff options
author | Sean Molenaar <sean@seanmolenaar.eu> | 2020-10-04 21:33:03 +0200 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2020-10-05 09:47:44 +0200 |
commit | 49c6f7077d558c1e8aa897d1cba2292a8def94d5 (patch) | |
tree | b30bb848395d16e8d6f1f3ad97ed8c0a9b223119 | |
parent | b69e00f96a05e81b3868e1597dd750cead8d1442 (diff) |
Define microtime as string
Closes #835
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
-rw-r--r-- | AUTHORS.md | 2 | ||||
-rw-r--r-- | lib/Utility/Time.php | 4 | ||||
-rw-r--r-- | tests/Unit/Service/ItemServiceTest.php | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/AUTHORS.md b/AUTHORS.md index 80a46dbe8..0d02b0ce3 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -42,6 +42,7 @@ * [b_b](mailto:bruno@eliaz.fr) * [Andreas Fischer](mailto:bantu@owncloud.com) * [David Guillot](mailto:david@guillot.me) +* [Gioele Falcetti](mailto:thegio.f@gmail.com) * [John Kristensen](mailto:john@jerrykan.com) * [Konrad Graefe](mailto:konradgraefe@aol.com) * [Loki3000](mailto:github@labcms.ru) @@ -89,7 +90,6 @@ * [Frank Karlitschek](mailto:frank@owncloud.org) * [Freddo](mailto:f.falk@protonmail.com) * [Freddo3000](mailto:f.falk@protonmail.com) -* [Gioele Falcetti](mailto:thegio.f@gmail.com) * [Hanzei](mailto:Hanzei@users.noreply.github.com) * [Hendrik Leppelsack](mailto:hendrik@leppelsack.de) * [Jasper Knockaert](mailto:jasper@knockaert.nl) diff --git a/lib/Utility/Time.php b/lib/Utility/Time.php index aee1e6358..276a140cd 100644 --- a/lib/Utility/Time.php +++ b/lib/Utility/Time.php @@ -19,9 +19,9 @@ class Time } /** - * @return int the current unix time in miliseconds + * @return string the current unix time in miliseconds */ - public function getMicroTime(): int + public function getMicroTime(): string { list($millisecs, $secs) = explode(" ", microtime()); return $secs . substr($millisecs, 2, 6); diff --git a/tests/Unit/Service/ItemServiceTest.php b/tests/Unit/Service/ItemServiceTest.php index c98ac2c33..98c97b31f 100644 --- a/tests/Unit/Service/ItemServiceTest.php +++ b/tests/Unit/Service/ItemServiceTest.php @@ -62,14 +62,14 @@ class ItemServiceTest extends TestCase private $newestItemId; /** - * @var int + * @var string */ private $time; protected function setUp(): void { - $this->time = 222; + $this->time = '222'; $this->timeFactory = $this->getMockBuilder(Time::class) ->disableOriginalConstructor() ->getMock(); |