diff --git a/apps/federatedfilesharing/tests/TokenHandlerTest.php b/apps/federatedfilesharing/tests/TokenHandlerTest.php
index aca6c3d26c1560000e2569d5cd78d886094aa81e..d6f3f8fe5da2fd38b7c0b7a05230f3b6f2c6b634 100644
--- a/apps/federatedfilesharing/tests/TokenHandlerTest.php
+++ b/apps/federatedfilesharing/tests/TokenHandlerTest.php
@@ -55,9 +55,9 @@ class TokenHandlerTest extends \Test\TestCase {
 				$this->expectedTokenLength,
 				ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS
 			)
-			->willReturn(true);
+			->willReturn('mytoken');
 
-		$this->assertTrue($this->tokenHandler->generateToken());
+		$this->assertSame('mytoken', $this->tokenHandler->generateToken());
 
 	}
 
diff --git a/lib/private/Security/SecureRandom.php b/lib/private/Security/SecureRandom.php
index b5270d08b4698b619891fe76776550ad819c172d..75d9d02a1d342b6405f2cd7178213519727a16f3 100644
--- a/lib/private/Security/SecureRandom.php
+++ b/lib/private/Security/SecureRandom.php
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 /**
  * @copyright Copyright (c) 2016, ownCloud, Inc.
  *
@@ -21,8 +22,6 @@
  *
  */
 
-declare(strict_types=1);
-
 namespace OC\Security;
 
 use OCP\Security\ISecureRandom;
diff --git a/lib/public/Security/ISecureRandom.php b/lib/public/Security/ISecureRandom.php
index 14976831a1ab73202702dd4ed050c0e16baae1be..235b3033c449ece1cfba4c9e7262165790f6d438 100644
--- a/lib/public/Security/ISecureRandom.php
+++ b/lib/public/Security/ISecureRandom.php
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 /**
  * @copyright Copyright (c) 2016, ownCloud, Inc.
  *
@@ -23,8 +24,6 @@
  *
  */
 
-declare(strict_types=1);
-
 namespace OCP\Security;
 
 /**