Change Reference to Value (252)
Inverse of Change Value to Reference (256)
Old Code
<?php
class Product {
public function applyDiscount($arg)
{
$this->price->amount -= $arg;
}
}
New Code
<?php
class Product {
public function applyDiscount($arg)
{
$this->price = new Money($this->price->amount - $arg, $this->price->currency);
}
}