public static function sortOnSpecificity(Rule $e1, Rule $e2)
    {
        $e1Specificity = $e1->getSpecificity();
        $value = $e1Specificity->compareTo($e2->getSpecificity());

        // if the specificity is the same, use the order in which the element appeared
        if ($value === 0) {
            $value = $e1->getOrder() - $e2->getOrder();
        }

        return $value;
    }
public static function sortOnSpecificity(Rule $e1, Rule $e2)
    {
        $e1Specificity = $e1->getSpecificity();
        $value = $e1Specificity->compareTo($e2->getSpecificity());

        // if the specificity is the same, use the order in which the element appeared
        if ($value === 0) {
            $value = $e1->getOrder() - $e2->getOrder();
        }

        return $value;
    }
public static function sortOnSpecificity ( Rule $ e1 , Rule $ e2 ) { $ e1Specificity = $ e1 -> getSpecificity ( ) ; $ value = $ e1Specificity -> compareTo ( $ e2 -> getSpecificity ( ) ) ; // if the specificity is the same, use the order in which the element appeared if ( $ value === 0 ) { $ value = $ e1 -> getOrder ( ) - $ e2 -> getOrder ( ) ; } return $ value ; }
Sort an array on the specificity element in an ascending way
Lower specificity will be sorted to the beginning of the array

@return int
@param  Rule $e1 The first element.
@param  Rule $e2 The second element.
Sort an array on the specificity element in an ascending way Lower specificity will be sorted to the beginning of the array