Skip to content

Commit 4d75651

Browse files
committed
Add types to Random class
1 parent a8b8980 commit 4d75651

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

featherbb/Core/Random.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ class Random
1414
//
1515
// Compute a hash of $str
1616
//
17-
public static function hash($str)
17+
public static function hash(string $str): string
1818
{
1919
return sha1($str);
2020
}
2121

2222
//
2323
// Generate a random key of length $len
2424
//
25-
public static function key($len, $readable = false, $hash = false)
25+
public static function key(int $len, bool $readable = false, bool $hash = false): string
2626
{
2727
$key = self::secureRandomBytes($len);
2828

@@ -46,7 +46,7 @@ public static function key($len, $readable = false, $hash = false)
4646
// Generate a random password of length $len
4747
// Compatibility wrapper for random_key
4848
//
49-
public static function pass($len)
49+
public static function pass(int $len): string
5050
{
5151
return self::key($len, true);
5252
}

0 commit comments

Comments
 (0)