@@ -145,23 +145,23 @@ public function withWorkflowId(string $workflowId): self
145145 $ workflowId !== '' or throw new \InvalidArgumentException ('Workflow ID cannot be empty. ' );
146146
147147 /** @see self::$workflowId */
148- return $ this ->with ('workflowId ' , $ workflowId );
148+ return $ this ->cloneWith ('workflowId ' , $ workflowId );
149149 }
150150
151151 public function withWorkflowType (string |WorkflowType $ workflowType ): self
152152 {
153153 \is_string ($ workflowType ) and $ workflowType = self ::createWorkflowType ($ workflowType );
154154
155155 /** @see self::$workflowType */
156- return $ this ->with ('workflowType ' , $ workflowType );
156+ return $ this ->cloneWith ('workflowType ' , $ workflowType );
157157 }
158158
159159 public function withTaskQueue (string |TaskQueue $ taskQueue ): self
160160 {
161161 \is_string ($ taskQueue ) and $ taskQueue = TaskQueue::new ($ taskQueue );
162162
163163 /** @see self::$taskQueue */
164- return $ this ->with ('taskQueue ' , $ taskQueue );
164+ return $ this ->cloneWith ('taskQueue ' , $ taskQueue );
165165 }
166166
167167 /**
@@ -174,7 +174,7 @@ public function withInput(array|ValuesInterface $values): self
174174 $ values instanceof ValuesInterface or $ values = EncodedValues::fromValues ($ values );
175175
176176 /** @see self::$input */
177- return $ this ->with ('input ' , $ values );
177+ return $ this ->cloneWith ('input ' , $ values );
178178 }
179179
180180 /**
@@ -189,7 +189,7 @@ public function withWorkflowExecutionTimeout(mixed $timeout): self
189189 : DateInterval::parse ($ timeout , DateInterval::FORMAT_SECONDS );
190190
191191 /** @see self::$workflowExecutionTimeout */
192- return $ this ->with ('workflowExecutionTimeout ' , $ timeout );
192+ return $ this ->cloneWith ('workflowExecutionTimeout ' , $ timeout );
193193 }
194194
195195 /**
@@ -204,7 +204,7 @@ public function withWorkflowRunTimeout(mixed $timeout): self
204204 : DateInterval::parse ($ timeout , DateInterval::FORMAT_SECONDS );
205205
206206 /** @see self::$workflowRunTimeout */
207- return $ this ->with ('workflowRunTimeout ' , $ timeout );
207+ return $ this ->cloneWith ('workflowRunTimeout ' , $ timeout );
208208 }
209209
210210 /**
@@ -219,13 +219,13 @@ public function withWorkflowTaskTimeout(mixed $timeout): self
219219 : DateInterval::parse ($ timeout , DateInterval::FORMAT_SECONDS );
220220
221221 /** @see self::$workflowTaskTimeout */
222- return $ this ->with ('workflowTaskTimeout ' , $ timeout );
222+ return $ this ->cloneWith ('workflowTaskTimeout ' , $ timeout );
223223 }
224224
225225 public function withWorkflowIdReusePolicy (IdReusePolicy $ policy ): self
226226 {
227227 /** @see self::$workflowIdReusePolicy */
228- return $ this ->with ('workflowIdReusePolicy ' , $ policy );
228+ return $ this ->cloneWith ('workflowIdReusePolicy ' , $ policy );
229229 }
230230
231231 /**
@@ -234,7 +234,7 @@ public function withWorkflowIdReusePolicy(IdReusePolicy $policy): self
234234 public function withRetryPolicy (RetryOptions $ retryPolicy ): self
235235 {
236236 /** @see self::$retryPolicy */
237- return $ this ->with ('retryPolicy ' , $ retryPolicy );
237+ return $ this ->cloneWith ('retryPolicy ' , $ retryPolicy );
238238 }
239239
240240 /**
@@ -247,7 +247,7 @@ public function withMemo(iterable|EncodedCollection $values): self
247247 $ values instanceof EncodedCollection or $ values = EncodedCollection::fromValues ($ values );
248248
249249 /** @see self::$memo */
250- return $ this ->with ('memo ' , $ values );
250+ return $ this ->cloneWith ('memo ' , $ values );
251251 }
252252
253253 /**
@@ -260,7 +260,7 @@ public function withSearchAttributes(iterable|EncodedCollection $values): self
260260 $ values instanceof EncodedCollection or $ values = EncodedCollection::fromValues ($ values );
261261
262262 /** @see self::$searchAttributes */
263- return $ this ->with ('searchAttributes ' , $ values );
263+ return $ this ->cloneWith ('searchAttributes ' , $ values );
264264 }
265265
266266 /**
@@ -273,7 +273,7 @@ public function withHeader(iterable|HeaderInterface $values): self
273273 $ values instanceof HeaderInterface or $ values = \Temporal \Interceptor \Header::fromValues ($ values );
274274
275275 /** @see self::$header */
276- return $ this ->with ('header ' , $ values );
276+ return $ this ->cloneWith ('header ' , $ values );
277277 }
278278
279279 /**
@@ -286,7 +286,7 @@ public function withHeader(iterable|HeaderInterface $values): self
286286 public function withStaticSummary (string $ summary ): self
287287 {
288288 /** @see self::$userMetadata */
289- return $ this ->with ('userMetadata ' , $ this ->userMetadata ->withSummary ($ summary ));
289+ return $ this ->cloneWith ('userMetadata ' , $ this ->userMetadata ->withSummary ($ summary ));
290290 }
291291
292292 /**
@@ -300,7 +300,7 @@ public function withStaticSummary(string $summary): self
300300 public function withStaticDetails (string $ details ): self
301301 {
302302 /** @see self::$userMetadata */
303- return $ this ->with ('userMetadata ' , $ this ->userMetadata ->withDetails ($ details ));
303+ return $ this ->cloneWith ('userMetadata ' , $ this ->userMetadata ->withDetails ($ details ));
304304 }
305305
306306 private static function createWorkflowType (string $ name ): WorkflowType
0 commit comments