Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/Client/Schedule/Action/StartWorkflowAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,23 +145,23 @@ public function withWorkflowId(string $workflowId): self
$workflowId !== '' or throw new \InvalidArgumentException('Workflow ID cannot be empty.');

/** @see self::$workflowId */
return $this->with('workflowId', $workflowId);
return $this->cloneWith('workflowId', $workflowId);
}

public function withWorkflowType(string|WorkflowType $workflowType): self
{
\is_string($workflowType) and $workflowType = self::createWorkflowType($workflowType);

/** @see self::$workflowType */
return $this->with('workflowType', $workflowType);
return $this->cloneWith('workflowType', $workflowType);
}

public function withTaskQueue(string|TaskQueue $taskQueue): self
{
\is_string($taskQueue) and $taskQueue = TaskQueue::new($taskQueue);

/** @see self::$taskQueue */
return $this->with('taskQueue', $taskQueue);
return $this->cloneWith('taskQueue', $taskQueue);
}

/**
Expand All @@ -174,7 +174,7 @@ public function withInput(array|ValuesInterface $values): self
$values instanceof ValuesInterface or $values = EncodedValues::fromValues($values);

/** @see self::$input */
return $this->with('input', $values);
return $this->cloneWith('input', $values);
}

/**
Expand All @@ -189,7 +189,7 @@ public function withWorkflowExecutionTimeout(mixed $timeout): self
: DateInterval::parse($timeout, DateInterval::FORMAT_SECONDS);

/** @see self::$workflowExecutionTimeout */
return $this->with('workflowExecutionTimeout', $timeout);
return $this->cloneWith('workflowExecutionTimeout', $timeout);
}

/**
Expand All @@ -204,7 +204,7 @@ public function withWorkflowRunTimeout(mixed $timeout): self
: DateInterval::parse($timeout, DateInterval::FORMAT_SECONDS);

/** @see self::$workflowRunTimeout */
return $this->with('workflowRunTimeout', $timeout);
return $this->cloneWith('workflowRunTimeout', $timeout);
}

/**
Expand All @@ -219,13 +219,13 @@ public function withWorkflowTaskTimeout(mixed $timeout): self
: DateInterval::parse($timeout, DateInterval::FORMAT_SECONDS);

/** @see self::$workflowTaskTimeout */
return $this->with('workflowTaskTimeout', $timeout);
return $this->cloneWith('workflowTaskTimeout', $timeout);
}

public function withWorkflowIdReusePolicy(IdReusePolicy $policy): self
{
/** @see self::$workflowIdReusePolicy */
return $this->with('workflowIdReusePolicy', $policy);
return $this->cloneWith('workflowIdReusePolicy', $policy);
}

/**
Expand All @@ -234,7 +234,7 @@ public function withWorkflowIdReusePolicy(IdReusePolicy $policy): self
public function withRetryPolicy(RetryOptions $retryPolicy): self
{
/** @see self::$retryPolicy */
return $this->with('retryPolicy', $retryPolicy);
return $this->cloneWith('retryPolicy', $retryPolicy);
}

/**
Expand All @@ -247,7 +247,7 @@ public function withMemo(iterable|EncodedCollection $values): self
$values instanceof EncodedCollection or $values = EncodedCollection::fromValues($values);

/** @see self::$memo */
return $this->with('memo', $values);
return $this->cloneWith('memo', $values);
}

/**
Expand All @@ -260,7 +260,7 @@ public function withSearchAttributes(iterable|EncodedCollection $values): self
$values instanceof EncodedCollection or $values = EncodedCollection::fromValues($values);

/** @see self::$searchAttributes */
return $this->with('searchAttributes', $values);
return $this->cloneWith('searchAttributes', $values);
}

/**
Expand All @@ -273,7 +273,7 @@ public function withHeader(iterable|HeaderInterface $values): self
$values instanceof HeaderInterface or $values = \Temporal\Interceptor\Header::fromValues($values);

/** @see self::$header */
return $this->with('header', $values);
return $this->cloneWith('header', $values);
}

