コード例 #1
0
ファイル: Dimension.php プロジェクト: poef/ariadne
 /**
  * Compares with another dimension
  *
  * @param ILess_Node $other
  * @return integer
  */
 public function compare(ILess_Node $other)
 {
     if (!$other instanceof ILess_Node_Dimension) {
         return -1;
     }
     $a = $this->unify();
     $b = $other->unify();
     if ($b->value > $a->value) {
         return -1;
     } elseif ($b->value < $a->value) {
         return 1;
     } else {
         if (!$b->unit->isEmpty() && $a->unit->compare($b->unit) !== 0) {
             return -1;
         }
         return 0;
     }
 }