original_string: public function convert($value, $fromUnit, $toUnit) {
  		$fromUnit = strtoupper($fromUnit);
  		$toUnit = strtoupper($toUnit);
  
  		if (!isset($this->_units[$fromUnit]) || !isset($this->_units[$toUnit])) {
  			throw new CalculatorException('Invalid Unit');
  		}
  
  		if ($fromUnit === static::UNIT_MILES) {
  			$value *= $this->_units[$toUnit];
  		} elseif ($toUnit === static::UNIT_MILES) {
  			$value /= $this->_units[$fromUnit];
  		} else {
  			$value /= $this->_units[$fromUnit];
  			$value *= $this->_units[$toUnit];
  		}
  		return $value;
  	}
code: public function convert($value, $fromUnit, $toUnit) {
  		$fromUnit = strtoupper($fromUnit);
  		$toUnit = strtoupper($toUnit);
  
  		if (!isset($this->_units[$fromUnit]) || !isset($this->_units[$toUnit])) {
  			throw new CalculatorException('Invalid Unit');
  		}
  
  		if ($fromUnit === static::UNIT_MILES) {
  			$value *= $this->_units[$toUnit];
  		} elseif ($toUnit === static::UNIT_MILES) {
  			$value /= $this->_units[$fromUnit];
  		} else {
  			$value /= $this->_units[$fromUnit];
  			$value *= $this->_units[$toUnit];
  		}
  		return $value;
  	}
code_tokens: public function convert ( $ value , $ fromUnit , $ toUnit ) { $ fromUnit = strtoupper ( $ fromUnit ) ; $ toUnit = strtoupper ( $ toUnit ) ; if ( ! isset ( $ this -> _units [ $ fromUnit ] ) || ! isset ( $ this -> _units [ $ toUnit ] ) ) { throw new CalculatorException ( 'Invalid Unit' ) ; } if ( $ fromUnit === static :: UNIT_MILES ) { $ value *= $ this -> _units [ $ toUnit ] ; } elseif ( $ toUnit === static :: UNIT_MILES ) { $ value /= $ this -> _units [ $ fromUnit ] ; } else { $ value /= $ this -> _units [ $ fromUnit ] ; $ value *= $ this -> _units [ $ toUnit ] ; } return $ value ; }
docstring: Convert between units
  
  @param float $value
  @param string $fromUnit (using class constants)
  @param string $toUnit (using class constants)
  @return float convertedValue
  @throws \Exception
docstring_tokens: Convert between units