| Conditions | 6 |
| Paths | 7 |
| Total Lines | 22 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 22 | 356 | public static function partialIntersection(bool $strict, int $m, iterable ...$sets): \Generator |
|
| 23 | { |
||
| 24 | 356 | $iterator = new JustifyMultipleIterator(...$sets); |
|
| 25 | |||
| 26 | 356 | $usageMap = []; |
|
| 27 | |||
| 28 | 356 | foreach ($iterator as $values) { |
|
| 29 | 300 | foreach ($values as $value) { |
|
| 30 | 300 | if ($value instanceof NoValueMonad) { |
|
| 31 | 113 | continue; |
|
| 32 | } |
||
| 33 | |||
| 34 | 300 | $hash = UniqueExtractor::getString($value, $strict); |
|
| 35 | |||
| 36 | 300 | if (!isset($usageMap[$hash])) { |
|
| 37 | 300 | $usageMap[$hash] = 0; |
|
| 38 | } |
||
| 39 | |||
| 40 | 300 | $usageMap[$hash]++; |
|
| 41 | |||
| 42 | 300 | if ($usageMap[$hash] === $m) { |
|
| 43 | 190 | yield $value; |
|
| 44 | } |
||
| 49 |