/**
Expand All @@ -286,7 +286,7 @@ public function withHeader(iterable|HeaderInterface $values): self
public function withStaticSummary(string $summary): self
{
/** @see self::$userMetadata */
return $this->with('userMetadata', $this->userMetadata->withSummary($summary));
return $this->cloneWith('userMetadata', $this->userMetadata->withSummary($summary));
}

/**
Expand All @@ -300,7 +300,7 @@ public function withStaticSummary(string $summary): self
public function withStaticDetails(string $details): self
{
/** @see self::$userMetadata */
return $this->with('userMetadata', $this->userMetadata->withDetails($details));
return $this->cloneWith('userMetadata', $this->userMetadata->withDetails($details));
}

private static function createWorkflowType(string $name): WorkflowType
Expand Down
6 changes: 3 additions & 3 deletions src/Client/Schedule/BackfillPeriod.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static function new(
public function withStartTime(\DateTimeInterface|string $dateTime): self
{
/** @see self::$startTime */
return $this->with('startTime', DateTime::parse($dateTime, class: \DateTimeImmutable::class));
return $this->cloneWith('startTime', DateTime::parse($dateTime, class: \DateTimeImmutable::class));
}

/**
Expand All @@ -60,7 +60,7 @@ public function withStartTime(\DateTimeInterface|string $dateTime): self
public function withEndTime(\DateTimeInterface|string $dateTime): self
{
/** @see self::$endTime */
return $this->with('endTime', DateTime::parse($dateTime, class: \DateTimeImmutable::class));
return $this->cloneWith('endTime', DateTime::parse($dateTime, class: \DateTimeImmutable::class));
}

/**
Expand All @@ -69,6 +69,6 @@ public function withEndTime(\DateTimeInterface|string $dateTime): self
public function withOverlapPolicy(ScheduleOverlapPolicy $overlapPolicy): self
{
/** @see self::$overlapPolicy */
return $this->with('overlapPolicy', $overlapPolicy);
return $this->cloneWith('overlapPolicy', $overlapPolicy);
}
}
6 changes: 3 additions & 3 deletions src/Client/Schedule/Policy/SchedulePolicies.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static function new(): self
*/
public function withOverlapPolicy(ScheduleOverlapPolicy $overlapPolicy): self
{
return $this->with('overlapPolicy', $overlapPolicy);
return $this->cloneWith('overlapPolicy', $overlapPolicy);
}

/**
Expand All @@ -86,7 +86,7 @@ public function withCatchupWindow(mixed $interval): self
// Can't be less than 10 seconds.
\assert($interval->totalSeconds >= 10);

return $this->with('catchupWindow', $interval);
return $this->cloneWith('catchupWindow', $interval);
}

/**
Expand All @@ -96,6 +96,6 @@ public function withCatchupWindow(mixed $interval): self
*/
public function withPauseOnFailure(bool $pauseOnFailure = true): self
{
return $this->with('pauseOnFailure', $pauseOnFailure);
return $this->cloneWith('pauseOnFailure', $pauseOnFailure);
}
}
8 changes: 4 additions & 4 deletions src/Client/Schedule/Schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,24 @@ public static function new(): self
public function withAction(?ScheduleAction $action): self
{
/** @see self::$action */
return $this->with('action', $action);
return $this->cloneWith('action', $action);
}

public function withSpec(ScheduleSpec $spec): self
{
/** @see self::$spec */
return $this->with('spec', $spec);
return $this->cloneWith('spec', $spec);
}

public function withPolicies(SchedulePolicies $policies): self
{
/** @see self::$policies */
return $this->with('policies', $policies);
return $this->cloneWith('policies', $policies);
}

public function withState(ScheduleState $state): self
{
/** @see self::$state */
return $this->with('state', $state);
return $this->cloneWith('state', $state);
}
}
12 changes: 6 additions & 6 deletions src/Client/Schedule/ScheduleOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static function new(): self
public function withNamespace(string $namespace): self
{
/** @see self::$namespace */
return $this->with('namespace', $namespace);
return $this->cloneWith('namespace', $namespace);
}

/**
Expand All @@ -60,7 +60,7 @@ public function withNamespace(string $namespace): self
public function withTriggerImmediately(bool $value): self
{
/** @see self::$triggerImmediately */
return $this->with('triggerImmediately', $value);
return $this->cloneWith('triggerImmediately', $value);
}

