src/Preference/Matched/MatchedPreferenceComparator.php
private function compareQualityFactorPair(
        MatchedPreferenceInterface $lValue,
        MatchedPreferenceInterface $rValue
    ) {
        // Build a list of quality factor comparisons to perform; highest preference given to quality factor products,
        // followed by those provided by the client & finally the server provided.
        $compareList = array(
            array(
                'left' => $lValue,
                'right' => $rValue
            ),
            array(
                'left' => $lValue->getClientPreference(),
                'right' => $rValue->getClientPreference()
            ),
            array(
                'left' => $lValue->getServerPreference(),
                'right' => $rValue->getServerPreference()
            )
        );

        $result = 0;
        foreach ($compareList as $compare) {
            $result = $this->compareQualityFactor($compare['left'], $compare['right']);

            // If a non matching result was found then we have the result of our comparison
            if (0 !== $result) {
                break;
            }
        }

        return $result;
    }
private function compareQualityFactorPair(
        MatchedPreferenceInterface $lValue,
        MatchedPreferenceInterface $rValue
    ) {
        // Build a list of quality factor comparisons to perform; highest preference given to quality factor products,
        // followed by those provided by the client & finally the server provided.
        $compareList = array(
            array(
                'left' => $lValue,
                'right' => $rValue
            ),
            array(
                'left' => $lValue->getClientPreference(),
                'right' => $rValue->getClientPreference()
            ),
            array(
                'left' => $lValue->getServerPreference(),
                'right' => $rValue->getServerPreference()
            )
        );

        $result = 0;
        foreach ($compareList as $compare) {
            $result = $this->compareQualityFactor($compare['left'], $compare['right']);

            // If a non matching result was found then we have the result of our comparison
            if (0 !== $result) {
                break;
            }
        }

        return $result;
    }
private function compareQualityFactorPair ( MatchedPreferenceInterface $ lValue , MatchedPreferenceInterface $ rValue ) { // Build a list of quality factor comparisons to perform; highest preference given to quality factor products, // followed by those provided by the client & finally the server provided. $ compareList = array ( array ( 'left' => $ lValue , 'right' => $ rValue ) , array ( 'left' => $ lValue -> getClientPreference ( ) , 'right' => $ rValue -> getClientPreference ( ) ) , array ( 'left' => $ lValue -> getServerPreference ( ) , 'right' => $ rValue -> getServerPreference ( ) ) ) ; $ result = 0 ; foreach ( $ compareList as $ compare ) { $ result = $ this -> compareQualityFactor ( $ compare [ 'left' ] , $ compare [ 'right' ] ) ; // If a non matching result was found then we have the result of our comparison if ( 0 !== $ result ) { break ; } } return $ result ; }
Comparison function for quality factors of matched preferences.

@param MatchedPreferenceInterface $lValue
@param MatchedPreferenceInterface $rValue

@return int -1, 0, 1 (see usort() callback for meaning)
Comparison function for quality factors of matched preferences .