original_string: public static function convert($value, $to, $from)
      {
          if ($from instanceof Measure === false || $to instanceof Measure === false) {
              throw new Exception('`from` or `to` parameter is not a Measure');
          }
          if ($from->type !== $to->type) {
              throw new Exception('Measures have different types');
          }
          if ($from->id == $to->id) {
              return $value;
          }
          $converterClass = isset(static::$converters[$to->type]) === true
              ? static::$converters[$to->type]
              : 'DevGroup\Measure\converters\DefaultMeasureTypeConverter';
          return $converterClass::convert($value, $to, $from);
      }
code: public static function convert($value, $to, $from)
      {
          if ($from instanceof Measure === false || $to instanceof Measure === false) {
              throw new Exception('`from` or `to` parameter is not a Measure');
          }
          if ($from->type !== $to->type) {
              throw new Exception('Measures have different types');
          }
          if ($from->id == $to->id) {
              return $value;
          }
          $converterClass = isset(static::$converters[$to->type]) === true
              ? static::$converters[$to->type]
              : 'DevGroup\Measure\converters\DefaultMeasureTypeConverter';
          return $converterClass::convert($value, $to, $from);
      }
code_tokens: public static function convert ( $ value , $ to , $ from ) { if ( $ from instanceof Measure === false || $ to instanceof Measure === false ) { throw new Exception ( '`from` or `to` parameter is not a Measure' ) ; } if ( $ from -> type !== $ to -> type ) { throw new Exception ( 'Measures have different types' ) ; } if ( $ from -> id == $ to -> id ) { return $ value ; } $ converterClass = isset ( static :: $ converters [ $ to -> type ] ) === true ? static :: $ converters [ $ to -> type ] : 'DevGroup\Measure\converters\DefaultMeasureTypeConverter' ; return $ converterClass :: convert ( $ value , $ to , $ from ) ; }
docstring: Convert a value from one measure to another
  @param float $value
  @param Measure $from
  @param Measure $to
  @return float
  @throws Exception
docstring_tokens: Convert a value from one measure to another