/**
Expand All @@ -72,7 +72,7 @@ public function withTriggerImmediately(bool $value): self
public function withBackfills(BackfillPeriod ...$values): self
{
/** @see self::$backfills */
return $this->with('backfills', $values);
return $this->cloneWith('backfills', $values);
}

/**
Expand All @@ -84,7 +84,7 @@ public function withBackfills(BackfillPeriod ...$values): self
public function withAddedBackfill(BackfillPeriod $value): self
{
/** @see self::$backfills */
return $this->with('backfills', [...$this->backfills, $value]);
return $this->cloneWith('backfills', [...$this->backfills, $value]);
}

/**
Expand All @@ -97,7 +97,7 @@ public function withMemo(iterable|EncodedCollection $values): self
$values instanceof EncodedCollection or $values = EncodedCollection::fromValues($values);

/** @see self::$memo */
return $this->with('memo', $values);
return $this->cloneWith('memo', $values);
}

/**
Expand All @@ -113,6 +113,6 @@ public function withSearchAttributes(iterable|EncodedCollection $values): self
$values instanceof EncodedCollection or $values = EncodedCollection::fromValues($values);

/** @see self::$searchAttributes */
return $this->with('searchAttributes', $values);
return $this->cloneWith('searchAttributes', $values);
}
}
16 changes: 8 additions & 8 deletions src/Client/Schedule/Spec/CalendarSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,42 +88,42 @@ public static function new(

public function withSecond(string|int $second): self
{
return $this->with('second', (string) $second);
return $this->cloneWith('second', (string) $second);
}

public function withMinute(string|int $minute): self
{
return $this->with('minute', (string) $minute);
return $this->cloneWith('minute', (string) $minute);
}

public function withHour(string|int $hour): self
{
return $this->with('hour', (string) $hour);
return $this->cloneWith('hour', (string) $hour);
}

public function withDayOfMonth(string|int $dayOfMonth): self
{
return $this->with('dayOfMonth', (string) $dayOfMonth);
return $this->cloneWith('dayOfMonth', (string) $dayOfMonth);
}

public function withMonth(string|int $month): self
{
return $this->with('month', (string) $month);
return $this->cloneWith('month', (string) $month);
}

public function withYear(string|int $year): self
{
return $this->with('year', (string) $year);
return $this->cloneWith('year', (string) $year);
}

public function withDayOfWeek(string|int $dayOfWeek): self
{
return $this->with('dayOfWeek', (string) $dayOfWeek);
return $this->cloneWith('dayOfWeek', (string) $dayOfWeek);
}

public function withComment(string $comment): self
{
/** @see self::$comment */
return $this->with('comment', $comment);
return $this->cloneWith('comment', $comment);
}
}
4 changes: 2 additions & 2 deletions src/Client/Schedule/Spec/IntervalSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ public function withInterval(mixed $interval): self
\assert(DateInterval::assert($interval));
$interval = DateInterval::parse($interval, DateInterval::FORMAT_SECONDS);

return $this->with('interval', $interval);
return $this->cloneWith('interval', $interval);
}

public function withPhase(mixed $phase): self
{
\assert(DateInterval::assert($phase));
$phase = DateInterval::parse($phase, DateInterval::FORMAT_SECONDS);

return $this->with('phase', $phase);
return $this->cloneWith('phase', $phase);
}
}
6 changes: 3 additions & 3 deletions src/Client/Schedule/Spec/Range.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static function new(int $start, int $end, int $step = 1): self
*/
public function withStart(int $start): self
{
return $this->with('start', $start);
return $this->cloneWith('start', $start);
}

/**
Expand All @@ -59,7 +59,7 @@ public function withStart(int $start): self
public function withEnd(int $end): self
{
\assert($end >= $this->start, 'End must be greater than or equal to start.');
return $this->with('end', $end);
return $this->cloneWith('end', $end);
}

/**
Expand All @@ -68,6 +68,6 @@ public function withEnd(int $end): self
public function withStep(int $step): self
{
\assert($step > 0, 'Step must be greater than 0.');
return $this->with('step', $step);
return $this->cloneWith('step', $step);
}
}
Loading
Loading