Skip to content

Commit f32178e

Browse files
authored
Chore: Cleanup (#6)
1 parent d02965c commit f32178e

File tree

1 file changed

+2
-28
lines changed

1 file changed

+2
-28
lines changed

src/functions.php

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,10 @@
55
require_once __DIR__ . '/StringCombinations.php';
66

77
/**
8-
* @param $charset
9-
* @param int $min
10-
* @param int|null $max
11-
* @param string $glue
8+
* @param string|array $charset
129
* @return StringCombinations
1310
*/
14-
function string_combinations($charset, $min = 1, $max = null, $glue = '')
11+
function string_combinations($charset, int $min = 1, ?int $max = null, string $glue = ''): StringCombinations
1512
{
1613
return new StringCombinations($charset, $min, $max, $glue);
1714
}
18-
19-
/**
20-
* @param $number
21-
* @return float|int
22-
*/
23-
function fact($number)
24-
{
25-
if (extension_loaded('gmp')) {
26-
return gmp_intval(gmp_fact($number));
27-
}
28-
for ($x = $number, $factorial = 1; $x >= 1; $x--) {
29-
$factorial = $factorial * $x;
30-
}
31-
return $factorial;
32-
}
33-
34-
35-
function random_int($min, $max)
36-
{
37-
static $callable;
38-
$callable = function_exists('random_int') ? 'random_int' : 'mt_rand';
39-
return $callable($min, $max);
40-
}

0 commit comments

Comments
 (0)