private function findMatches(array $headerParts, array $priorities) { $matches = []; foreach ($priorities as $index => $p) { foreach ($headerParts as $h) { if (null !== ($match = $this->match($h, $p, $index))) { $matches[] = $match; } } } return $matches; }