src/Negotiator/Matcher/ExactMatcher.php
private function getMatchingIndex(array $matchingList, PreferenceInterface $pref)
    {
        $index = -1;

        foreach ($matchingList as $key => $match) {
            if ($match->getVariant() === $pref->getVariant()) {
                $index = $key;
            }
        }

        return $index;
    }
private function getMatchingIndex(array $matchingList, PreferenceInterface $pref)
    {
        $index = -1;

        foreach ($matchingList as $key => $match) {
            if ($match->getVariant() === $pref->getVariant()) {
                $index = $key;
            }
        }

        return $index;
    }
private function getMatchingIndex ( array $ matchingList , PreferenceInterface $ pref ) { $ index = - 1 ; foreach ( $ matchingList as $ key => $ match ) { if ( $ match -> getVariant ( ) === $ pref -> getVariant ( ) ) { $ index = $ key ; } } return $ index ; }
Returns the first index containing a matching variant, or -1 if not present.

@param MatchedPreferenceInterface[] $matchingList
@param PreferenceInterface $pref

@return int
Returns the first index containing a matching variant or - 1 if not present .