diff --git a/src/DataValues/QuantityValue.php b/src/DataValues/QuantityValue.php index 9670d5b..cfe80a9 100644 --- a/src/DataValues/QuantityValue.php +++ b/src/DataValues/QuantityValue.php @@ -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. diff --git a/src/ValueParsers/QuantityParser.php b/src/ValueParsers/QuantityParser.php index 46583f2..ec2a3c6 100644 --- a/src/ValueParsers/QuantityParser.php +++ b/src/ValueParsers/QuantityParser.php @@ -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 ); } /**