src/Preference/Matched/MatchedPreferenceComparator.php
public function compare(MatchedPreferenceInterface $lValue, MatchedPreferenceInterface $rValue)
    {
        // Compare by quality factors - highest quality factor has precedence.
        $result = $this->compareQualityFactorPair($lValue, $rValue);

        // Quality factors are equal attempt to sort by match precedence
        if (0 === $result) {
            $result = $this->comparePrecedence($lValue, $rValue);
        }

        // Quality factors & precedences match, simply sort alphabetically as this ensures that the sort is stable
        if (0 === $result) {
            $result = $this->compareVariant($lValue, $rValue);
        }

        return $result;
    }
public function compare(MatchedPreferenceInterface $lValue, MatchedPreferenceInterface $rValue)
    {
        // Compare by quality factors - highest quality factor has precedence.
        $result = $this->compareQualityFactorPair($lValue, $rValue);

        // Quality factors are equal attempt to sort by match precedence
        if (0 === $result) {
            $result = $this->comparePrecedence($lValue, $rValue);
        }

        // Quality factors & precedences match, simply sort alphabetically as this ensures that the sort is stable
        if (0 === $result) {
            $result = $this->compareVariant($lValue, $rValue);
        }

        return $result;
    }
public function compare ( MatchedPreferenceInterface $ lValue , MatchedPreferenceInterface $ rValue ) { // Compare by quality factors - highest quality factor has precedence. $ result = $ this -> compareQualityFactorPair ( $ lValue , $ rValue ) ; // Quality factors are equal attempt to sort by match precedence if ( 0 === $ result ) { $ result = $ this -> comparePrecedence ( $ lValue , $ rValue ) ; } // Quality factors & precedences match, simply sort alphabetically as this ensures that the sort is stable if ( 0 === $ result ) { $ result = $ this -> compareVariant ( $ lValue , $ rValue ) ; } return $ result ; }
Comparison function used for ordering matched preferences.

@param MatchedPreferenceInterface $lValue
@param MatchedPreferenceInterface $rValue

@return int -1, 0, 1 (see usort() callback for meaning)
Comparison function used for ordering matched preferences .