From e32be2204c69c9bdfbe5934787a928d1826bd400 Mon Sep 17 00:00:00 2001 From: Maxim Smakouz Date: Tue, 19 Mar 2024 13:27:57 +0200 Subject: [PATCH 1/4] Replace blocks with GitHub markdown --- src/Activity.php | 8 +- src/Client/WorkflowClientInterface.php | 8 +- src/Common/CronSchedule.php | 4 +- .../Declaration/Reader/WorkflowReader.php | 4 +- src/WorkerFactory.php | 4 +- src/Workflow.php | 106 +++++++++--------- src/Workflow/WorkflowRunInterface.php | 4 +- 7 files changed, 69 insertions(+), 69 deletions(-) diff --git a/src/Activity.php b/src/Activity.php index 7ee68159..e975b8fa 100644 --- a/src/Activity.php +++ b/src/Activity.php @@ -42,7 +42,7 @@ public static function getInfo(): ActivityInfo * * The data is equivalent to what is passed to the activity method handler. * - * + * ```php * #[ActivityMethod] * public function activityMethod(int $first, string $second) * { @@ -51,7 +51,7 @@ public static function getInfo(): ActivityInfo * Assert::assertTrue($first, $arguments->getValue(0, Type::TYPE_INT)); * Assert::assertTrue($second, $arguments->getValue(1, Type::TYPE_STRING)); * } - * + * ``` * * @return ValuesInterface * @throws OutOfContextException in the absence of the activity execution context. @@ -113,7 +113,7 @@ public static function doNotCompleteOnReturn(): void /** * Use to notify workflow that activity execution is alive. * - * + * ```php * public function activityMethod() * { * // An example method of deferred request @@ -127,7 +127,7 @@ public static function doNotCompleteOnReturn(): void * // Returns response of deferred request * return $query->getResult(); * } - * + * ``` * * @param mixed $details In case of activity timeout details are returned * as a field of the exception thrown. diff --git a/src/Client/WorkflowClientInterface.php b/src/Client/WorkflowClientInterface.php index 68ce19ae..e11bd334 100644 --- a/src/Client/WorkflowClientInterface.php +++ b/src/Client/WorkflowClientInterface.php @@ -131,9 +131,9 @@ public function newActivityCompletionClient(): ActivityCompletionClientInterface * Get paginated list of workflow executions using List Filter Query syntax. * Query example: * - * + * ``` * WorkflowType='MyWorkflow' and StartTime between '2022-08-22T15:04:05+00:00' and '2023-08-22T15:04:05+00:00' - * + * ``` * * @link https://docs.temporal.io/visibility * @see self::countWorkflowExecutions() @@ -154,9 +154,9 @@ public function listWorkflowExecutions( * Get count of workflow executions using List Filter Query syntax. * Query example: * - * + * ``` * WorkflowType='MyWorkflow' and StartTime between '2022-08-22T15:04:05+00:00' and '2023-08-22T15:04:05+00:00' - * + * ``` * * @link https://docs.temporal.io/visibility * @see self::listWorkflowExecutions() diff --git a/src/Common/CronSchedule.php b/src/Common/CronSchedule.php index f858ac09..7025268c 100644 --- a/src/Common/CronSchedule.php +++ b/src/Common/CronSchedule.php @@ -39,7 +39,7 @@ final class CronSchedule implements \Stringable /** * The cron spec is as following: * - * + * ``` * ┌───────────── minute (0 - 59) * │ ┌───────────── hour (0 - 23) * │ │ ┌───────────── day of the month (1 - 31) @@ -48,7 +48,7 @@ final class CronSchedule implements \Stringable * │ │ │ │ │ * │ │ │ │ │ * * * * * * - * + * ``` * * @var string */ diff --git a/src/Internal/Declaration/Reader/WorkflowReader.php b/src/Internal/Declaration/Reader/WorkflowReader.php index 4fa1a15c..eb5634d6 100644 --- a/src/Internal/Declaration/Reader/WorkflowReader.php +++ b/src/Internal/Declaration/Reader/WorkflowReader.php @@ -368,7 +368,7 @@ private function findProto(\ReflectionMethod $handler, \ReflectionMethod $ctx): * In the case that one of the handlers is declared on an incorrect * method, we should inform about it. For example: * - * + * ```php * #[WorkflowInterface] * class Workflow extends BaseWorkflow * { @@ -382,7 +382,7 @@ private function findProto(\ReflectionMethod $handler, \ReflectionMethod $ctx): * #[WorkflowMethod] * protected function handler(): void { ... } // << Error: Cannot be protected * } - * + * ``` */ if (!$this->isValidMethod($handler)) { $contextClass = $ctx->getDeclaringClass(); diff --git a/src/WorkerFactory.php b/src/WorkerFactory.php index 3ee98172..dc01e54f 100644 --- a/src/WorkerFactory.php +++ b/src/WorkerFactory.php @@ -60,7 +60,7 @@ * WorkerFactory is primary entry point for the temporal application. This class is responsible for the communication * with parent RoadRunner process and can be used to create taskQueue workflow and activity workers. * - * + * ```php * $factory = WorkerFactory::create(); * * $worker = $factory->newWorker('default'); @@ -68,7 +68,7 @@ * $worker->registerWorkflowTypes(WorkflowType::class); * $worker->registerActivityImplementations(new MyActivityImplementation()); * - * + * ``` */ class WorkerFactory implements WorkerFactoryInterface, LoopInterface { diff --git a/src/Workflow.php b/src/Workflow.php index c2e1428b..bf846c0b 100644 --- a/src/Workflow.php +++ b/src/Workflow.php @@ -109,18 +109,18 @@ public static function getInfo(): WorkflowInfo * The data is equivalent to what is passed to the workflow handler. * * For example: - * + * ```php * #[WorkflowInterface] * interface ExampleWorkflowInterface * { * #[WorkflowMethod] * public function handle(int $first, string $second); * } - * + * ``` * * And * - * + * ```php * // ... * $arguments = Workflow::getInput(); * @@ -129,7 +129,7 @@ public static function getInfo(): WorkflowInfo * * // Contains the value passed as the second argument to the workflow * $second = $arguments->getValue(1, Type::TYPE_STRING); - * + * ``` * * @return ValuesInterface * @throws OutOfContextException in the absence of the workflow execution context. @@ -147,7 +147,7 @@ public static function getInput(): ValuesInterface * * For example: * - * + * ```php * #[WorkflowMethod] * public function handler() * { @@ -168,7 +168,7 @@ public static function getInput(): ValuesInterface * // Or get information about the execution of the group * $promise->isCancelled(); * } - * + * ``` * * You can see more information about the capabilities of the child * asynchronous task in {@see CancellationScopeInterface} interface. @@ -189,7 +189,7 @@ public static function async(callable $task): CancellationScopeInterface * * Default behaviour through {@see Workflow::async()}: * - * + * ```php * $parent = Workflow::async(fn() => * $child = Workflow::async(fn() => * // ... @@ -200,13 +200,13 @@ public static function async(callable $task): CancellationScopeInterface * * // In this case, the "$child" promise will also be canceled: * $child->isCancelled(); // true - * + * ``` * - * When creating a detaching task using {@see Workflow::asyncDetached} + * When creating a detaching task using {@see Workflow::asyncDetached()} * inside the parent, it will not be stopped when the parent context * finishes working: * - * + * ```php * $parent = Workflow::async(fn() => * $child = Workflow::asyncDetached(fn() => * // ... @@ -217,7 +217,7 @@ public static function async(callable $task): CancellationScopeInterface * * // In this case, the "$child" promise will NOT be canceled: * $child->isCancelled(); // false - * + * ``` * * Use asyncDetached to handle cleanup and compensation logic. * @@ -236,7 +236,7 @@ public static function asyncDetached(callable $task): CancellationScopeInterface * Please note that a state change should ONLY occur if the internal * workflow conditions are met. * - * + * ```php * #[WorkflowMethod] * public function handler() * { @@ -246,12 +246,12 @@ public static function asyncDetached(callable $task): CancellationScopeInterface * * // ...do something * } - * + * ``` * * Or in the case of an explicit signal method execution of the specified * workflow. * - * + * ```php * private bool $continued = false; * * #[WorkflowMethod] @@ -267,7 +267,7 @@ public static function asyncDetached(callable $task): CancellationScopeInterface * { * $this->continued = true; * } - * + * ``` * * @param callable|PromiseInterface ...$conditions * @return PromiseInterface @@ -285,7 +285,7 @@ public static function await(...$conditions): PromiseInterface * will proceed to the next step either if the internal workflow conditions * are met, or after the specified timer interval expires. * - * + * ```php * #[WorkflowMethod] * public function handler() * { @@ -294,7 +294,7 @@ public static function await(...$conditions): PromiseInterface * * // ...continue execution * } - * + * ``` * * @param DateIntervalValue $interval * @param callable|PromiseInterface ...$conditions @@ -321,7 +321,7 @@ public static function getLastCompletionResult($type = null) * A method that allows you to dynamically register additional query * handler in a workflow during the execution of a workflow. * - * + * ```php * #[WorkflowMethod] * public function handler() * { @@ -329,7 +329,7 @@ public static function getLastCompletionResult($type = null) * echo sprintf('Executed query "query" with argument "%s"', $argument); * }); * } - * + * ``` * * The same method ({@see WorkflowStubInterface::query()}) should be used * to call such query handlers as in the case of ordinary query methods. @@ -348,7 +348,7 @@ public static function registerQuery(string $queryType, callable $handler): Scop * The method is similar to the {@see Workflow::registerQuery()}, but it * registers an additional signal handler. * - * + * ```php * #[WorkflowMethod] * public function handler() * { @@ -356,7 +356,7 @@ public static function registerQuery(string $queryType, callable $handler): Scop * echo sprintf('Executed signal "signal" with argument "%s"', $argument); * }); * } - * + * ``` * * The same method ({@see WorkflowStubInterface::signal()}) should be used * to call such signal handlers as in the case of ordinary signal methods. @@ -376,7 +376,7 @@ public static function registerSignal(string $queryType, callable $handler): Sco * which was already implemented earlier in order to get rid of errors of * inconsistency of workflow replay and existing new code. * - * + * ```php * #[WorkflowMethod] * public function handler() * { @@ -387,7 +387,7 @@ public static function registerSignal(string $queryType, callable $handler): Sco * 2 => Workflow::executeActivity('after'), // New behaviour * } * } - * + * ``` * * @param string $changeId * @param int $minSupported @@ -405,7 +405,7 @@ public static function getVersion(string $changeId, int $minSupported, int $maxS * replayed (for example, in case of an error), such isolated data will * return the result of the previous replay. * - * + * ```php * #[WorkflowMethod] * public function handler() * { @@ -416,7 +416,7 @@ public static function getVersion(string $changeId, int $minSupported, int $maxS * // will be performed once. * $time = yield Workflow::sideEffect(fn() => hrtime(true)); * } - * + * ``` * * @template TReturn * @param callable(): TReturn $value @@ -436,7 +436,7 @@ public static function sideEffect(callable $value): PromiseInterface * or a positive number, which is equivalent to the seconds for which the * workflow should be suspended. * - * + * ```php * #[WorkflowMethod] * public function handler() * { @@ -449,7 +449,7 @@ public static function sideEffect(callable $value): PromiseInterface * // Wait 23 months * yield Workflow::timer('23 months'); * } - * + * ``` * * @param DateIntervalValue $interval * @return PromiseInterface @@ -465,13 +465,13 @@ public static function timer($interval): PromiseInterface * new execution of the Workflow with the same Workflow Id. The new * execution will not carry over any history from the old execution. * - * + * ```php * #[WorkflowMethod] * public function handler() * { * return yield Workflow::continueAsNew('AnyAnotherWorkflow'); * } - * + * ``` * * @param string $type * @param array $args @@ -492,7 +492,7 @@ public static function continueAsNew( * the workflow class as the first argument, and the further api is built on * the basis of calls to the methods of the passed workflow. * - * + * ```php * // Any workflow interface example: * * #[WorkflowInterface] @@ -513,7 +513,7 @@ public static function continueAsNew( * // Executes ExampleWorkflow::handle(int $value) * return yield $proxy->handle(42); * } - * + * ``` * * @psalm-template T of object * @@ -532,7 +532,7 @@ public static function newContinueAsNewStub(string $class, ContinueAsNewOptions * It is similar to {@see Workflow::continueAsNew}, but does not terminate * the current workflow execution. * - * + * ```php * #[WorkflowMethod] * public function handler() * { @@ -540,13 +540,13 @@ public static function newContinueAsNewStub(string $class, ContinueAsNewOptions * * // Do something else * } - * + * ``` * * Please note that due to the fact that PHP does not allow defining the * type on {@see \Generator}, you sometimes need to specify the type of * the child workflow result explicitly. * - * + * ```php * // External child workflow handler method with Generator return type-hint * public function handle(): \Generator * { @@ -566,7 +566,7 @@ public static function newContinueAsNewStub(string $class, ContinueAsNewOptions * * // Do something else * } - * + * ``` * * @param string $type * @param array $args @@ -591,7 +591,7 @@ public static function executeChildWorkflow( * is built on the basis of calls to the methods of the passed workflow. * For starting abandon child workflow {@see Workflow::newUntypedChildWorkflowStub()}. * - * + * ```php * // Any workflow interface example: * * #[WorkflowInterface] @@ -614,7 +614,7 @@ public static function executeChildWorkflow( * * // etc ... * } - * + * ``` * * @psalm-template T of object * @@ -635,7 +635,7 @@ public static function newChildWorkflowStub( * This method is equivalent to {@see Workflow::newChildWorkflowStub()}, but * it takes the workflow name (instead of class name) as the first argument. * - * + * ```php * #[WorkflowMethod] * public function handler() * { @@ -650,11 +650,11 @@ public static function newChildWorkflowStub( * * // etc ... * } - * + * ``` * * To start abandoned child workflow use `yield` and method `start()`: * - * + * ```php * #[WorkflowMethod] * public function handler() * { @@ -667,7 +667,7 @@ public static function newChildWorkflowStub( * // Start child workflow * yield $workflow->start(42); * } - * + * ``` * * @param string $name * @param ChildWorkflowOptions|null $options @@ -686,7 +686,7 @@ public static function newUntypedChildWorkflowStub( * This method allows you to create a "proxy" for an existing and * running workflow by fqn class name of the existing workflow. * - * + * ```php * #[WorkflowMethod] * public function handler(string $existingWorkflowId) * { @@ -697,7 +697,7 @@ public static function newUntypedChildWorkflowStub( * // The method "signalMethod" from the class "ClassName" will be called: * yield $externalWorkflow->signalMethod(); * } - * + * ``` * * @psalm-template T of object * @@ -715,7 +715,7 @@ public static function newExternalWorkflowStub(string $class, WorkflowExecution * Allows to create a "proxy" for an existing and running workflow by * name (type) of the existing workflow. * - * + * ```php * #[WorkflowMethod] * public function handler(string $existingWorkflowId) * { @@ -729,7 +729,7 @@ public static function newExternalWorkflowStub(string $class, WorkflowExecution * // Stops the external workflow * $externalWorkflow->cancel(); * } - * + * ``` * * @param WorkflowExecution $execution * @return ExternalWorkflowStubInterface @@ -743,19 +743,19 @@ public static function newUntypedExternalWorkflowStub(WorkflowExecution $executi /** * Calls an activity by its name and gets the result of its execution. * - * + * ```php * #[WorkflowMethod] * public function handler(string $existingWorkflowId) * { * $result1 = yield Workflow::executeActivity('activityName'); * $result2 = yield Workflow::executeActivity('anotherActivityName'); * } - * + * ``` * * In addition to this method of calling, you can use alternative methods * of working with the result using Promise API ({@see PromiseInterface}). * - * + * ```php * #[WorkflowMethod] * public function handler(string $existingWorkflowId) * { @@ -768,7 +768,7 @@ public static function newUntypedExternalWorkflowStub(WorkflowExecution $executi * }) * ; * } - * + * ``` * * @param string $type * @param array $args @@ -791,7 +791,7 @@ public static function executeActivity( * allows you to conveniently and beautifully call all methods within the * passed class. * - * + * ```php * #[ActivityInterface] * class ExampleActivityClass * { @@ -810,7 +810,7 @@ public static function executeActivity( * yield $activities->firstActivity(); * yield $activities->secondActivity(); * } - * + * ``` * * @psalm-template T of object * @@ -831,7 +831,7 @@ public static function newActivityStub( * The method creates and returns a proxy class with the specified settings * that allows to call an activities with the passed options. * - * + * ```php * #[WorkflowMethod] * public function handler(string $existingWorkflowId) * { @@ -844,7 +844,7 @@ public static function newActivityStub( * // Executes an activity named "activity" * $result = yield $activities->execute('activity'); * } - * + * ``` * * @param ActivityOptionsInterface|null $options * diff --git a/src/Workflow/WorkflowRunInterface.php b/src/Workflow/WorkflowRunInterface.php index b9166528..27e7d0c1 100644 --- a/src/Workflow/WorkflowRunInterface.php +++ b/src/Workflow/WorkflowRunInterface.php @@ -31,13 +31,13 @@ public function getExecution(): WorkflowExecution; * Behind the scene this call performs long poll on Temporal service waiting * for workflow completion notification. * - * + * ```php * // Map to array * $result = $run->getResult(Type::TYPE_ARRAY); * * // Map to list of custom class * $result = $run->getResult(Type::arrayOf(Message::class)); - * + * ``` * * @param string|\ReflectionClass|\ReflectionType|Type|null $type * @param int|null $timeout Timeout in seconds. Infinite by the default. From 19262d8888c9c9d87e6b07b2e71680c3d75f7d90 Mon Sep 17 00:00:00 2001 From: Maxim Smakouz Date: Tue, 19 Mar 2024 13:50:48 +0200 Subject: [PATCH 2/4] Fix @see tag --- src/Internal/Client/WorkflowStarter.php | 4 ++-- src/Workflow.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Internal/Client/WorkflowStarter.php b/src/Internal/Client/WorkflowStarter.php index 99232558..199e682b 100644 --- a/src/Internal/Client/WorkflowStarter.php +++ b/src/Internal/Client/WorkflowStarter.php @@ -75,7 +75,7 @@ public function start( fn (StartInput $input): WorkflowExecution => $this->executeRequest( $this->configureExecutionRequest(new StartWorkflowExecutionRequest(), $input) ), - /** @see WorkflowClientCallsInterceptor::start */ + /** @see WorkflowClientCallsInterceptor::start() */ 'start', )(new StartInput($options->workflowId, $workflowType, $header, $arguments, $options)); } @@ -119,7 +119,7 @@ function (SignalWithStartInput $input): WorkflowExecution { return $this->executeRequest($request); }, - /** @see WorkflowClientCallsInterceptor::signalWithStart */ + /** @see WorkflowClientCallsInterceptor::signalWithStart() */ 'signalWithStart', )( new SignalWithStartInput( diff --git a/src/Workflow.php b/src/Workflow.php index bf846c0b..cc348455 100644 --- a/src/Workflow.php +++ b/src/Workflow.php @@ -488,7 +488,7 @@ public static function continueAsNew( } /** - * This method is equivalent to {@see Workflow::continueAsNew}, but it takes + * This method is equivalent to {@see Workflow::continueAsNew()}, but it takes * the workflow class as the first argument, and the further api is built on * the basis of calls to the methods of the passed workflow. * @@ -529,7 +529,7 @@ public static function newContinueAsNewStub(string $class, ContinueAsNewOptions /** * Method for calling an external workflow without stopping the current one. - * It is similar to {@see Workflow::continueAsNew}, but does not terminate + * It is similar to {@see Workflow::continueAsNew()}, but does not terminate * the current workflow execution. * * ```php @@ -586,7 +586,7 @@ public static function executeChildWorkflow( } /** - * This method is equivalent to {@see Workflow::executeChildWorkflow}, but + * This method is equivalent to {@see Workflow::executeChildWorkflow()}, but * it takes the workflow class as the first argument, and the further api * is built on the basis of calls to the methods of the passed workflow. * For starting abandon child workflow {@see Workflow::newUntypedChildWorkflowStub()}. From 91fc4adbad3e90c084251376e0cd8d775fd0792f Mon Sep 17 00:00:00 2001 From: Maxim Smakouz Date: Wed, 20 Mar 2024 17:36:30 +0200 Subject: [PATCH 3/4] Add generation of API documentation --- .github/workflows/docs.yml | 35 +++++++++++ phpdoc.dist.xml | 22 +++++++ src/Activity.php | 12 ++-- src/Activity/ActivityCancellationType.php | 13 ++-- src/Activity/ActivityContextInterface.php | 12 ++++ src/Activity/ActivityInfo.php | 9 ++- src/Activity/ActivityInterface.php | 8 +-- src/Activity/ActivityOptions.php | 39 +++++++----- src/Activity/LocalActivityInterface.php | 6 +- src/Activity/LocalActivityOptions.php | 12 ++-- src/Client/GRPC/ServiceClient.php | 42 +++++-------- src/Client/GRPC/ServiceClientInterface.php | 42 +++++-------- .../Schedule/Info/ScheduleActionResult.php | 2 + .../Schedule/Info/ScheduleDescription.php | 3 +- .../Schedule/Info/ScheduleListEntry.php | 3 +- src/Client/Schedule/Info/ScheduleListInfo.php | 2 + .../Schedule/Policy/SchedulePolicies.php | 2 + src/Client/Schedule/Schedule.php | 4 ++ src/Client/Schedule/Spec/CalendarSpec.php | 5 +- src/Client/Schedule/Spec/IntervalSpec.php | 5 +- src/Client/Schedule/Spec/Range.php | 4 +- src/Client/Schedule/Spec/ScheduleSpec.php | 5 +- src/Client/Schedule/Spec/ScheduleState.php | 4 ++ src/Client/Update/LifecycleStage.php | 1 + src/Client/WorkflowClientInterface.php | 15 +++-- src/Client/WorkflowExecutionHistory.php | 8 ++- src/Client/WorkflowOptions.php | 4 +- src/Client/WorkflowStubInterface.php | 12 ++-- .../ActivityInboundInterceptor.php | 5 +- src/Interceptor/Header.php | 3 +- src/Interceptor/PipelineProvider.php | 5 +- .../Trait/ActivityInboundInterceptorTrait.php | 6 +- .../WorkflowClientCallsInterceptorTrait.php | 20 +++++- .../WorkflowInboundCallsInterceptorTrait.php | 16 ++++- .../WorkflowOutboundCallsInterceptorTrait.php | 32 +++++++++- ...orkflowOutboundRequestInterceptorTrait.php | 6 +- .../WorkflowClientCallsInterceptor.php | 17 +++++- .../WorkflowInboundCallsInterceptor.php | 17 +++++- .../WorkflowOutboundCallsInterceptor.php | 16 +++++ .../WorkflowOutboundRequestInterceptor.php | 14 +++++ src/Promise.php | 61 ++++++++++--------- src/Worker/ChildWorkflowCancellationType.php | 10 +-- src/Worker/LoopInterface.php | 3 +- src/Worker/WorkerFactoryInterface.php | 7 ++- src/Worker/WorkerInterface.php | 5 +- src/Workflow.php | 31 ++++++++-- .../ChildWorkflowCancellationType.php | 7 ++- src/Workflow/ChildWorkflowOptions.php | 19 +++--- src/Workflow/ContinueAsNewOptions.php | 6 +- src/Workflow/ScopedContextInterface.php | 2 + src/Workflow/WorkflowContextInterface.php | 54 +++++++++++++--- src/Workflow/WorkflowExecution.php | 2 + src/Workflow/WorkflowExecutionInfo.php | 2 + src/Workflow/WorkflowExecutionStatus.php | 2 + 54 files changed, 495 insertions(+), 204 deletions(-) create mode 100644 .github/workflows/docs.yml create mode 100644 phpdoc.dist.xml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..e5f7f3a5 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,35 @@ +name: Generating API documentation + +on: + push: + branches: + - 'master' + - 'api-reference' + +jobs: + docs: + name: Generating API documentation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + + - uses: actions/setup-node@v1 + with: + node-version: 20 + + - name: Cache phpDocumentor build files + id: phpdocumentor-cache + uses: actions/cache@v3 + with: + path: .phpdoc/cache + key: ${{ runner.os }}-phpdocumentor-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-phpdocumentor- + + - name: Build with documentation + run: docker run --rm --volume "$(pwd):/data" phpdoc/phpdoc:3.4 -vv --template default + + - name: Upload documentation + run: npx vercel deploy docs/api -t ${{ secrets.VERCEL_TOKEN }} --name php --scope temporal --prod --yes diff --git a/phpdoc.dist.xml b/phpdoc.dist.xml new file mode 100644 index 00000000..4569d9e1 --- /dev/null +++ b/phpdoc.dist.xml @@ -0,0 +1,22 @@ + + + + docs/api + .phpdoc/cache + + + + + src + + + + + diff --git a/src/Activity.php b/src/Activity.php index e975b8fa..d78993d0 100644 --- a/src/Activity.php +++ b/src/Activity.php @@ -65,8 +65,9 @@ public static function getInput(): ValuesInterface } /** - * Returns {@see true} when heartbeat's ({@see Activity::heartbeat()}) first - * argument has been passed. + * Check if the heartbeat's first argument has been passed. + * + * This method returns **true** if the first argument has been passed to the {@see Activity::heartbeat()} method. * * @return bool * @throws OutOfContextException in the absence of the activity execution context. @@ -80,8 +81,9 @@ public static function hasHeartbeatDetails(): bool } /** - * The method returns payload that has been passed into last - * heartbeat ({@see Activity::heartbeat()}) method. + * Returns the payload passed into the last heartbeat. + * + * This method retrieves the payload that was passed into the last call of the {@see Activity::heartbeat()} method. * * @param Type|string|\ReflectionType|\ReflectionClass|null $type * @return mixed @@ -96,6 +98,8 @@ public static function getHeartbeatDetails($type = null) } /** + * Marks the activity as incomplete for asynchronous completion. + * * If this method is called during an activity execution then activity is * not going to complete when its method returns. It is expected to be * completed asynchronously using {@see ActivityCompletionClientInterface::complete()}. diff --git a/src/Activity/ActivityCancellationType.php b/src/Activity/ActivityCancellationType.php index d3b850e8..6e05125d 100644 --- a/src/Activity/ActivityCancellationType.php +++ b/src/Activity/ActivityCancellationType.php @@ -15,9 +15,10 @@ use Temporal\Internal\Marshaller\Type\Type; /** - * Defines behaviour of the parent workflow when {@see CancellationScope} that - * wraps child workflow execution request is canceled. The result of the - * cancellation independently of the type is a {@see FailedCancellationException} + * Defines behaviour of the parent workflow when `CancellationScope` that + * wraps child workflow execution request is canceled. + * + * The result of the cancellation independently of the type is a {@see FailedCancellationException} * thrown from the child workflow method. * * @extends Type @@ -44,17 +45,11 @@ final class ActivityCancellationType extends Type */ public const ABANDON = 0x02; - /** - * {@inheritDoc} - */ public function parse($value, $current) { return $value ? self::WAIT_CANCELLATION_COMPLETED : self::TRY_CANCEL; } - /** - * {@inheritDoc} - */ public function serialize($value): bool { switch ($value) { diff --git a/src/Activity/ActivityContextInterface.php b/src/Activity/ActivityContextInterface.php index 2a0b1bc4..457311a9 100644 --- a/src/Activity/ActivityContextInterface.php +++ b/src/Activity/ActivityContextInterface.php @@ -18,6 +18,8 @@ interface ActivityContextInterface { /** + * Returns information about current activity execution. + * * @see Activity::getInfo() * * @return ActivityInfo @@ -25,6 +27,8 @@ interface ActivityContextInterface public function getInfo(): ActivityInfo; /** + * Returns activity execution input arguments. + * * @see Activity::getInput() * * @return ValuesInterface @@ -32,6 +36,8 @@ public function getInfo(): ActivityInfo; public function getInput(): ValuesInterface; /** + * Check if the heartbeat's first argument has been passed. + * * @see Activity::hasHeartbeatDetails() * * @return bool @@ -39,6 +45,8 @@ public function getInput(): ValuesInterface; public function hasHeartbeatDetails(): bool; /** + * Returns the payload passed into the last heartbeat. + * * @see Activity::getHeartbeatDetails() * * @param Type|string $type @@ -47,6 +55,8 @@ public function hasHeartbeatDetails(): bool; public function getHeartbeatDetails($type = null); /** + * Marks the activity as incomplete for asynchronous completion. + * * @see Activity::doNotCompleteOnReturn() * * @return void @@ -54,6 +64,8 @@ public function getHeartbeatDetails($type = null); public function doNotCompleteOnReturn(): void; /** + * Use to notify workflow that activity execution is alive. + * * @see Activity::heartbeat() * * @param mixed $details diff --git a/src/Activity/ActivityInfo.php b/src/Activity/ActivityInfo.php index c509476f..929774f8 100644 --- a/src/Activity/ActivityInfo.php +++ b/src/Activity/ActivityInfo.php @@ -34,8 +34,9 @@ final class ActivityInfo { /** - * A correlation token that can be used to complete the activity - * through {@see ActivityCompletionClientInterface::complete()}. + * A correlation token that can be used to complete the activity through `complete` method. + * + * @see ActivityCompletionClientInterface::complete() * * @var string */ @@ -62,7 +63,9 @@ final class ActivityInfo /** * An ID of the activity. This identifier can be used to complete the - * activity through {@see ActivityCompletionClientInterface::complete()}. + * activity through `complete` method. + * + * @see ActivityCompletionClientInterface::complete() * * @var string */ diff --git a/src/Activity/ActivityInterface.php b/src/Activity/ActivityInterface.php index e0daf750..3758811b 100644 --- a/src/Activity/ActivityInterface.php +++ b/src/Activity/ActivityInterface.php @@ -16,10 +16,10 @@ use Spiral\Attributes\NamedArgumentConstructor; /** - * Indicates that an interface is an activity interface. Only interfaces - * annotated with this annotation can be used as parameters - * to {@see Workflow::activity()} - * and {@see WorkflowContextInterface::newActivityStub()} methods. + * Indicates that an interface is an activity interface. + * + * Only interfaces annotated with this annotation can be used as parameters + * to {@see Workflow::activity()} and {@see WorkflowContextInterface::newActivityStub()} methods. * * Each method of the interface annotated with {@see ActivityInterface} * including inherited from interfaces is a separate activity. By default the diff --git a/src/Activity/ActivityOptions.php b/src/Activity/ActivityOptions.php index 882a6642..0c490057 100644 --- a/src/Activity/ActivityOptions.php +++ b/src/Activity/ActivityOptions.php @@ -24,9 +24,10 @@ /** * ActivityOptions stores all activity-specific parameters that will be stored - * inside of a context. The current timeout resolution implementation is in - * seconds and uses `ceil($interval->s)` as the duration. But is subjected to - * change in the future. + * inside of a context. + * + * The current timeout resolution implementation is in seconds and uses `ceil($interval->s)` as the duration. + * But is subjected to change in the future. * * @psalm-import-type DateIntervalValue from DateInterval */ @@ -64,8 +65,8 @@ class ActivityOptions extends Options implements ActivityOptionsInterface public \DateInterval $startToCloseTimeout; /** - * The periodic timeout while the activity is in execution. This is the max - * interval the server needs to hear at-least one ping from the activity. + * The periodic timeout while the activity is in execution. + * This is the max interval the server needs to hear at-least one ping from the activity. */ #[Marshal(name: 'HeartbeatTimeout', type: DateIntervalType::class)] public \DateInterval $heartbeatTimeout; @@ -81,15 +82,17 @@ class ActivityOptions extends Options implements ActivityOptionsInterface /** * Business level activity ID, this is not needed for most of the cases if - * you have to specify this then talk to temporal team. This is something - * will be done in future. + * you have to specify this then talk to temporal team. + * + * This is something will be done in the future. */ #[Marshal(name: 'ActivityID')] public string $activityId = ''; /** - * RetryPolicy specifies how to retry an Activity if an error occurs. More - * details are available at {@link https://docs.temporal.io/docs/concepts/activities}. RetryPolicy + * RetryPolicy specifies how to retry an Activity if an error occurs. + * + * More details are available at {@link https://docs.temporal.io/docs/concepts/activities}. RetryPolicy * is optional. If one is not specified a default RetryPolicy is provided * by the server. * @@ -134,8 +137,9 @@ public function mergeWith(MethodRetry $retry = null): self } /** - * Task queue to use when dispatching activity task to a worker. By default - * it is the same task list name the workflow was started with. + * Task queue to use when dispatching activity task to a worker. + * + * By default, it is the same task list name the workflow was started with. * * @param string|null $taskQueue * @return $this @@ -152,6 +156,7 @@ public function withTaskQueue(?string $taskQueue): self /** * Overall timeout workflow is willing to wait for activity to complete. + * * It includes time in a task queue: * * - Use {@see ActivityOptions::withScheduleToStartTimeout($timeout)} to limit it. @@ -182,6 +187,7 @@ public function withScheduleToCloseTimeout($timeout): self /** * Time activity can stay in task queue before it is picked up by a worker. + * * If schedule to close is not provided then both this and start to close * are required. * @@ -203,9 +209,9 @@ public function withScheduleToStartTimeout($timeout): self } /** - * Maximum activity execution time after it was sent to a worker. If - * schedule to close is not provided then both this and schedule to start - * are required. + * Maximum activity execution time after it was sent to a worker. + * + * If schedule to close is not provided then both this and schedule to start are required. * * @psalm-suppress ImpureMethodCall * @@ -225,8 +231,9 @@ public function withStartToCloseTimeout($timeout): self } /** - * Heartbeat interval. Activity must heartbeat before this interval passes - * after a last heartbeat or activity start. + * Heartbeat interval. + * + * Activity must heartbeat before this interval passes after a last heartbeat or activity start. * * @psalm-suppress ImpureMethodCall * diff --git a/src/Activity/LocalActivityInterface.php b/src/Activity/LocalActivityInterface.php index a3911888..fad88041 100644 --- a/src/Activity/LocalActivityInterface.php +++ b/src/Activity/LocalActivityInterface.php @@ -16,9 +16,9 @@ use Spiral\Attributes\NamedArgumentConstructor; /** - * Indicates that an interface is a local activity interface. Only interfaces - * annotated with this annotation can be used as parameters - * to {@see Workflow::activity()} + * Indicates that an interface is a local activity interface. + * + * Only interfaces annotated with this annotation can be used as parameters to {@see Workflow::activity()} * and {@see WorkflowContextInterface::newActivityStub()} methods. * * Each method of the interface annotated with {@see LocalActivityInterface} diff --git a/src/Activity/LocalActivityOptions.php b/src/Activity/LocalActivityOptions.php index 85e801cd..7cdcae0d 100644 --- a/src/Activity/LocalActivityOptions.php +++ b/src/Activity/LocalActivityOptions.php @@ -23,9 +23,10 @@ /** * LocalActivityOptions stores all local activity-specific parameters that will be stored - * inside of a context. The current timeout resolution implementation is in - * seconds and uses `ceil($interval->s)` as the duration. But is subjected to - * change in the future. + * inside of a context. + * + * The current timeout resolution implementation is in seconds and uses `ceil($interval->s)` as the duration. + * But is subjected to change in the future. * * @psalm-import-type DateIntervalValue from DateInterval */ @@ -48,8 +49,9 @@ class LocalActivityOptions extends Options implements ActivityOptionsInterface public \DateInterval $startToCloseTimeout; /** - * RetryPolicy specifies how to retry an Activity if an error occurs. More - * details are available at {@link https://docs.temporal.io/docs/concepts/activities}. RetryPolicy + * RetryPolicy specifies how to retry an Activity if an error occurs. + * + * More details are available at {@link https://docs.temporal.io/docs/concepts/activities}. RetryPolicy * is optional. If one is not specified a default RetryPolicy is provided * by the server. * diff --git a/src/Client/GRPC/ServiceClient.php b/src/Client/GRPC/ServiceClient.php index 66462559..ad27982f 100644 --- a/src/Client/GRPC/ServiceClient.php +++ b/src/Client/GRPC/ServiceClient.php @@ -143,11 +143,9 @@ public function GetWorkflowExecutionHistory(V1\GetWorkflowExecutionHistoryReques * execution is * unknown to the service. * - * @param - * V1\GetWorkflowExecutionHistoryReverseRequest $arg + * @param V1\GetWorkflowExecutionHistoryReverseRequest $arg * @param ContextInterface|null $ctx - * @return - * V1\GetWorkflowExecutionHistoryReverseResponse + * @return V1\GetWorkflowExecutionHistoryReverseResponse * @throws ServiceClientException */ public function GetWorkflowExecutionHistoryReverse(V1\GetWorkflowExecutionHistoryReverseRequest $arg, ContextInterface $ctx = null) : V1\GetWorkflowExecutionHistoryReverseResponse @@ -284,8 +282,7 @@ public function RecordActivityTaskHeartbeat(V1\RecordActivityTaskHeartbeatReques * (-- api-linter: core::0136::prepositions=disabled * aip.dev/not-precedent: "By" is used to indicate request type. --) * - * @param V1\RecordActivityTaskHeartbeatByIdRequest - * $arg + * @param V1\RecordActivityTaskHeartbeatByIdRequest $arg * @param ContextInterface|null $ctx * @return V1\RecordActivityTaskHeartbeatByIdResponse * @throws ServiceClientException @@ -325,11 +322,9 @@ public function RespondActivityTaskCompleted(V1\RespondActivityTaskCompletedRequ * (-- api-linter: core::0136::prepositions=disabled * aip.dev/not-precedent: "By" is used to indicate request type. --) * - * @param V1\RespondActivityTaskCompletedByIdRequest - * $arg + * @param V1\RespondActivityTaskCompletedByIdRequest $arg * @param ContextInterface|null $ctx - * @return - * V1\RespondActivityTaskCompletedByIdResponse + * @return V1\RespondActivityTaskCompletedByIdResponse * @throws ServiceClientException */ public function RespondActivityTaskCompletedById(V1\RespondActivityTaskCompletedByIdRequest $arg, ContextInterface $ctx = null) : V1\RespondActivityTaskCompletedByIdResponse @@ -366,8 +361,7 @@ public function RespondActivityTaskFailed(V1\RespondActivityTaskFailedRequest $a * (-- api-linter: core::0136::prepositions=disabled * aip.dev/not-precedent: "By" is used to indicate request type. --) * - * @param V1\RespondActivityTaskFailedByIdRequest - * $arg + * @param V1\RespondActivityTaskFailedByIdRequest $arg * @param ContextInterface|null $ctx * @return V1\RespondActivityTaskFailedByIdResponse * @throws ServiceClientException @@ -406,8 +400,7 @@ public function RespondActivityTaskCanceled(V1\RespondActivityTaskCanceledReques * (-- api-linter: core::0136::prepositions=disabled * aip.dev/not-precedent: "By" is used to indicate request type. --) * - * @param V1\RespondActivityTaskCanceledByIdRequest - * $arg + * @param V1\RespondActivityTaskCanceledByIdRequest $arg * @param ContextInterface|null $ctx * @return V1\RespondActivityTaskCanceledByIdResponse * @throws ServiceClientException @@ -429,8 +422,7 @@ public function RespondActivityTaskCanceledById(V1\RespondActivityTaskCanceledBy * workflow is already closed. It fails with 'NotFound' if the requested workflow * doesn't exist. * - * @param V1\RequestCancelWorkflowExecutionRequest - * $arg + * @param V1\RequestCancelWorkflowExecutionRequest $arg * @param ContextInterface|null $ctx * @return V1\RequestCancelWorkflowExecutionResponse * @throws ServiceClientException @@ -475,11 +467,9 @@ public function SignalWorkflowExecution(V1\SignalWorkflowExecutionRequest $arg, * (-- api-linter: core::0136::prepositions=disabled * aip.dev/not-precedent: "With" is used to indicate combined operation. --) * - * @param V1\SignalWithStartWorkflowExecutionRequest - * $arg + * @param V1\SignalWithStartWorkflowExecutionRequest $arg * @param ContextInterface|null $ctx - * @return - * V1\SignalWithStartWorkflowExecutionResponse + * @return V1\SignalWithStartWorkflowExecutionResponse * @throws ServiceClientException */ public function SignalWithStartWorkflowExecution(V1\SignalWithStartWorkflowExecutionRequest $arg, ContextInterface $ctx = null) : V1\SignalWithStartWorkflowExecutionResponse @@ -590,8 +580,7 @@ public function ListWorkflowExecutions(V1\ListWorkflowExecutionsRequest $arg, Co * ListArchivedWorkflowExecutions is a visibility API to list archived workflow * executions in a specific namespace. * - * @param V1\ListArchivedWorkflowExecutionsRequest - * $arg + * @param V1\ListArchivedWorkflowExecutionsRequest $arg * @param ContextInterface|null $ctx * @return V1\ListArchivedWorkflowExecutionsResponse * @throws ServiceClientException @@ -894,11 +883,9 @@ public function ListSchedules(V1\ListSchedulesRequest $arg, ContextInterface $ct * aip.dev/not-precedent: UpdateWorkerBuildIdCompatibility RPC doesn't follow * Google API format. --) * - * @param V1\UpdateWorkerBuildIdCompatibilityRequest - * $arg + * @param V1\UpdateWorkerBuildIdCompatibilityRequest $arg * @param ContextInterface|null $ctx - * @return - * V1\UpdateWorkerBuildIdCompatibilityResponse + * @return V1\UpdateWorkerBuildIdCompatibilityResponse * @throws ServiceClientException */ public function UpdateWorkerBuildIdCompatibility(V1\UpdateWorkerBuildIdCompatibilityRequest $arg, ContextInterface $ctx = null) : V1\UpdateWorkerBuildIdCompatibilityResponse @@ -909,8 +896,7 @@ public function UpdateWorkerBuildIdCompatibility(V1\UpdateWorkerBuildIdCompatibi /** * Fetches the worker build id versioning sets for a task queue. * - * @param V1\GetWorkerBuildIdCompatibilityRequest - * $arg + * @param V1\GetWorkerBuildIdCompatibilityRequest $arg * @param ContextInterface|null $ctx * @return V1\GetWorkerBuildIdCompatibilityResponse * @throws ServiceClientException diff --git a/src/Client/GRPC/ServiceClientInterface.php b/src/Client/GRPC/ServiceClientInterface.php index 5a885ee1..7d703201 100644 --- a/src/Client/GRPC/ServiceClientInterface.php +++ b/src/Client/GRPC/ServiceClientInterface.php @@ -117,11 +117,9 @@ public function GetWorkflowExecutionHistory(V1\GetWorkflowExecutionHistoryReques * execution is * unknown to the service. * - * @param - * V1\GetWorkflowExecutionHistoryReverseRequest $arg + * @param V1\GetWorkflowExecutionHistoryReverseRequest $arg * @param ContextInterface|null $ctx - * @return - * V1\GetWorkflowExecutionHistoryReverseResponse + * @return V1\GetWorkflowExecutionHistoryReverseResponse * @throws ServiceClientException */ public function GetWorkflowExecutionHistoryReverse(V1\GetWorkflowExecutionHistoryReverseRequest $arg, ContextInterface $ctx = null) : V1\GetWorkflowExecutionHistoryReverseResponse; @@ -234,8 +232,7 @@ public function RecordActivityTaskHeartbeat(V1\RecordActivityTaskHeartbeatReques * (-- api-linter: core::0136::prepositions=disabled * aip.dev/not-precedent: "By" is used to indicate request type. --) * - * @param V1\RecordActivityTaskHeartbeatByIdRequest - * $arg + * @param V1\RecordActivityTaskHeartbeatByIdRequest $arg * @param ContextInterface|null $ctx * @return V1\RecordActivityTaskHeartbeatByIdResponse * @throws ServiceClientException @@ -267,11 +264,9 @@ public function RespondActivityTaskCompleted(V1\RespondActivityTaskCompletedRequ * (-- api-linter: core::0136::prepositions=disabled * aip.dev/not-precedent: "By" is used to indicate request type. --) * - * @param V1\RespondActivityTaskCompletedByIdRequest - * $arg + * @param V1\RespondActivityTaskCompletedByIdRequest $arg * @param ContextInterface|null $ctx - * @return - * V1\RespondActivityTaskCompletedByIdResponse + * @return V1\RespondActivityTaskCompletedByIdResponse * @throws ServiceClientException */ public function RespondActivityTaskCompletedById(V1\RespondActivityTaskCompletedByIdRequest $arg, ContextInterface $ctx = null) : V1\RespondActivityTaskCompletedByIdResponse; @@ -300,8 +295,7 @@ public function RespondActivityTaskFailed(V1\RespondActivityTaskFailedRequest $a * (-- api-linter: core::0136::prepositions=disabled * aip.dev/not-precedent: "By" is used to indicate request type. --) * - * @param V1\RespondActivityTaskFailedByIdRequest - * $arg + * @param V1\RespondActivityTaskFailedByIdRequest $arg * @param ContextInterface|null $ctx * @return V1\RespondActivityTaskFailedByIdResponse * @throws ServiceClientException @@ -332,8 +326,7 @@ public function RespondActivityTaskCanceled(V1\RespondActivityTaskCanceledReques * (-- api-linter: core::0136::prepositions=disabled * aip.dev/not-precedent: "By" is used to indicate request type. --) * - * @param V1\RespondActivityTaskCanceledByIdRequest - * $arg + * @param V1\RespondActivityTaskCanceledByIdRequest $arg * @param ContextInterface|null $ctx * @return V1\RespondActivityTaskCanceledByIdResponse * @throws ServiceClientException @@ -351,8 +344,7 @@ public function RespondActivityTaskCanceledById(V1\RespondActivityTaskCanceledBy * workflow is already closed. It fails with 'NotFound' if the requested workflow * doesn't exist. * - * @param V1\RequestCancelWorkflowExecutionRequest - * $arg + * @param V1\RequestCancelWorkflowExecutionRequest $arg * @param ContextInterface|null $ctx * @return V1\RequestCancelWorkflowExecutionResponse * @throws ServiceClientException @@ -389,11 +381,9 @@ public function SignalWorkflowExecution(V1\SignalWorkflowExecutionRequest $arg, * (-- api-linter: core::0136::prepositions=disabled * aip.dev/not-precedent: "With" is used to indicate combined operation. --) * - * @param V1\SignalWithStartWorkflowExecutionRequest - * $arg + * @param V1\SignalWithStartWorkflowExecutionRequest $arg * @param ContextInterface|null $ctx - * @return - * V1\SignalWithStartWorkflowExecutionResponse + * @return V1\SignalWithStartWorkflowExecutionResponse * @throws ServiceClientException */ public function SignalWithStartWorkflowExecution(V1\SignalWithStartWorkflowExecutionRequest $arg, ContextInterface $ctx = null) : V1\SignalWithStartWorkflowExecutionResponse; @@ -476,8 +466,7 @@ public function ListWorkflowExecutions(V1\ListWorkflowExecutionsRequest $arg, Co * ListArchivedWorkflowExecutions is a visibility API to list archived workflow * executions in a specific namespace. * - * @param V1\ListArchivedWorkflowExecutionsRequest - * $arg + * @param V1\ListArchivedWorkflowExecutionsRequest $arg * @param ContextInterface|null $ctx * @return V1\ListArchivedWorkflowExecutionsResponse * @throws ServiceClientException @@ -704,19 +693,16 @@ public function ListSchedules(V1\ListSchedulesRequest $arg, ContextInterface $ct * aip.dev/not-precedent: UpdateWorkerBuildIdCompatibility RPC doesn't follow * Google API format. --) * - * @param V1\UpdateWorkerBuildIdCompatibilityRequest - * $arg + * @param V1\UpdateWorkerBuildIdCompatibilityRequest $arg * @param ContextInterface|null $ctx - * @return - * V1\UpdateWorkerBuildIdCompatibilityResponse + * @return V1\UpdateWorkerBuildIdCompatibilityResponse * @throws ServiceClientException */ public function UpdateWorkerBuildIdCompatibility(V1\UpdateWorkerBuildIdCompatibilityRequest $arg, ContextInterface $ctx = null) : V1\UpdateWorkerBuildIdCompatibilityResponse; /** * Fetches the worker build id versioning sets for a task queue. * - * @param V1\GetWorkerBuildIdCompatibilityRequest - * $arg + * @param V1\GetWorkerBuildIdCompatibilityRequest $arg * @param ContextInterface|null $ctx * @return V1\GetWorkerBuildIdCompatibilityResponse * @throws ServiceClientException diff --git a/src/Client/Schedule/Info/ScheduleActionResult.php b/src/Client/Schedule/Info/ScheduleActionResult.php index c704986e..36135710 100644 --- a/src/Client/Schedule/Info/ScheduleActionResult.php +++ b/src/Client/Schedule/Info/ScheduleActionResult.php @@ -10,6 +10,8 @@ use Temporal\Workflow\WorkflowExecution; /** + * Describes the result of a scheduled action. + * * @see \Temporal\Api\Schedule\V1\ScheduleActionResult */ final class ScheduleActionResult diff --git a/src/Client/Schedule/Info/ScheduleDescription.php b/src/Client/Schedule/Info/ScheduleDescription.php index 35040abc..d1cf7064 100644 --- a/src/Client/Schedule/Info/ScheduleDescription.php +++ b/src/Client/Schedule/Info/ScheduleDescription.php @@ -9,8 +9,9 @@ use Temporal\Internal\Marshaller\Meta\Marshal; /** - * Describes the current Schedule details from {@see ScheduleHandle::describe()}. + * Describes the current Schedule details. * + * @see ScheduleHandle::describe() * @see \Temporal\Api\Workflowservice\V1\DescribeScheduleResponse */ final class ScheduleDescription diff --git a/src/Client/Schedule/Info/ScheduleListEntry.php b/src/Client/Schedule/Info/ScheduleListEntry.php index c9b63c89..505935da 100644 --- a/src/Client/Schedule/Info/ScheduleListEntry.php +++ b/src/Client/Schedule/Info/ScheduleListEntry.php @@ -8,8 +8,9 @@ use Temporal\Internal\Marshaller\Meta\Marshal; /** - * ScheduleListEntry is returned by {@see \Temporal\Client\ScheduleClientInterface::listSchedules()}. + * ScheduleListEntry is returned by `listSchedules` method. * + * @see \Temporal\Client\ScheduleClientInterface::listSchedules() * @see \Temporal\Api\Schedule\V1\ScheduleListEntry */ final class ScheduleListEntry diff --git a/src/Client/Schedule/Info/ScheduleListInfo.php b/src/Client/Schedule/Info/ScheduleListInfo.php index 9dda9c5f..ecb4a2cc 100644 --- a/src/Client/Schedule/Info/ScheduleListInfo.php +++ b/src/Client/Schedule/Info/ScheduleListInfo.php @@ -10,6 +10,8 @@ use Temporal\Workflow\WorkflowType; /** + * Describes information about a schedule list. + * * @see \Temporal\Api\Schedule\V1\ScheduleListInfo */ final class ScheduleListInfo diff --git a/src/Client/Schedule/Policy/SchedulePolicies.php b/src/Client/Schedule/Policy/SchedulePolicies.php index 965d2b3f..3dba4d73 100644 --- a/src/Client/Schedule/Policy/SchedulePolicies.php +++ b/src/Client/Schedule/Policy/SchedulePolicies.php @@ -10,6 +10,8 @@ use Temporal\Internal\Traits\CloneWith; /** + * Schedule policies. + * * @psalm-import-type DateIntervalValue from DateInterval * * @see \Temporal\Api\Schedule\V1\SchedulePolicies diff --git a/src/Client/Schedule/Schedule.php b/src/Client/Schedule/Schedule.php index f645b9f6..9e1d4d80 100644 --- a/src/Client/Schedule/Schedule.php +++ b/src/Client/Schedule/Schedule.php @@ -14,6 +14,8 @@ use Temporal\Internal\Traits\CloneWith; /** + * DTO with complete schedule details. + * * @see \Temporal\Api\Schedule\V1\Schedule */ final class Schedule @@ -50,6 +52,8 @@ public static function new(): self } /** + * Returns a new instance with the specified action. + * * Available types of actions: * - {@see StartWorkflowAction} - start a Workflow */ diff --git a/src/Client/Schedule/Spec/CalendarSpec.php b/src/Client/Schedule/Spec/CalendarSpec.php index f81c8a8a..702db808 100644 --- a/src/Client/Schedule/Spec/CalendarSpec.php +++ b/src/Client/Schedule/Spec/CalendarSpec.php @@ -9,8 +9,9 @@ /** * CalendarSpec describes an event specification relative to the calendar, - * similar to a traditional cron specification, but with labeled fields. Each - * field can be one of: + * similar to a traditional cron specification, but with labeled fields. + * + * Each field can be one of: * - *: matches always * - x: matches when the field equals x * - x/y: matches when the field equals x+n*y where n is an integer diff --git a/src/Client/Schedule/Spec/IntervalSpec.php b/src/Client/Schedule/Spec/IntervalSpec.php index 9895842f..8bade28e 100644 --- a/src/Client/Schedule/Spec/IntervalSpec.php +++ b/src/Client/Schedule/Spec/IntervalSpec.php @@ -10,9 +10,8 @@ use Temporal\Internal\Traits\CloneWith; /** - * IntervalSpec matches times that can be expressed as: - * epoch + n * interval + phase - * where n is an integer. + * IntervalSpec matches times that can be expressed as: epoch + n * interval + phase where n is an integer. + * * {@see self::$pahse} defaults to zero if missing. {@see self::$interval} is required. * Both interval and phase must be non-negative and are truncated to the nearest * second before any calculations. diff --git a/src/Client/Schedule/Spec/Range.php b/src/Client/Schedule/Spec/Range.php index 8692ceee..b99a23e6 100644 --- a/src/Client/Schedule/Spec/Range.php +++ b/src/Client/Schedule/Spec/Range.php @@ -9,7 +9,9 @@ /** * Range represents a set of integer values, used to match fields of a calendar - * time in StructuredCalendarSpec. If end < start, then end is interpreted as + * time in StructuredCalendarSpec. + * + * If end < start, then end is interpreted as * equal to start. This means you can use a Range with start set to a value, and * end and step unset (defaulting to 0) to represent a single value. * diff --git a/src/Client/Schedule/Spec/ScheduleSpec.php b/src/Client/Schedule/Spec/ScheduleSpec.php index 3ad38b34..3c921f37 100644 --- a/src/Client/Schedule/Spec/ScheduleSpec.php +++ b/src/Client/Schedule/Spec/ScheduleSpec.php @@ -16,8 +16,9 @@ /** * ScheduleSpec is a complete description of a set of absolute timestamps - * (possibly infinite) that an action should occur at. The meaning of a - * ScheduleSpec depends only on its contents and never changes, except that the + * (possibly infinite) that an action should occur at. + * + * The meaning of a ScheduleSpec depends only on its contents and never changes, except that the * definition of a time zone can change over time (most commonly, when daylight * saving time policy changes for an area). To create a totally self-contained * ScheduleSpec, use UTC or include {@see self::$timezoneData}. diff --git a/src/Client/Schedule/Spec/ScheduleState.php b/src/Client/Schedule/Spec/ScheduleState.php index 0afc9b2f..8572d163 100644 --- a/src/Client/Schedule/Spec/ScheduleState.php +++ b/src/Client/Schedule/Spec/ScheduleState.php @@ -31,6 +31,8 @@ final class ScheduleState public readonly bool $paused; /** + * Indicates if limited actions are enabled. + * * If {@see self::$limitedActions} is true, decrement {@see self::$remainingActions} after each * action, and do not take any more scheduled actions if {@see self::$remainingActions} * is zero. Actions may still be taken by explicit request (i.e. trigger @@ -78,6 +80,8 @@ public function withPaused(bool $paused): self } /** + * Set whether limited actions are enabled. + * * If {@see self::$limitedActions} is true, decrement {@see self::$remainingActions} after each * action, and do not take any more scheduled actions if {@see self::$remainingActions} * is zero. Actions may still be taken by explicit request (i.e. trigger diff --git a/src/Client/Update/LifecycleStage.php b/src/Client/Update/LifecycleStage.php index 2f6ed025..78cb668a 100644 --- a/src/Client/Update/LifecycleStage.php +++ b/src/Client/Update/LifecycleStage.php @@ -7,6 +7,7 @@ /** * Specified by clients invoking workflow execution updates and used to indicate to the * server how long the client wishes to wait for a return value from the RPC. + * * If any value other than {@see LifecycleStage::StageCompleted} is sent by the * client then the RPC will complete before the update is finished and will * return a handle to the running update so that it can later be polled for diff --git a/src/Client/WorkflowClientInterface.php b/src/Client/WorkflowClientInterface.php index e11bd334..e899e960 100644 --- a/src/Client/WorkflowClientInterface.php +++ b/src/Client/WorkflowClientInterface.php @@ -50,9 +50,9 @@ public function startWithSignal( ): WorkflowRunInterface; /** - * Creates workflow client stub that can be used to start a single workflow - * execution. The first call must be to a method annotated - * with {@see WorkflowMethod}. After workflow is started it can be also + * Creates workflow client stub that can be used to start a single workflow execution. + * + * The first call must be to a method annotated with {@see WorkflowMethod}. After workflow is started it can be also * used to send signals or queries to it. * * Use WorkflowClient->start($workflowStub, ...$args) to start workflow asynchronously. @@ -119,9 +119,12 @@ public function newUntypedRunningWorkflowStub( ): WorkflowStubInterface; /** - * Creates a new {@link ActivityCompletionClient} that can be used to complete activities - * asynchronously. Only relevant for activity implementations that called {@link - * ActivityContext->doNotCompleteOnReturn()}. + * Creates a new `ActivityCompletionClient` that can be used to complete activities + * asynchronously. + * + * Only relevant for activity implementations that called {@see ActivityContext::doNotCompleteOnReturn()}. + * + * @see ActivityCompletionClient * * @return ActivityCompletionClientInterface */ diff --git a/src/Client/WorkflowExecutionHistory.php b/src/Client/WorkflowExecutionHistory.php index e49da549..3d6601e9 100644 --- a/src/Client/WorkflowExecutionHistory.php +++ b/src/Client/WorkflowExecutionHistory.php @@ -14,7 +14,9 @@ /** * Provides a wrapper with convenience methods over raw protobuf object representing - * workflow history {@see History} + * workflow history. + * + * @see History * * @implements IteratorAggregate * @internal @@ -57,8 +59,10 @@ public function getIterator(): Traversable } /** - * Returns {@see History} object with all the events inside. + * Returns history object with all the events inside. * The returned object may be used to replay the workflow via {@see WorkflowReplayer::replayHistory()}. + * + * @see History */ public function getHistory(): History { diff --git a/src/Client/WorkflowOptions.php b/src/Client/WorkflowOptions.php index 085f06aa..4c4dc9b0 100644 --- a/src/Client/WorkflowOptions.php +++ b/src/Client/WorkflowOptions.php @@ -98,8 +98,8 @@ final class WorkflowOptions extends Options public \DateInterval $workflowTaskTimeout; /** - * Whether server allow reuse of workflow ID, can be useful for dedup logic - * if set to {@see IdReusePolicy::POLICY_REJECT_DUPLICATE}. + * Whether server allow reuse of workflow ID, can be useful for deduplication logic. + * If set to {@see IdReusePolicy::POLICY_REJECT_DUPLICATE}. */ #[Marshal(name: 'WorkflowIDReusePolicy')] public int $workflowIdReusePolicy = IdReusePolicy::POLICY_ALLOW_DUPLICATE_FAILED_ONLY; diff --git a/src/Client/WorkflowStubInterface.php b/src/Client/WorkflowStubInterface.php index 7e7c7f7e..5f221533 100644 --- a/src/Client/WorkflowStubInterface.php +++ b/src/Client/WorkflowStubInterface.php @@ -22,8 +22,9 @@ use Temporal\Workflow\WorkflowRunInterface; /** - * WorkflowStub is a client side stub to a single workflow instance. It can be - * used to start, signal, query, wait for completion and cancel a workflow + * WorkflowStub is a client side stub to a single workflow instance. + * + * It can be used to start, signal, query, wait for completion and cancel a workflow * execution. Created through {@see WorkflowClient::newUntypedWorkflowStub()}. */ interface WorkflowStubInterface extends WorkflowRunInterface @@ -71,8 +72,9 @@ public function setExecution(WorkflowExecution $execution): void; public function signal(string $name, ...$args): void; /** - * Synchronously queries workflow by invoking its query handler. Usually a - * query handler is a method annotated with {@see QueryMethod}. + * Synchronously queries workflow by invoking its query handler. + * + * Usually a query handler is a method annotated with {@see QueryMethod}. * * @param string $name * @param mixed ...$args @@ -82,6 +84,7 @@ public function query(string $name, ...$args): ?ValuesInterface; /** * Synchronously update a workflow execution by invoking its update handler. + * * Usually an update handler is a method annotated with the {@see UpdateMethod} attribute. * * @param non-empty-string $name Name of the update handler. @@ -93,6 +96,7 @@ public function update(string $name, ...$args): ?ValuesInterface; /** * Asynchronously update a workflow execution by invoking its update handler and returning a * handle to the update request. + * * Usually an update handler is a method annotated with the {@see UpdateMethod} attribute. * * @param non-empty-string|UpdateOptions $nameOrOptions Name of the update handler or update options. diff --git a/src/Interceptor/ActivityInboundInterceptor.php b/src/Interceptor/ActivityInboundInterceptor.php index f2f0af07..b63fcb86 100644 --- a/src/Interceptor/ActivityInboundInterceptor.php +++ b/src/Interceptor/ActivityInboundInterceptor.php @@ -16,14 +16,17 @@ use Temporal\Internal\Interceptor\Interceptor; /** - * It's recommended to use {@see ActivityInboundInterceptorTrait} when implementing this interface because + * It's recommended to use `ActivityInboundInterceptorTrait` when implementing this interface because * the interface might be extended in the future. The trait will provide forward compatibility. * + * @see ActivityInboundInterceptorTrait * @psalm-immutable */ interface ActivityInboundInterceptor extends Interceptor { /** + * Intercepts a call to the main activity entry method. + * * @param ActivityInput $input * @param callable(ActivityInput): mixed $next * diff --git a/src/Interceptor/Header.php b/src/Interceptor/Header.php index ca92955c..9ace0fe4 100644 --- a/src/Interceptor/Header.php +++ b/src/Interceptor/Header.php @@ -17,8 +17,9 @@ final class Header extends EncodedCollection implements HeaderInterface { /** - * Build a {@see ProtoHeader} message. + * Build a `ProtoHeader` message. * + * @see ProtoHeader * @internal */ public function toHeader(): ProtoHeader diff --git a/src/Interceptor/PipelineProvider.php b/src/Interceptor/PipelineProvider.php index f05d6c20..f5c3afc7 100644 --- a/src/Interceptor/PipelineProvider.php +++ b/src/Interceptor/PipelineProvider.php @@ -15,7 +15,10 @@ use Temporal\Internal\Interceptor\Pipeline; /** - * Provide {@see Pipeline} of specific type of {@see Interceptor}. + * Provide `Pipeline` of specific type of `Interceptor`. + * + * @see Pipeline + * @see Interceptor */ interface PipelineProvider { diff --git a/src/Interceptor/Trait/ActivityInboundInterceptorTrait.php b/src/Interceptor/Trait/ActivityInboundInterceptorTrait.php index e99ba2ce..125e907c 100644 --- a/src/Interceptor/Trait/ActivityInboundInterceptorTrait.php +++ b/src/Interceptor/Trait/ActivityInboundInterceptorTrait.php @@ -15,11 +15,15 @@ use Temporal\Interceptor\ActivityInboundInterceptor; /** - * Implements {@see ActivityInboundInterceptor} + * Trait that provides a default interceptor implementation. + * + * @see ActivityInboundInterceptor */ trait ActivityInboundInterceptorTrait { /** + * Default implementation of the `handleActivityInbound` method. + * * @see ActivityInboundInterceptor::handleActivityInbound() */ public function handleActivityInbound(ActivityInput $input, callable $next): mixed diff --git a/src/Interceptor/Trait/WorkflowClientCallsInterceptorTrait.php b/src/Interceptor/Trait/WorkflowClientCallsInterceptorTrait.php index ff393752..bab1355f 100644 --- a/src/Interceptor/Trait/WorkflowClientCallsInterceptorTrait.php +++ b/src/Interceptor/Trait/WorkflowClientCallsInterceptorTrait.php @@ -25,11 +25,15 @@ use Temporal\Workflow\WorkflowExecution; /** - * Implements {@see WorkflowClientCallsInterceptor} + * Trait that provides a default interceptor implementation. + * + * @see WorkflowClientCallsInterceptor */ trait WorkflowClientCallsInterceptorTrait { /** + * Default implementation of the `start` method. + * * @see WorkflowClientCallsInterceptor::start() */ public function start(StartInput $input, callable $next): WorkflowExecution @@ -38,6 +42,8 @@ public function start(StartInput $input, callable $next): WorkflowExecution } /** + * Default implementation of the `signal` method. + * * @see WorkflowClientCallsInterceptor::signal() */ public function signal(SignalInput $input, callable $next): void @@ -46,6 +52,8 @@ public function signal(SignalInput $input, callable $next): void } /** + * Default implementation of the `update` method. + * * @see WorkflowClientCallsInterceptor::update() */ public function update(UpdateInput $input, callable $next): StartUpdateOutput @@ -54,6 +62,8 @@ public function update(UpdateInput $input, callable $next): StartUpdateOutput } /** + * Default implementation of the `signalWithStart` method. + * * @see WorkflowClientCallsInterceptor::signalWithStart() */ public function signalWithStart(SignalWithStartInput $input, callable $next): WorkflowExecution @@ -62,6 +72,8 @@ public function signalWithStart(SignalWithStartInput $input, callable $next): Wo } /** + * Default implementation of the `getResult` method. + * * @see WorkflowClientCallsInterceptor::getResult() */ public function getResult(GetResultInput $input, callable $next): ?EncodedValues @@ -70,6 +82,8 @@ public function getResult(GetResultInput $input, callable $next): ?EncodedValues } /** + * Default implementation of the `query` method. + * * @see WorkflowClientCallsInterceptor::query() */ public function query(QueryInput $input, callable $next): ?EncodedValues @@ -78,6 +92,8 @@ public function query(QueryInput $input, callable $next): ?EncodedValues } /** + * Default implementation of the `cancel` method. + * * @see WorkflowClientCallsInterceptor::cancel() */ public function cancel(CancelInput $input, callable $next): void @@ -86,6 +102,8 @@ public function cancel(CancelInput $input, callable $next): void } /** + * Default implementation of the `terminate` method. + * * @see WorkflowClientCallsInterceptor::terminate() */ public function terminate(TerminateInput $input, callable $next): void diff --git a/src/Interceptor/Trait/WorkflowInboundCallsInterceptorTrait.php b/src/Interceptor/Trait/WorkflowInboundCallsInterceptorTrait.php index a343ac05..6105404c 100644 --- a/src/Interceptor/Trait/WorkflowInboundCallsInterceptorTrait.php +++ b/src/Interceptor/Trait/WorkflowInboundCallsInterceptorTrait.php @@ -18,11 +18,15 @@ use Temporal\Interceptor\WorkflowInboundCallsInterceptor; /** - * Implements {@see WorkflowInboundCallsInterceptor} + * Trait that provides a default interceptor implementation. + * + * @see WorkflowInboundCallsInterceptor */ trait WorkflowInboundCallsInterceptorTrait { /** + * Default implementation of the `execute` method. + * * @see WorkflowInboundCallsInterceptor::execute() */ public function execute(WorkflowInput $input, callable $next): void @@ -31,6 +35,8 @@ public function execute(WorkflowInput $input, callable $next): void } /** + * Default implementation of the `handleSignal` method. + * * @see WorkflowInboundCallsInterceptor::handleSignal() */ public function handleSignal(SignalInput $input, callable $next): void @@ -39,6 +45,8 @@ public function handleSignal(SignalInput $input, callable $next): void } /** + * Default implementation of the `handleQuery` method. + * * @see WorkflowInboundCallsInterceptor::handleQuery() */ public function handleQuery(QueryInput $input, callable $next): mixed @@ -47,6 +55,8 @@ public function handleQuery(QueryInput $input, callable $next): mixed } /** + * Default implementation of the `handleUpdate` method. + * * @see WorkflowInboundCallsInterceptor::handleUpdate() */ public function handleUpdate(UpdateInput $input, callable $next): mixed @@ -55,7 +65,9 @@ public function handleUpdate(UpdateInput $input, callable $next): mixed } /** - * @see WorkflowInboundCallsInterceptor::handleUpdate() + * Default implementation of the `validateUpdate` method. + * + * @see WorkflowInboundCallsInterceptor::validateUpdate() */ public function validateUpdate(UpdateInput $input, callable $next): void { diff --git a/src/Interceptor/Trait/WorkflowOutboundCallsInterceptorTrait.php b/src/Interceptor/Trait/WorkflowOutboundCallsInterceptorTrait.php index 3bea8f01..e3d91dc3 100644 --- a/src/Interceptor/Trait/WorkflowOutboundCallsInterceptorTrait.php +++ b/src/Interceptor/Trait/WorkflowOutboundCallsInterceptorTrait.php @@ -29,11 +29,15 @@ use Temporal\Interceptor\WorkflowOutboundCallsInterceptor; /** - * Implements {@see WorkflowOutboundCallsInterceptor} + * Trait that provides a default interceptor implementation. + * + * @see WorkflowOutboundCallsInterceptor */ trait WorkflowOutboundCallsInterceptorTrait { /** + * Default implementation of the `executeActivity` method. + * * @see WorkflowOutboundCallsInterceptor::executeActivity() */ public function executeActivity( @@ -44,6 +48,8 @@ public function executeActivity( } /** + * Default implementation of the `executeLocalActivity` method. + * * @see WorkflowOutboundCallsInterceptor::executeLocalActivity() */ public function executeLocalActivity(ExecuteLocalActivityInput $input, callable $next): PromiseInterface @@ -52,6 +58,8 @@ public function executeLocalActivity(ExecuteLocalActivityInput $input, callable } /** + * Default implementation of the `executeChildWorkflow` method. + * * @see WorkflowOutboundCallsInterceptor::executeChildWorkflow() */ public function executeChildWorkflow(ExecuteChildWorkflowInput $input, callable $next): PromiseInterface @@ -60,6 +68,8 @@ public function executeChildWorkflow(ExecuteChildWorkflowInput $input, callable } /** + * Default implementation of the `signalExternalWorkflow` method. + * * @see WorkflowOutboundCallsInterceptor::signalExternalWorkflow() */ public function signalExternalWorkflow(SignalExternalWorkflowInput $input, callable $next): PromiseInterface @@ -68,6 +78,8 @@ public function signalExternalWorkflow(SignalExternalWorkflowInput $input, calla } /** + * Default implementation of the `cancelExternalWorkflow` method. + * * @see WorkflowOutboundCallsInterceptor::cancelExternalWorkflow() */ public function cancelExternalWorkflow(CancelExternalWorkflowInput $input, callable $next): PromiseInterface @@ -76,6 +88,8 @@ public function cancelExternalWorkflow(CancelExternalWorkflowInput $input, calla } /** + * Default implementation of the `sideEffect` method. + * * @see WorkflowOutboundCallsInterceptor::sideEffect() */ public function sideEffect(SideEffectInput $input, callable $next): mixed @@ -84,6 +98,8 @@ public function sideEffect(SideEffectInput $input, callable $next): mixed } /** + * Default implementation of the `timer` method. + * * @see WorkflowOutboundCallsInterceptor::timer() */ public function timer(TimerInput $input, callable $next): PromiseInterface @@ -92,6 +108,8 @@ public function timer(TimerInput $input, callable $next): PromiseInterface } /** + * Default implementation of the `panic` method. + * * @see WorkflowOutboundCallsInterceptor::panic() */ public function panic(PanicInput $input, callable $next): PromiseInterface @@ -100,6 +118,8 @@ public function panic(PanicInput $input, callable $next): PromiseInterface } /** + * Default implementation of the `complete` method. + * * @see WorkflowOutboundCallsInterceptor::complete() */ public function complete(CompleteInput $input, callable $next): PromiseInterface @@ -108,6 +128,8 @@ public function complete(CompleteInput $input, callable $next): PromiseInterface } /** + * Default implementation of the `continueAsNew` method. + * * @see WorkflowOutboundCallsInterceptor::continueAsNew() */ public function continueAsNew(ContinueAsNewInput $input, callable $next): PromiseInterface @@ -116,6 +138,8 @@ public function continueAsNew(ContinueAsNewInput $input, callable $next): Promis } /** + * Default implementation of the `getVersion` method. + * * @see WorkflowOutboundCallsInterceptor::getVersion() */ public function getVersion(GetVersionInput $input, callable $next): PromiseInterface @@ -124,6 +148,8 @@ public function getVersion(GetVersionInput $input, callable $next): PromiseInter } /** + * Default implementation of the `upsertSearchAttributes` method. + * * @see WorkflowOutboundCallsInterceptor::upsertSearchAttributes() */ public function upsertSearchAttributes(UpsertSearchAttributesInput $input, callable $next): PromiseInterface @@ -132,6 +158,8 @@ public function upsertSearchAttributes(UpsertSearchAttributesInput $input, calla } /** + * Default implementation of the `await` method. + * * @see WorkflowOutboundCallsInterceptor::await() */ public function await(AwaitInput $input, callable $next): PromiseInterface @@ -140,6 +168,8 @@ public function await(AwaitInput $input, callable $next): PromiseInterface } /** + * Default implementation of the `awaitWithTimeout` method. + * * @see WorkflowOutboundCallsInterceptor::awaitWithTimeout() */ public function awaitWithTimeout(AwaitWithTimeoutInput $input, callable $next): PromiseInterface diff --git a/src/Interceptor/Trait/WorkflowOutboundRequestInterceptorTrait.php b/src/Interceptor/Trait/WorkflowOutboundRequestInterceptorTrait.php index fcbb2a01..33125b38 100644 --- a/src/Interceptor/Trait/WorkflowOutboundRequestInterceptorTrait.php +++ b/src/Interceptor/Trait/WorkflowOutboundRequestInterceptorTrait.php @@ -28,13 +28,15 @@ use Temporal\Worker\Transport\Command\RequestInterface; /** - * Interceptor for outbound workflow requests. + * Trait that provides a default interceptor implementation. * - * Implements {@see WorkflowOutboundRequestInterceptor} + * @see WorkflowOutboundRequestInterceptor */ trait WorkflowOutboundRequestInterceptorTrait { /** + * Default implementation of the `handleOutboundRequest` method. + * * @see WorkflowOutboundRequestInterceptor::handleOutboundRequest() */ final public function handleOutboundRequest(RequestInterface $request, callable $next): PromiseInterface diff --git a/src/Interceptor/WorkflowClientCallsInterceptor.php b/src/Interceptor/WorkflowClientCallsInterceptor.php index b653a6e2..5da7a1c5 100644 --- a/src/Interceptor/WorkflowClientCallsInterceptor.php +++ b/src/Interceptor/WorkflowClientCallsInterceptor.php @@ -26,9 +26,24 @@ use Temporal\Workflow\WorkflowExecution; /** - * It's recommended to use {@see WorkflowClientCallsInterceptorTrait} when implementing this interface because + * It's recommended to use `WorkflowClientCallsInterceptorTrait` when implementing this interface because * the interface might be extended in the future. The trait will provide forward compatibility. * + * ```php + * class MyWorkflowClientCallsInterceptor implements WorkflowClientCallsInterceptor + * { + * use WorkflowClientCallsInterceptorTrait; + * + * public function start(StartInput $input, callable $next): WorkflowExecution + * { + * error_log('Starting workflow: ' . $input->workflowType); + * + * return $next($input); + * } + * } + * ``` + * + * @see WorkflowClientCallsInterceptorTrait * @psalm-immutable */ interface WorkflowClientCallsInterceptor extends Interceptor diff --git a/src/Interceptor/WorkflowInboundCallsInterceptor.php b/src/Interceptor/WorkflowInboundCallsInterceptor.php index 35d61f42..651eee8d 100644 --- a/src/Interceptor/WorkflowInboundCallsInterceptor.php +++ b/src/Interceptor/WorkflowInboundCallsInterceptor.php @@ -19,9 +19,24 @@ use Temporal\Internal\Interceptor\Interceptor; /** - * It's recommended to use {@see WorkflowInboundCallsInterceptorTrait} when implementing this interface because + * It's recommended to use `WorkflowInboundCallsInterceptorTrait` when implementing this interface because * the interface might be extended in the future. The trait will provide forward compatibility. * + * ```php + * class MyWorkflowInboundCallsInterceptor implements WorkflowInboundCallsInterceptor + * { + * use WorkflowInboundCallsInterceptorTrait; + * + * public function handleSignal(SignalInput $input, callable $next): void + * { + * error_log('Workflow received signal: ' . $input->signalName); + * + * $next($input); + * } + * } + * ``` + * + * @see WorkflowInboundCallsInterceptorTrait * @psalm-immutable */ interface WorkflowInboundCallsInterceptor extends Interceptor diff --git a/src/Interceptor/WorkflowOutboundCallsInterceptor.php b/src/Interceptor/WorkflowOutboundCallsInterceptor.php index 9f2c819d..4319a7ab 100644 --- a/src/Interceptor/WorkflowOutboundCallsInterceptor.php +++ b/src/Interceptor/WorkflowOutboundCallsInterceptor.php @@ -35,6 +35,22 @@ * It's recommended to use {@see WorkflowOutboundCallsInterceptorTrait} when implementing this interface because * the interface might be extended in the future. The trait will provide forward compatibility. * + * ```php + * class MyWorkflowOutboundCallsInterceptor implements WorkflowOutboundCallsInterceptor + * { + * use WorkflowOutboundCallsInterceptorTrait; + * + * public function executeActivity( + * ExecuteActivityInput $input, + * callable $next, + * ): PromiseInterface { + * error_log('Calling activity: ' . $input->type); + * + * return $next($input); + * } + * } + * ``` + * * @psalm-immutable */ interface WorkflowOutboundCallsInterceptor extends Interceptor diff --git a/src/Interceptor/WorkflowOutboundRequestInterceptor.php b/src/Interceptor/WorkflowOutboundRequestInterceptor.php index 2e8a6679..5797abda 100644 --- a/src/Interceptor/WorkflowOutboundRequestInterceptor.php +++ b/src/Interceptor/WorkflowOutboundRequestInterceptor.php @@ -22,6 +22,20 @@ * It's recommended to use {@see WorkflowOutboundRequestInterceptorTrait} when implementing this interface because * the interface might be extended in the future. The trait will provide forward compatibility. * + * ```php + * class MyWorkflowOutboundRequestInterceptor implements WorkflowOutboundRequestInterceptor + * { + * use WorkflowOutboundRequestInterceptorTrait; + * + * private function executeActivityRequest(ExecuteActivity $request, callable $next): PromiseInterface + * { + * error_log('Starting activity: ' . $request->getActivityName()); + * + * return $next($request); + * } + * } + * ``` + * * @psalm-immutable */ interface WorkflowOutboundRequestInterceptor extends Interceptor diff --git a/src/Promise.php b/src/Promise.php index 5c0f25cd..dba038fc 100644 --- a/src/Promise.php +++ b/src/Promise.php @@ -29,10 +29,10 @@ final class Promise { /** - * Returns a promise that will resolve only once all the items - * in `$promises` have resolved. The resolution value of the returned - * promise will be an array containing the resolution values of each of the - * items in `$promises`. + * Returns a promise that resolves when all items in `$promises` have resolved. + * + * The returned promise's resolution value will be an array containing + * the resolution values of each item in `$promises`. * * @param iterable $promises * @return PromiseInterface @@ -43,15 +43,14 @@ public static function all(iterable $promises): PromiseInterface } /** - * Returns a promise that will resolve when any one of the items in - * `$promises` resolves. The resolution value of the returned promise will - * be the resolution value of the triggering item. + * Returns a promise that resolves when any item in `$promises` resolves. * - * The returned promise will only reject if *all* items in `$promises` are - * rejected. The rejection value will be an array of all rejection reasons. + * The returned promise's resolution value will be the resolution value of + * the triggering item. If **all** items in `$promises` are rejected, the + * returned promise will reject with an array of all rejection reasons. * - * The returned promise will also reject with a {@see LengthException} if - * `$promises` contains 0 items. + * If `$promises` is empty, the returned promise will reject with a + * {@see LengthException}. * * @param iterable $promises * @return PromiseInterface @@ -63,18 +62,18 @@ public static function any(iterable $promises): PromiseInterface } /** - * Returns a promise that will resolve when `$count` of the supplied items - * in `$promises` resolve. The resolution value of the returned promise - * will be an array of length `$count` containing the resolution values - * of the triggering items. + * Returns a promise that resolves when `$count` items in `$promises` resolve. + * + * The returned promise's resolution value will be an array of length `$count` + * containing the resolution values of the triggering items. * - * The returned promise will reject if it becomes impossible for `$count` - * items to resolve (that is, when `(count($promises) - $count) + 1` items - * reject). The rejection value will be an iterable-exception of - * `(count($promises) - $howMany) + 1` rejection reasons. + * If it becomes impossible for `$count` items to resolve (i.e., when + * `(count($promises) - $count) + 1` items reject), the returned promise will + * reject with an iterable exception of `(count($promises) - $howMany) + 1` + * rejection reasons. * - * The returned promise will also reject with a {@see LengthException} if - * `$promises` contains less items than `$count`. + * If `$promises` contains fewer items than `$count`, the returned promise will + * reject with a {@see LengthException}. * * @param iterable $promises * @param int $count @@ -149,12 +148,13 @@ static function (iterable $array) use ($count, $cancellationQueue, $resolve, $re } /** - * Traditional map function, similar to `array_map()`, but allows input to - * contain promises and/or values, and `$callback` may return either a - * value or a promise. + * Applies a callback function to each item in `$promises`. * - * The map function receives each item as argument, where item is a fully - * resolved value of a promise or value in `$promises`. + * This function behaves like `array_map()`, but it can handle input containing + * promises and/or values, and the `$callback` may return either a value or a promise. + * + * The `$callback` function receives each item as an argument, where the item is + * a fully resolved value of a promise or a value in `$promises`. * * @psalm-param PromiseMapCallback $map * @param iterable $promises @@ -201,10 +201,11 @@ static function (mixed $mapped) use ($i, &$values, &$toResolve, $resolve): void } /** - * Traditional reduce function, similar to `array_reduce()`, but input may - * contain promises and/or values, and `$reduce` may return either a value - * or a promise, *and* `$initial` may be a promise or a value for the - * starting value. + * Applies a callback function to each item in `$promises`, reducing them to a single value. + * + * This function behaves like `array_reduce()`, but it can handle input containing + * promises and/or values. The `$reduce` callback may return either a value or a promise, + * and `$initial` may be a promise or a value for the starting value. * * @psalm-param PromiseReduceCallback $reduce * @param iterable $promises diff --git a/src/Worker/ChildWorkflowCancellationType.php b/src/Worker/ChildWorkflowCancellationType.php index c4161140..69fa1071 100644 --- a/src/Worker/ChildWorkflowCancellationType.php +++ b/src/Worker/ChildWorkflowCancellationType.php @@ -12,11 +12,11 @@ namespace Temporal\Worker; /** - * Defines behaviour of the parent workflow when {@see CancellationScope} - * that wraps child workflow execution request is canceled. The result of - * the cancellation independently of the type is - * a {@see ChildWorkflowCancellationType} thrown from the child - * workflow method. + * Defines behaviour of the parent workflow when CancellationScope that wraps child workflow execution request + * is canceled. + * + * The result of the cancellation independently of the type is a {@see ChildWorkflowCancellationType} thrown + * from the child workflow method. */ final class ChildWorkflowCancellationType { diff --git a/src/Worker/LoopInterface.php b/src/Worker/LoopInterface.php index 4c7c82a2..b499e312 100644 --- a/src/Worker/LoopInterface.php +++ b/src/Worker/LoopInterface.php @@ -14,8 +14,7 @@ use Temporal\Internal\Events\EventListenerInterface; /** - * The {@see LoopInterface} is responsible for providing an interface for - * creating an event loop. + * The interface is responsible for providing an interface for creating an event loop. * * Besides defining a few methods, this interface also implements * the {@see EventListenerInterface} which allows you to react to certain events. diff --git a/src/Worker/WorkerFactoryInterface.php b/src/Worker/WorkerFactoryInterface.php index d32b91a1..370fd48c 100644 --- a/src/Worker/WorkerFactoryInterface.php +++ b/src/Worker/WorkerFactoryInterface.php @@ -12,12 +12,13 @@ namespace Temporal\Worker; /** - * The {@see WorkerFactoryInterface} is responsible for providing an - * interface for registering all dependencies and creating a global - * event loop ({@see LoopInterface}). + * The interface is responsible for providing an interface for registering all dependencies and creating a global + * event loop. * * In addition, implementation of this interface is responsible for delegating * events that came from the Temporal server to a specific TaskQueue. + * + * @see LoopInterface */ interface WorkerFactoryInterface { diff --git a/src/Worker/WorkerInterface.php b/src/Worker/WorkerInterface.php index c97ce420..dcb28463 100644 --- a/src/Worker/WorkerInterface.php +++ b/src/Worker/WorkerInterface.php @@ -52,11 +52,12 @@ public function registerActivityFinalizer(Closure $finalizer): self; public function getWorkflows(): iterable; /** - * @deprecated use registerActivity() instead - * @see \Temporal\Worker\WorkerInterface::registerActivity() * Register one or multiple activity instances to be served by worker task queue. Activity implementation must * be stateless. * + * @see WorkerInterface::registerActivity + * @deprecated use {@see registerActivity()} instead. + * * @param object ...$activity * @return $this */ diff --git a/src/Workflow.php b/src/Workflow.php index cc348455..fb2c8907 100644 --- a/src/Workflow.php +++ b/src/Workflow.php @@ -79,10 +79,11 @@ public static function now(): \DateTimeInterface } /** - * Returns {@see false} if not under workflow code. + * Checks if the code is under a workflow. * - * In the case that the workflow is started for the first time, - * the {@see true} value will be returned. + * Returns **false** if not under workflow code. + * + * In the case that the workflow is started for the first time, the **true** value will be returned. * * @return bool * @throws OutOfContextException in the absence of the workflow execution context. @@ -183,6 +184,8 @@ public static function async(callable $task): CancellationScopeInterface } /** + * Creates a child task that is not affected by parent task interruption, cancellation, or completion. + * * The method is similar to the {@see Workflow::async()}, however, unlike * it, it creates a child task, the execution of which is not affected by * interruption, cancellation or completion of the parent task. @@ -231,7 +234,7 @@ public static function asyncDetached(callable $task): CancellationScopeInterface } /** - * Moves to the next step if the expression evaluates to {@see true}. + * Moves to the next step if the expression evaluates to `true`. * * Please note that a state change should ONLY occur if the internal * workflow conditions are met. @@ -278,7 +281,9 @@ public static function await(...$conditions): PromiseInterface } /** - * Returns {@see true} if any of conditions were fired and {@see false} if + * Checks if any conditions were met or the timeout was reached. + * + * Returns **true** if any of conditions were fired and **false** if * timeout was reached. * * This method is similar to {@see Workflow::await()}, but in any case it @@ -345,6 +350,8 @@ public static function registerQuery(string $queryType, callable $handler): Scop } /** + * Registers a query with an additional signal handler. + * * The method is similar to the {@see Workflow::registerQuery()}, but it * registers an additional signal handler. * @@ -372,6 +379,8 @@ public static function registerSignal(string $queryType, callable $handler): Sco } /** + * Updates the behavior of an existing workflow to resolve inconsistency errors during replay. + * * The method is used to update the behavior (code) of an existing workflow * which was already implemented earlier in order to get rid of errors of * inconsistency of workflow replay and existing new code. @@ -401,6 +410,8 @@ public static function getVersion(string $changeId, int $minSupported, int $maxS } /** + * Isolates non-pure data to ensure consistent results during workflow replays. + * * This method serves to isolate any non-pure data. When the workflow is * replayed (for example, in case of an error), such isolated data will * return the result of the previous replay. @@ -461,6 +472,8 @@ public static function timer($interval): PromiseInterface } /** + * Completes the current workflow execution atomically and starts a new execution with the same Workflow Id. + * * Method atomically completes the current workflow execution and starts a * new execution of the Workflow with the same Workflow Id. The new * execution will not carry over any history from the old execution. @@ -488,6 +501,8 @@ public static function continueAsNew( } /** + * Creates a proxy for a workflow class to continue as new. + * * This method is equivalent to {@see Workflow::continueAsNew()}, but it takes * the workflow class as the first argument, and the further api is built on * the basis of calls to the methods of the passed workflow. @@ -528,6 +543,8 @@ public static function newContinueAsNewStub(string $class, ContinueAsNewOptions } /** + * Calls an external workflow without stopping the current one. + * * Method for calling an external workflow without stopping the current one. * It is similar to {@see Workflow::continueAsNew()}, but does not terminate * the current workflow execution. @@ -586,6 +603,8 @@ public static function executeChildWorkflow( } /** + * Creates a proxy for a workflow class to execute as a child workflow. + * * This method is equivalent to {@see Workflow::executeChildWorkflow()}, but * it takes the workflow class as the first argument, and the further api * is built on the basis of calls to the methods of the passed workflow. @@ -632,6 +651,8 @@ public static function newChildWorkflowStub( } /** + * Creates a proxy for a workflow by name to execute as a child workflow. + * * This method is equivalent to {@see Workflow::newChildWorkflowStub()}, but * it takes the workflow name (instead of class name) as the first argument. * diff --git a/src/Workflow/ChildWorkflowCancellationType.php b/src/Workflow/ChildWorkflowCancellationType.php index 3f7d5189..02601489 100644 --- a/src/Workflow/ChildWorkflowCancellationType.php +++ b/src/Workflow/ChildWorkflowCancellationType.php @@ -15,9 +15,10 @@ use Temporal\Internal\Marshaller\Type\Type; /** - * Defines behaviour of the parent workflow when {@see CancellationScope} that - * wraps child workflow execution request is canceled. The result of the - * cancellation independently of the type is a {@see FailedCancellationException} + * Defines the behavior of the parent workflow when a CancellationScope that + * wraps child workflow execution request is canceled. + * + * The result of the cancellation independently of the type is a {@see FailedCancellationException} * thrown from the child workflow method. * * @psalm-type ChildWorkflowCancellationEnum = ChildWorkflowCancellationType::* diff --git a/src/Workflow/ChildWorkflowOptions.php b/src/Workflow/ChildWorkflowOptions.php index a72d07a0..711ee5ca 100644 --- a/src/Workflow/ChildWorkflowOptions.php +++ b/src/Workflow/ChildWorkflowOptions.php @@ -92,9 +92,10 @@ final class ChildWorkflowOptions extends Options public \DateInterval $workflowTaskTimeout; /** - * In case of a child workflow cancellation it fails with - * a {@see FailedCancellationException}. The type defines at which point - * the exception is thrown. + * In case of a child workflow cancellation it fails with a FailedCancellationException. The type defines at which + * point the exception is thrown. + * + * @see FailedCancellationException * * @psalm-var ChildWorkflowCancellationEnum */ @@ -103,7 +104,9 @@ final class ChildWorkflowOptions extends Options /** * Whether server allow reuse of workflow ID, can be useful for dedup - * logic if set to {@see IdReusePolicy::POLICY_REJECT_DUPLICATE}. + * logic if set to IdReusePolicy::POLICY_REJECT_DUPLICATE. + * + * @see IdReusePolicy::POLICY_REJECT_DUPLICATE */ #[Marshal(name: 'WorkflowIDReusePolicy')] public int $workflowIdReusePolicy = IdReusePolicy::POLICY_ALLOW_DUPLICATE_FAILED_ONLY; @@ -303,9 +306,9 @@ public function withWorkflowTaskTimeout($timeout): self } /** - * In case of a child workflow cancellation it fails with - * a {@see FailedCancellationException}. The type defines at which point - * the exception is thrown. + * The type defines at which point the exception is thrown. + * + * In case of a child workflow cancellation it fails with a {@see FailedCancellationException}. * * @psalm-suppress ImpureMethodCall * @@ -368,6 +371,8 @@ public function withRetryOptions(?RetryOptions $options): self } /** + * Specifies optional cron schedule for workflow. + * * @see CronSchedule::$interval for more info about cron format. * * @param string|null $expression diff --git a/src/Workflow/ContinueAsNewOptions.php b/src/Workflow/ContinueAsNewOptions.php index dbe23965..2bda8709 100644 --- a/src/Workflow/ContinueAsNewOptions.php +++ b/src/Workflow/ContinueAsNewOptions.php @@ -66,9 +66,9 @@ public static function new(): self } /** - * Task queue to use for workflow tasks. It should match a task queue - * specified when creating a {@see Worker} that hosts the - * workflow code. + * Task queue to use for workflow tasks. + * + * It should match a task queue specified when creating a {@see Worker} that hosts the workflow code. * * @psalm-suppress ImpureMethodCall * diff --git a/src/Workflow/ScopedContextInterface.php b/src/Workflow/ScopedContextInterface.php index 33aef84d..65b5f59f 100644 --- a/src/Workflow/ScopedContextInterface.php +++ b/src/Workflow/ScopedContextInterface.php @@ -19,6 +19,8 @@ interface ScopedContextInterface extends WorkflowContextInterface { /** + * The method calls an asynchronous task and returns a promise. + * * @see Workflow::async() * * @param callable $handler diff --git a/src/Workflow/WorkflowContextInterface.php b/src/Workflow/WorkflowContextInterface.php index 2f9e4a88..83dac767 100644 --- a/src/Workflow/WorkflowContextInterface.php +++ b/src/Workflow/WorkflowContextInterface.php @@ -29,6 +29,8 @@ interface WorkflowContextInterface extends EnvironmentInterface { /** + * Returns information about current workflow execution. + * * @see Workflow::getInfo() * * @return WorkflowInfo @@ -36,6 +38,8 @@ interface WorkflowContextInterface extends EnvironmentInterface public function getInfo(): WorkflowInfo; /** + * Returns workflow execution input arguments. + * * @see Workflow::getInput() * * @return ValuesInterface @@ -53,6 +57,9 @@ public function getInput(): ValuesInterface; public function getLastCompletionResult($type = null); /** + * A method that allows you to dynamically register additional query + * handler in a workflow during the execution of a workflow. + * * @see Workflow::registerQuery() * * @param string $queryType @@ -62,6 +69,8 @@ public function getLastCompletionResult($type = null); public function registerQuery(string $queryType, callable $handler): self; /** + * Registers a query with an additional signal handler. + * * @see Workflow::registerSignal() * * @param string $queryType @@ -82,6 +91,8 @@ public function registerSignal(string $queryType, callable $handler): self; public function request(RequestInterface $request, bool $cancellable = true): PromiseInterface; /** + * Updates the behavior of an existing workflow to resolve inconsistency errors during replay. + * * @see Workflow::getVersion() * * @param string $changeId @@ -92,6 +103,8 @@ public function request(RequestInterface $request, bool $cancellable = true): Pr public function getVersion(string $changeId, int $minSupported, int $maxSupported): PromiseInterface; /** + * Isolates non-pure data to ensure consistent results during workflow replays. + * * @see Workflow::sideEffect() * * @template TReturn @@ -118,6 +131,8 @@ public function complete(array $result = null, \Throwable $failure = null): Prom public function panic(\Throwable $failure = null): PromiseInterface; /** + * Stops workflow execution work for a specified period. + * * @see Workflow::timer() * * @param DateIntervalValue $interval @@ -127,6 +142,8 @@ public function panic(\Throwable $failure = null): PromiseInterface; public function timer($interval): PromiseInterface; /** + * Completes the current workflow execution atomically and starts a new execution with the same Workflow Id. + * * @see Workflow::continueAsNew() * * @param string $type @@ -153,6 +170,8 @@ public function continueAsNew( public function newContinueAsNewStub(string $class, ContinueAsNewOptions $options = null): object; /** + * Calls an external workflow without stopping the current one. + * * @see Workflow::executeChildWorkflow() * * @param string $type @@ -170,6 +189,8 @@ public function executeChildWorkflow( ): PromiseInterface; /** + * Creates a proxy for a workflow class to execute as a child workflow. + * * @see Workflow::newChildWorkflowStub() * * @psalm-template T of object @@ -184,6 +205,8 @@ public function newChildWorkflowStub( ): object; /** + * Creates a proxy for a workflow by name to execute as a child workflow. + * * @see Workflow::newUntypedChildWorkflowStub() * * @param string $type @@ -221,6 +244,8 @@ public function newExternalWorkflowStub(string $class, WorkflowExecution $execut public function newUntypedExternalWorkflowStub(WorkflowExecution $execution): ExternalWorkflowStubInterface; /** + * Calls an activity by its name and gets the result of its execution. + * * @see Workflow::executeActivity() * * @param string $type @@ -238,6 +263,10 @@ public function executeActivity( ): PromiseInterface; /** + * The method returns a proxy over the class containing the activity, which + * allows you to conveniently and beautifully call all methods within the + * passed class. + * * @see Workflow::newActivityStub() * * @psalm-template T of object @@ -251,6 +280,9 @@ public function newActivityStub(string $class, ): object; /** + * The method creates and returns a proxy class with the specified settings + * that allows to call an activities with the passed options. + * * @see Workflow::newUntypedActivityStub() * * @param ActivityOptionsInterface|null $options @@ -262,6 +294,8 @@ public function newUntypedActivityStub( ): ActivityStubInterface; /** + * Moves to the next step if the expression evaluates to `true`. + * * @see Workflow::await() * * @param callable|PromiseInterface ...$conditions @@ -270,11 +304,13 @@ public function newUntypedActivityStub( public function await(...$conditions): PromiseInterface; /** - * @see Workflow::awaitWithTimeout() + * Checks if any conditions were met or the timeout was reached. * - * Returns {@see true} if any of conditions were fired and {@see false} if + * Returns **true** if any of conditions were fired and **false** if * timeout was reached. * + * @see Workflow::awaitWithTimeout() + * * @param DateIntervalValue $interval * @param callable|PromiseInterface ...$conditions * @return PromiseInterface @@ -282,6 +318,8 @@ public function await(...$conditions): PromiseInterface; public function awaitWithTimeout($interval, ...$conditions): PromiseInterface; /** + * Returns a complete trace of the last calls (for debugging). + * * @see Workflow::getStackTrace() * * @return string @@ -294,28 +332,28 @@ public function getStackTrace(): string; public function upsertSearchAttributes(array $searchAttributes): void; /** - * @see Workflow::uuid() - * * Generate a UUID. * + * @see Workflow::uuid() + * * @return PromiseInterface */ public function uuid(): PromiseInterface; /** - * @see Workflow::uuid4() - * * Generate a UUID version 4 (random). * + * @see Workflow::uuid4() + * * @return PromiseInterface */ public function uuid4(): PromiseInterface; /** - * @see Workflow::uuid7() - * * Generate a UUID version 7 (Unix Epoch time). * + * @see Workflow::uuid7() + * * @param DateTimeInterface|null $dateTime An optional date/time from which * to create the version 7 UUID. If not provided, the UUID is generated * using the current date/time. diff --git a/src/Workflow/WorkflowExecution.php b/src/Workflow/WorkflowExecution.php index 16fee491..9fb18abd 100644 --- a/src/Workflow/WorkflowExecution.php +++ b/src/Workflow/WorkflowExecution.php @@ -15,6 +15,8 @@ use Temporal\Internal\Marshaller\Meta\Marshal; /** + * Workflow Execution DTO. + * * @see \Temporal\Api\Common\V1\WorkflowExecution */ class WorkflowExecution diff --git a/src/Workflow/WorkflowExecutionInfo.php b/src/Workflow/WorkflowExecutionInfo.php index 38263457..dc77b583 100644 --- a/src/Workflow/WorkflowExecutionInfo.php +++ b/src/Workflow/WorkflowExecutionInfo.php @@ -11,6 +11,8 @@ use Temporal\Workflow\ResetPointInfo as ResetPointInfoDto; /** + * DTO that contains detailed information about Workflow Execution. + * * @see \Temporal\Api\Workflow\V1\WorkflowExecutionInfo * @psalm-immutable */ diff --git a/src/Workflow/WorkflowExecutionStatus.php b/src/Workflow/WorkflowExecutionStatus.php index 85f2a13d..ff5875a6 100644 --- a/src/Workflow/WorkflowExecutionStatus.php +++ b/src/Workflow/WorkflowExecutionStatus.php @@ -5,6 +5,8 @@ namespace Temporal\Workflow; /** + * Workflow execution status. + * * @see \Temporal\Api\Enums\V1\WorkflowExecutionStatus */ enum WorkflowExecutionStatus: int From 31610647c5319325f19d4cc5e95dc20a224906d4 Mon Sep 17 00:00:00 2001 From: Maxim Smakouz Date: Wed, 20 Mar 2024 17:44:30 +0200 Subject: [PATCH 4/4] Up actions/checkout version --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e5f7f3a5..9d27c5d5 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -11,7 +11,7 @@ jobs: name: Generating API documentation runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: recursive