Skip to content

Commit

Permalink
Merge pull request #75 from DataValues/deadCode
Browse files Browse the repository at this point in the history
Drop dead code from quantity classes
  • Loading branch information
Daniel Kinzler committed Jul 12, 2016
2 parents a0bcd3c + 40d3d67 commit 55be9db
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
6 changes: 0 additions & 6 deletions src/DataValues/QuantityValue.php
Expand Up @@ -410,12 +410,6 @@ public function transform( $newUnit, $transformation ) {
throw new InvalidArgumentException( '$newUnit must not be empty. Use "1" as the unit for unit-less quantities.' );
}

$oldUnit = $this->unit;

if ( $newUnit === null ) {
$newUnit = $oldUnit;
}

// Apply transformation by calling the $transform callback.
// The first argument for the callback is the DataValue to transform. In addition,
// any extra arguments given for transform() are passed through.
Expand Down
5 changes: 1 addition & 4 deletions src/ValueParsers/QuantityParser.php
Expand Up @@ -188,10 +188,7 @@ private function splitQuantityString( $value ) {
* @return QuantityValue
*/
private function newExactQuantity( DecimalValue $amount, $unit = '1' ) {
$lowerBound = $amount;
$upperBound = $amount;

return new QuantityValue( $amount, $unit, $upperBound, $lowerBound );
return new QuantityValue( $amount, $unit, $amount, $amount );
}

/**
Expand Down

0 comments on commit 55be9db

Please sign in to comment.