summaryrefslogtreecommitdiffstats
path: root/lib/private/Security
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-01-13 21:39:34 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2018-01-13 21:39:34 +0100
commitde5d7aa3317c8547e1ad338613896001fe1aabaf (patch)
treea2b207650db961aa1c9b866507e16b35af9e2f71 /lib/private/Security
parent60f38d37fe5ca505258510adc1e106da54426510 (diff)
downloadnextcloud-server-de5d7aa3317c8547e1ad338613896001fe1aabaf.tar.gz
nextcloud-server-de5d7aa3317c8547e1ad338613896001fe1aabaf.zip
Strict ISecure random
* Declare strict * Scalar arguments * Return type * Use fully qualified name for strlen Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Security')
-rw-r--r--lib/private/Security/SecureRandom.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/private/Security/SecureRandom.php b/lib/private/Security/SecureRandom.php
index 5bd909ea002..b5270d08b46 100644
--- a/lib/private/Security/SecureRandom.php
+++ b/lib/private/Security/SecureRandom.php
@@ -21,6 +21,8 @@
*
*/
+declare(strict_types=1);
+
namespace OC\Security;
use OCP\Security\ISecureRandom;
@@ -70,9 +72,9 @@ class SecureRandom implements ISecureRandom {
* specified all valid base64 characters are used.
* @return string
*/
- public function generate($length,
- $characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/') {
- $maxCharIndex = strlen($characters) - 1;
+ public function generate(int $length,
+ string $characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'): string {
+ $maxCharIndex = \strlen($characters) - 1;
$randomString = '';
while($length > 0) {