/** * Indicates if this dimension equals the given dimension. * * @param Dimension $that * * @return bool */ public function equals(Dimension $that) { if ($this == $that) { return true; } return $this->unit->equals($that->unit); }
public function to(Unit $unit) { if ($unit == $this->unit || $unit->equals($this->unit)) { return $this; } return self::valueOf($this->unit->getConverterTo($unit)->convert($this->value), $unit); }