1 | <?php |
||
10 | class Permutator |
||
11 | { |
||
12 | /** |
||
13 | * @param array<mixed> $set |
||
14 | * @return \Generator & iterable<array> |
||
15 | */ |
||
16 | 142 | public static function getPermutations(array $set): \Generator |
|
24 | |||
25 | /** |
||
26 | * @param array<mixed> $set |
||
27 | * @return array<array> |
||
28 | */ |
||
29 | 142 | private static function getPowerSet(array $set): array |
|
49 | |||
50 | /** |
||
51 | * @param array<mixed> $set |
||
52 | * @param array<array> $permutations |
||
53 | * @return \Generator & iterable<array> |
||
54 | */ |
||
55 | 142 | private static function generateFixedLengthPermutations(array $set, array $permutations = []): \Generator |
|
69 | } |
||
70 |