| Conditions | 5 |
| Paths | 5 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 5 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 22 | 378 | public static function partialIntersection(bool $strict, int $m, iterable ...$multisets): \Generator |
|
| 23 | { |
||
| 24 | 378 | $usageMap = new UsageMap($strict); |
|
| 25 | |||
| 26 | 378 | $multipleIterator = new JustifyMultipleIterator(...$multisets); |
|
| 27 | |||
| 28 | 378 | foreach ($multipleIterator as $index => $values) { |
|
| 29 | 322 | foreach ($values as $owner => $value) { |
|
| 30 | 322 | if ($value instanceof NoValueMonad) { |
|
| 31 | 125 | continue; |
|
| 32 | } |
||
| 33 | |||
| 34 | 322 | $usageMap->addUsage($value, (string)$owner); |
|
| 35 | |||
| 36 | 322 | if ($usageMap->getOwnersCount($value) === $m) { |
|
| 37 | 210 | yield $value; |
|
| 38 | 210 | $usageMap->deleteUsage($value); |
|
| 39 | } |
||
| 44 |