Sonata\Component\Delivery\Selector::sort PHP Method

sort() public static method

public static sort ( Sonata\Component\Delivery\ServiceDeliveryInterface $a, Sonata\Component\Delivery\ServiceDeliveryInterface $b ) : integer
$a Sonata\Component\Delivery\ServiceDeliveryInterface
$b Sonata\Component\Delivery\ServiceDeliveryInterface
return integer
    public static function sort(ServiceDeliveryInterface $a, ServiceDeliveryInterface $b)
    {
        if ($a->getPriority() === $b->getPriority()) {
            return 0;
        }
        return $a->getPriority() > $b->getPriority() ? -1 : 1;
    }