Should RecordTransformer::transform() return a new Record?
#76 (closed) is introducing the RecordTransformer
concept, with one public method
public function transform(Record $sourceData, Record $resultData) : void;
The $resultData
record is updated based on its existing contents and the contents of $sourceData
. Of course, side-effects are problematic - ideally we would return a new Record with the updated contents without touching $resultData
, but it seems expensive to create a new instance for each invocation of transform()
. Should we leave it as-is, add a clone
of $resultData
to be returned, or is there another solution?