diff --git a/src/ValueObjectBuilder.php b/src/ValueObjectBuilder.php index ef1399e..941c486 100644 --- a/src/ValueObjectBuilder.php +++ b/src/ValueObjectBuilder.php @@ -50,8 +50,9 @@ public function __call(string $name, array $values) sprintf('Invalid property name (%s) for the defined schema!', $propertyName) ); } - $this->data->{$propertyName} = $values[0]; - return $this; + $new = clone $this; + $new->data->{$propertyName} = $values[0]; + return $new; } public function build() : ValueObjectInterface