1
1
<?php
2
+
2
3
declare (strict_types=1 );
3
4
4
5
namespace Blibio \Combinatorics ;
5
6
6
- use InvalidArgumentException ;
7
-
8
7
final readonly class Combinatorics
9
8
{
10
9
/**
11
10
* @template U
11
+ *
12
12
* @param array<array-key, U> $elements
13
- * @param int<1, max> $k
13
+ * @param int<1, max> $k
14
+ *
14
15
* @return Combination\WithRepetition<U>
15
16
*
16
- * @throws InvalidArgumentException
17
+ * @throws \ InvalidArgumentException
17
18
*/
18
19
public static function combinationsWithRepetition (array $ elements , int $ k ): Combination \WithRepetition
19
20
{
@@ -22,11 +23,13 @@ public static function combinationsWithRepetition(array $elements, int $k): Comb
22
23
23
24
/**
24
25
* @template U
26
+ *
25
27
* @param array<array-key, U> $elements
26
- * @param int<1, max> $k
28
+ * @param int<1, max> $k
29
+ *
27
30
* @return Combination\WithoutRepetition<U>
28
31
*
29
- * @throws InvalidArgumentException
32
+ * @throws \ InvalidArgumentException
30
33
*/
31
34
public static function combinationsWithoutRepetition (array $ elements , int $ k ): Combination \WithoutRepetition
32
35
{
@@ -35,11 +38,13 @@ public static function combinationsWithoutRepetition(array $elements, int $k): C
35
38
36
39
/**
37
40
* @template U
41
+ *
38
42
* @param array<array-key, U> $elements
39
- * @param int<1, max> $k
43
+ * @param int<1, max> $k
44
+ *
40
45
* @return Permutation\WithRepetition<U>
41
46
*
42
- * @throws InvalidArgumentException
47
+ * @throws \ InvalidArgumentException
43
48
*/
44
49
public static function permutationsWithRepetition (array $ elements , int $ k ): Permutation \WithRepetition
45
50
{
@@ -48,11 +53,13 @@ public static function permutationsWithRepetition(array $elements, int $k): Perm
48
53
49
54
/**
50
55
* @template U
56
+ *
51
57
* @param array<array-key, U> $elements
52
- * @param int<1, max> $k
58
+ * @param int<1, max> $k
59
+ *
53
60
* @return Permutation\WithoutRepetition<U>
54
61
*
55
- * @throws InvalidArgumentException
62
+ * @throws \ InvalidArgumentException
56
63
*/
57
64
public static function permutationsWithoutRepetition (array $ elements , int $ k ): Permutation \WithoutRepetition
58
65
{
0 commit comments