/** * @param string|null $wantedUnit * @return Speed */ public function getSpeed($wantedUnit = null) { return $this->speedTable->toSpeed($this, $wantedUnit); }
/** * @return SpeedBonus */ public function getBonus() { return $this->speedTable->toBonus($this); }
/** * @test * @expectedException \OutOfRangeException */ public function I_can_not_convert_too_high_value_to_bonus() { $speedTable = new SpeedTable(); $speedTable->toBonus(new Speed(32001, Speed::KM_PER_HOUR, $speedTable)); }