Skip to content

Instantly share code, notes, and snippets.

Last active Jun 27, 2021
What would you like to do?
private function removeDuplicates(array $patternsWithPossibleDuplicates): array {
return array_intersect_key(
array_map("strtolower", $patternsWithPossibleDuplicates)));
function simplify(array $patterns): array {
$patternsWithoutDuplicates = $this->removeDuplicates($patterns);
return array_values(array_filter($patternsWithoutDuplicates,
fn ($outerPattern) => $this->alreadyIncludesPattern($patternsWithoutDuplicates, $outerPattern)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment