From 2fd17e62e7d810270745e5c28ef8e3f8830b105e Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 28 Oct 2024 22:03:28 +0000 Subject: [PATCH 01/21] style(php-cs-fixer): fix coding standards --- src/Activity.php | 3 - src/Activity/ActivityContextInterface.php | 4 - src/Activity/ActivityInfo.php | 20 -- src/Activity/ActivityInterface.php | 3 - src/Activity/ActivityMethod.php | 3 - src/Activity/ActivityOptions.php | 4 - src/Activity/ActivityType.php | 1 - src/Activity/LocalActivityInterface.php | 3 - src/Activity/LocalActivityOptions.php | 2 - .../ActivityCompletionClientInterface.php | 28 --- src/Client/ClientOptions.php | 7 - src/Client/Common/Paginator.php | 1 - src/Client/Common/RpcRetryOptions.php | 3 - src/Client/GRPC/BaseClient.php | 11 -- src/Client/GRPC/ContextInterface.php | 26 --- src/Client/GRPC/ServiceClient.php | 186 ------------------ src/Client/ScheduleClient.php | 5 - src/Client/Update/UpdateHandle.php | 1 - src/Client/WorkflowClient.php | 44 ----- src/Client/WorkflowClientInterface.php | 22 --- src/Client/WorkflowOptions.php | 13 -- src/Client/WorkflowStubInterface.php | 14 -- src/Common/CronSchedule.php | 7 - src/Common/MethodRetry.php | 1 - src/Common/RetryOptions.php | 6 - src/Common/Uuid.php | 9 - src/DataConverter/BinaryConverter.php | 6 - src/DataConverter/Bytes.php | 12 -- src/DataConverter/Converter.php | 4 - src/DataConverter/DataConverter.php | 10 - src/DataConverter/DataConverterInterface.php | 2 - src/DataConverter/EncodedCollection.php | 3 - src/DataConverter/EncodedValues.php | 33 ---- src/DataConverter/JsonConverter.php | 26 --- src/DataConverter/NullConverter.php | 6 - .../PayloadConverterInterface.php | 4 - src/DataConverter/ProtoConverter.php | 6 - src/DataConverter/ProtoJsonConverter.php | 6 - src/DataConverter/Type.php | 27 --- src/DataConverter/ValuesInterface.php | 6 - .../Client/ActivityCompletionException.php | 17 -- .../Client/ServiceClientException.php | 13 -- src/Exception/Client/WorkflowException.php | 24 --- ...rkflowExecutionAlreadyStartedException.php | 5 - .../Client/WorkflowFailedException.php | 7 - .../Client/WorkflowQueryRejectedException.php | 16 -- src/Exception/CompensationException.php | 3 - src/Exception/ExceptionInterceptor.php | 10 - .../ExceptionInterceptorInterface.php | 4 - src/Exception/Failure/ActivityFailure.php | 27 --- src/Exception/Failure/ApplicationFailure.php | 19 -- src/Exception/Failure/CanceledFailure.php | 11 -- .../Failure/ChildWorkflowFailure.php | 27 --- src/Exception/Failure/FailureConverter.php | 21 -- src/Exception/Failure/ServerFailure.php | 8 - src/Exception/Failure/TemporalFailure.php | 28 --- src/Exception/Failure/TerminatedFailure.php | 4 - src/Exception/Failure/TimeoutFailure.php | 15 -- src/Exception/TemporalException.php | 1 - .../WorkflowExecutionFailedException.php | 21 -- .../ActivityInboundInterceptor.php | 2 - src/Interceptor/GrpcClientInterceptor.php | 3 - src/Interceptor/SimplePipelineProvider.php | 3 - ...orkflowOutboundRequestInterceptorTrait.php | 26 --- .../WorkflowClientCallsInterceptor.php | 18 -- .../WorkflowInboundCallsInterceptor.php | 5 - .../WorkflowOutboundCallsInterceptor.php | 27 --- .../WorkflowOutboundRequestInterceptor.php | 2 - src/Internal/Activity/ActivityContext.php | 24 --- src/Internal/Assert.php | 5 - .../Client/ActivityCompletionClient.php | 29 --- src/Internal/Client/WorkflowProxy.php | 3 - src/Internal/Client/WorkflowRun.php | 7 - src/Internal/Client/WorkflowStarter.php | 17 -- src/Internal/Client/WorkflowStub.php | 49 +---- src/Internal/Declaration/ActivityInstance.php | 4 - .../Declaration/Dispatcher/Dispatcher.php | 26 --- src/Internal/Declaration/Graph/ClassNode.php | 30 --- src/Internal/Declaration/Instance.php | 4 - .../Instantiator/ActivityInstantiator.php | 3 - .../Declaration/Instantiator/Instantiator.php | 2 - .../Instantiator/WorkflowInstantiator.php | 5 - .../Prototype/ActivityPrototype.php | 16 -- .../Declaration/Prototype/Prototype.php | 35 ---- .../Prototype/PrototypeInterface.php | 3 - .../Prototype/WorkflowPrototype.php | 28 --- .../Declaration/Reader/ActivityReader.php | 15 -- src/Internal/Declaration/Reader/Reader.php | 10 - .../RecursiveAttributeReducerInterface.php | 8 - .../Declaration/Reader/WorkflowReader.php | 17 -- src/Internal/Declaration/WorkflowInstance.php | 11 -- .../WorkflowInstance/SignalQueue.php | 4 - .../Declaration/WorkflowInstanceInterface.php | 10 - src/Internal/Events/EventEmitterInterface.php | 2 - src/Internal/Events/EventEmitterTrait.php | 6 - .../Events/EventListenerInterface.php | 1 - src/Internal/Interceptor/HeaderCarrier.php | 2 - src/Internal/Interceptor/Pipeline.php | 4 - .../Marshaller/Mapper/AttributeMapper.php | 52 ----- .../Mapper/AttributeMapperFactory.php | 9 - .../Mapper/MapperFactoryInterface.php | 5 - .../Marshaller/Mapper/MapperInterface.php | 3 - src/Internal/Marshaller/Marshaller.php | 13 +- .../Marshaller/MarshallerInterface.php | 1 - src/Internal/Marshaller/MarshallingRule.php | 1 - src/Internal/Marshaller/Meta/Marshal.php | 6 - src/Internal/Marshaller/Meta/MarshalArray.php | 5 - .../Marshaller/Meta/MarshalAssocArray.php | 5 - .../Marshaller/Meta/MarshalDateTime.php | 1 - src/Internal/Marshaller/Meta/MarshalOneOf.php | 1 - src/Internal/Marshaller/Meta/Scope.php | 4 - .../Marshaller/RuleFactoryInterface.php | 5 - src/Internal/Marshaller/Type/ArrayType.php | 12 -- .../Marshaller/Type/AssocArrayType.php | 5 - src/Internal/Marshaller/Type/CronType.php | 6 - .../Marshaller/Type/DateIntervalType.php | 19 -- src/Internal/Marshaller/Type/DateTimeType.php | 14 -- .../Type/DetectableTypeInterface.php | 4 - .../Marshaller/Type/DurationJsonType.php | 13 -- src/Internal/Marshaller/Type/EnumType.php | 6 - .../Marshaller/Type/EnumValueType.php | 6 - src/Internal/Marshaller/Type/NullableType.php | 5 - src/Internal/Marshaller/Type/ObjectType.php | 14 -- src/Internal/Marshaller/Type/OneOfType.php | 6 - .../Marshaller/Type/RuleFactoryInterface.php | 3 - src/Internal/Marshaller/Type/Type.php | 3 - src/Internal/Marshaller/TypeFactory.php | 13 -- .../Marshaller/TypeFactoryInterface.php | 3 - src/Internal/Queue/ArrayQueue.php | 17 -- src/Internal/Queue/QueueInterface.php | 11 -- src/Internal/Repository/ArrayRepository.php | 22 --- .../Repository/RepositoryInterface.php | 3 - src/Internal/Support/DateInterval.php | 8 - src/Internal/Support/DateTime.php | 1 - src/Internal/Support/Diff.php | 12 -- src/Internal/Support/Facade.php | 3 - src/Internal/Support/Inheritance.php | 3 - src/Internal/Support/Options.php | 9 - src/Internal/Support/Process.php | 2 - src/Internal/Support/Reflection.php | 1 - src/Internal/Support/StackRenderer.php | 4 - src/Internal/Transport/ClientInterface.php | 7 - src/Internal/Transport/CompletableResult.php | 30 --- .../Transport/CompletableResultInterface.php | 3 - src/Internal/Transport/Request/Cancel.php | 3 - .../Request/CancelExternalWorkflow.php | 14 -- .../Transport/Request/CompleteWorkflow.php | 4 - .../Transport/Request/ContinueAsNew.php | 1 - .../Transport/Request/ExecuteActivity.php | 2 - .../Request/ExecuteChildWorkflow.php | 2 - .../Request/ExecuteLocalActivity.php | 2 - .../Request/GetChildWorkflowExecution.php | 3 - src/Internal/Transport/Request/GetVersion.php | 10 - src/Internal/Transport/Request/NewTimer.php | 6 - src/Internal/Transport/Request/Panic.php | 3 - src/Internal/Transport/Request/SideEffect.php | 3 - .../Request/SignalExternalWorkflow.php | 8 - src/Internal/Transport/Router.php | 13 -- .../Transport/Router/CancelWorkflow.php | 7 - .../Transport/Router/DestroyWorkflow.php | 7 - .../Transport/Router/GetWorkerInfo.php | 22 --- .../Transport/Router/InvokeActivity.php | 12 -- src/Internal/Transport/Router/InvokeQuery.php | 11 -- .../Transport/Router/InvokeSignal.php | 3 - .../Transport/Router/InvokeUpdate.php | 3 - src/Internal/Transport/Router/StackTrace.php | 3 - src/Internal/Transport/RouterInterface.php | 11 -- src/Internal/Transport/Server.php | 6 - src/Internal/Transport/ServerInterface.php | 1 - src/Internal/Workflow/ActivityProxy.php | 18 -- src/Internal/Workflow/ActivityStub.php | 15 -- src/Internal/Workflow/ChildWorkflowProxy.php | 5 - src/Internal/Workflow/ChildWorkflowStub.php | 25 --- src/Internal/Workflow/ContinueAsNewProxy.php | 26 --- .../Workflow/ExternalWorkflowProxy.php | 13 -- .../Workflow/ExternalWorkflowStub.php | 14 -- src/Internal/Workflow/Input.php | 6 - src/Internal/Workflow/Process/Scope.php | 29 --- src/Internal/Workflow/ProcessCollection.php | 2 - src/Internal/Workflow/Proxy.php | 5 - src/Internal/Workflow/WorkflowContext.php | 114 ----------- src/Promise.php | 10 - src/Worker/DispatcherInterface.php | 5 - .../Environment/EnvironmentInterface.php | 6 - src/Worker/Transport/Codec/CodecInterface.php | 2 - src/Worker/Transport/Codec/JsonCodec.php | 10 - .../Transport/Codec/JsonCodec/Encoder.php | 3 - src/Worker/Transport/Codec/ProtoCodec.php | 15 -- .../Transport/Command/Common/RequestTrait.php | 3 - .../Transport/Command/RequestInterface.php | 7 - .../Command/SuccessResponseInterface.php | 3 - src/Worker/Transport/CommandBatch.php | 4 - src/Worker/Transport/Goridge.php | 8 - .../Transport/HostConnectionInterface.php | 3 - .../Transport/RPCConnectionInterface.php | 2 - src/Worker/Transport/RoadRunner.php | 16 -- src/Worker/Worker.php | 45 ----- src/Worker/WorkerFactoryInterface.php | 3 - src/Worker/WorkerInterface.php | 2 - src/Worker/WorkerOptions.php | 1 - src/WorkerFactory.php | 101 ---------- src/Workflow.php | 41 ---- src/Workflow/ActivityStubInterface.php | 5 - src/Workflow/CancellationScopeInterface.php | 4 - src/Workflow/ChildWorkflowOptions.php | 9 - src/Workflow/ChildWorkflowStubInterface.php | 9 - src/Workflow/ContinueAsNewOptions.php | 1 - .../ExternalWorkflowStubInterface.php | 9 - src/Workflow/ProcessInterface.php | 3 - src/Workflow/Saga.php | 5 - src/Workflow/WorkflowContextInterface.php | 43 ---- src/Workflow/WorkflowExecution.php | 15 -- src/Workflow/WorkflowInfo.php | 37 ---- src/Workflow/WorkflowMethod.php | 3 - src/Workflow/WorkflowRunInterface.php | 2 - src/Workflow/WorkflowStub.php | 3 - src/Workflow/WorkflowType.php | 1 - testing/src/WorkerFactory.php | 3 - 218 files changed, 3 insertions(+), 2575 deletions(-) diff --git a/src/Activity.php b/src/Activity.php index d78993d05..1d7e84a50 100644 --- a/src/Activity.php +++ b/src/Activity.php @@ -26,7 +26,6 @@ final class Activity extends Facade /** * Returns information about current activity execution. * - * @return ActivityInfo * @throws OutOfContextException in the absence of the activity execution context. */ public static function getInfo(): ActivityInfo @@ -53,7 +52,6 @@ public static function getInfo(): ActivityInfo * } * ``` * - * @return ValuesInterface * @throws OutOfContextException in the absence of the activity execution context. */ public static function getInput(): ValuesInterface @@ -69,7 +67,6 @@ public static function getInput(): ValuesInterface * * 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. */ public static function hasHeartbeatDetails(): bool diff --git a/src/Activity/ActivityContextInterface.php b/src/Activity/ActivityContextInterface.php index 457311a96..7128a6da1 100644 --- a/src/Activity/ActivityContextInterface.php +++ b/src/Activity/ActivityContextInterface.php @@ -22,7 +22,6 @@ interface ActivityContextInterface * * @see Activity::getInfo() * - * @return ActivityInfo */ public function getInfo(): ActivityInfo; @@ -31,7 +30,6 @@ public function getInfo(): ActivityInfo; * * @see Activity::getInput() * - * @return ValuesInterface */ public function getInput(): ValuesInterface; @@ -40,7 +38,6 @@ public function getInput(): ValuesInterface; * * @see Activity::hasHeartbeatDetails() * - * @return bool */ public function hasHeartbeatDetails(): bool; @@ -59,7 +56,6 @@ public function getHeartbeatDetails($type = null); * * @see Activity::doNotCompleteOnReturn() * - * @return void */ public function doNotCompleteOnReturn(): void; diff --git a/src/Activity/ActivityInfo.php b/src/Activity/ActivityInfo.php index 929774f82..a5866063a 100644 --- a/src/Activity/ActivityInfo.php +++ b/src/Activity/ActivityInfo.php @@ -38,26 +38,16 @@ final class ActivityInfo * * @see ActivityCompletionClientInterface::complete() * - * @var string */ #[Marshal(name: 'TaskToken')] public string $taskToken; - /** - * @var WorkflowType|null - */ #[Marshal(name: 'WorkflowType', type: NullableType::class, of: WorkflowType::class)] public ?WorkflowType $workflowType = null; - /** - * @var string - */ #[Marshal(name: 'WorkflowNamespace')] public string $workflowNamespace = 'default'; - /** - * @var WorkflowExecution|null - */ #[Marshal(name: 'WorkflowExecution', type: NullableType::class, of: WorkflowExecution::class)] public ?WorkflowExecution $workflowExecution = null; @@ -67,7 +57,6 @@ final class ActivityInfo * * @see ActivityCompletionClientInterface::complete() * - * @var string */ #[Marshal(name: 'ActivityID')] public string $id; @@ -75,21 +64,16 @@ final class ActivityInfo /** * Type (name) of the activity. * - * @var ActivityType */ #[Marshal(name: 'ActivityType', type: ObjectType::class, of: ActivityType::class)] public ActivityType $type; - /** - * @var string - */ #[Marshal(name: 'TaskQueue')] public string $taskQueue = WorkerFactoryInterface::DEFAULT_TASK_QUEUE; /** * Maximum time between heartbeats. 0 means no heartbeat needed. * - * @var \DateInterval */ #[Marshal(name: 'HeartbeatTimeout', type: DateIntervalType::class)] public \DateInterval $heartbeatTimeout; @@ -97,7 +81,6 @@ final class ActivityInfo /** * Time of activity scheduled by a workflow * - * @var \DateTimeInterface */ #[Marshal(name: 'ScheduledTime', type: DateTimeType::class)] public \DateTimeInterface $scheduledTime; @@ -105,7 +88,6 @@ final class ActivityInfo /** * Time of activity start * - * @var \DateTimeInterface */ #[Marshal(name: 'StartedTime', type: DateTimeType::class)] public \DateTimeInterface $startedTime; @@ -113,7 +95,6 @@ final class ActivityInfo /** * Time of activity timeout * - * @var \DateTimeInterface */ #[Marshal(name: 'Deadline', type: DateTimeType::class)] public \DateTimeInterface $deadline; @@ -122,7 +103,6 @@ final class ActivityInfo * Attempt starts from 1, and increased by 1 for every retry if * retry policy is specified. * - * @var int */ #[Marshal(name: 'Attempt')] public int $attempt = 1; diff --git a/src/Activity/ActivityInterface.php b/src/Activity/ActivityInterface.php index 3758811b5..fe2fbb6c9 100644 --- a/src/Activity/ActivityInterface.php +++ b/src/Activity/ActivityInterface.php @@ -49,9 +49,6 @@ class ActivityInterface #[Immutable] public string $prefix = ''; - /** - * @param string $prefix - */ public function __construct(string $prefix = '') { $this->prefix = $prefix; diff --git a/src/Activity/ActivityMethod.php b/src/Activity/ActivityMethod.php index 884ee38db..e78823366 100644 --- a/src/Activity/ActivityMethod.php +++ b/src/Activity/ActivityMethod.php @@ -33,9 +33,6 @@ final class ActivityMethod #[Immutable] public ?string $name = null; - /** - * @param string|null $name - */ public function __construct(string $name = null) { $this->name = $name; diff --git a/src/Activity/ActivityOptions.php b/src/Activity/ActivityOptions.php index 94b5ff9e2..a6efee905 100644 --- a/src/Activity/ActivityOptions.php +++ b/src/Activity/ActivityOptions.php @@ -123,7 +123,6 @@ public function __construct() } /** - * @param MethodRetry|null $retry * @return $this */ public function mergeWith(MethodRetry $retry = null): self @@ -142,7 +141,6 @@ public function mergeWith(MethodRetry $retry = null): self * * By default, it is the same task list name the workflow was started with. * - * @param string|null $taskQueue * @return $this */ #[Pure] @@ -269,7 +267,6 @@ public function withCancellationType(ActivityCancellationType|int $type): self } /** - * @param string $activityId * @return $this */ #[Pure] @@ -283,7 +280,6 @@ public function withActivityId(string $activityId): self } /** - * @param RetryOptions|null $options * @return $this */ #[Pure] diff --git a/src/Activity/ActivityType.php b/src/Activity/ActivityType.php index faedf2555..6b9fab4ef 100644 --- a/src/Activity/ActivityType.php +++ b/src/Activity/ActivityType.php @@ -21,7 +21,6 @@ class ActivityType /** * @psalm-readonly * @psalm-allow-private-mutation - * @var string */ #[Marshal(name: 'Name')] public string $name = ''; diff --git a/src/Activity/LocalActivityInterface.php b/src/Activity/LocalActivityInterface.php index fad88041d..9ed095586 100644 --- a/src/Activity/LocalActivityInterface.php +++ b/src/Activity/LocalActivityInterface.php @@ -49,9 +49,6 @@ final class LocalActivityInterface extends ActivityInterface #[Immutable] public string $prefix = ''; - /** - * @param string $prefix - */ public function __construct(string $prefix = '') { $this->prefix = $prefix; diff --git a/src/Activity/LocalActivityOptions.php b/src/Activity/LocalActivityOptions.php index f533bd036..441e5f32b 100644 --- a/src/Activity/LocalActivityOptions.php +++ b/src/Activity/LocalActivityOptions.php @@ -79,7 +79,6 @@ public function __construct() } /** - * @param MethodRetry|null $retry * @return $this */ public function mergeWith(MethodRetry $retry = null): self @@ -142,7 +141,6 @@ public function withStartToCloseTimeout($timeout): self } /** - * @param RetryOptions|null $options * @return $this */ #[Pure] diff --git a/src/Client/ActivityCompletionClientInterface.php b/src/Client/ActivityCompletionClientInterface.php index d8252acd0..2e125db1f 100644 --- a/src/Client/ActivityCompletionClientInterface.php +++ b/src/Client/ActivityCompletionClientInterface.php @@ -20,25 +20,15 @@ interface ActivityCompletionClientInterface { /** - * @param string $workflowId - * @param string|null $runId - * @param string $activityId * @param mixed $result */ public function complete(string $workflowId, ?string $runId, string $activityId, $result = null): void; /** - * @param string $taskToken * @param mixed $result */ public function completeByToken(string $taskToken, $result = null): void; - /** - * @param string $workflowId - * @param string|null $runId - * @param string $activityId - * @param \Throwable $error - */ public function completeExceptionally( string $workflowId, ?string $runId, @@ -46,18 +36,8 @@ public function completeExceptionally( \Throwable $error, ): void; - /** - * @param string $taskToken - * @param \Throwable $error - */ public function completeExceptionallyByToken(string $taskToken, \Throwable $error): void; - /** - * @param string $workflowId - * @param string|null $runId - * @param string $activityId - * @param $details - */ public function reportCancellation( string $workflowId, ?string $runId, @@ -65,16 +45,9 @@ public function reportCancellation( $details = null, ): void; - /** - * @param string $taskToken - * @param $details - */ public function reportCancellationByToken(string $taskToken, $details = null): void; /** - * @param string $workflowId - * @param string|null $runId - * @param string $activityId * @param mixed $details * * @throw ActivityCanceledException @@ -87,7 +60,6 @@ public function recordHeartbeat( ); /** - * @param string $taskToken * @param mixed $details * * @throw ActivityCanceledException diff --git a/src/Client/ClientOptions.php b/src/Client/ClientOptions.php index 6958fbbda..7c7b8c1fd 100644 --- a/src/Client/ClientOptions.php +++ b/src/Client/ClientOptions.php @@ -31,14 +31,8 @@ class ClientOptions */ public string $namespace = self::DEFAULT_NAMESPACE; - /** - * @var string - */ public string $identity; - /** - * @var int - */ #[ExpectedValues(valuesFromClass: QueryRejectCondition::class)] public int $queryRejectionCondition = QueryRejectCondition::QUERY_REJECT_CONDITION_NONE; @@ -65,7 +59,6 @@ public function withNamespace(string $namespace): self } /** - * @param string $identity * @return $this */ #[Pure] diff --git a/src/Client/Common/Paginator.php b/src/Client/Common/Paginator.php index 22626130a..08044e8e3 100644 --- a/src/Client/Common/Paginator.php +++ b/src/Client/Common/Paginator.php @@ -111,7 +111,6 @@ public function getPageNumber(): int * Note: the method may call yet another RPC to get total number of items. * It means that the result may be different from the number of items at the moment of the pagination start. * - * @return int * @throws \LogicException If counter is not set. */ public function count(): int diff --git a/src/Client/Common/RpcRetryOptions.php b/src/Client/Common/RpcRetryOptions.php index 5261d764d..9b0c25c33 100644 --- a/src/Client/Common/RpcRetryOptions.php +++ b/src/Client/Common/RpcRetryOptions.php @@ -51,8 +51,6 @@ public static function fromRetryOptions(RetryOptions $options): self * @param DateIntervalValue|null $interval Interval to wait on first retry, on congestion failures. * Defaults to 1000ms, which is used if set to {@see null}. * - * @return self - * * @psalm-suppress ImpureMethodCall */ #[Pure] @@ -76,7 +74,6 @@ public function withCongestionInitialInterval($interval): self * @param null|float $coefficient Maximum amount of jitter. * Default will be used if set to {@see null}. * - * @return self */ #[Pure] public function withMaximumJitterCoefficient(?float $coefficient): self diff --git a/src/Client/GRPC/BaseClient.php b/src/Client/GRPC/BaseClient.php index 201a6eac8..78cc3ef40 100644 --- a/src/Client/GRPC/BaseClient.php +++ b/src/Client/GRPC/BaseClient.php @@ -64,7 +64,6 @@ final public function __construct(WorkflowServiceClient|\Closure $workflowServic /** * @param non-empty-string $address Temporal service address in format `host:port` - * @return static * @psalm-suppress UndefinedClass */ public static function create(string $address): static @@ -86,7 +85,6 @@ public static function create(string $address): static * @param non-empty-string|null $clientKey Client private key string or file in PEM format. * @param non-empty-string|null $clientPem Client certificate chain string or file in PEM format. * @param non-empty-string|null $overrideServerName - * @return static * * @psalm-suppress UndefinedClass * @psalm-suppress UnusedVariable @@ -166,7 +164,6 @@ public function close(): void /** * @param null|Pipeline $pipeline * - * @return static */ final public function withInterceptorPipeline(?Pipeline $pipeline): static { @@ -233,10 +230,6 @@ public function getConnection(): ConnectionInterface /** * @param non-empty-string $method RPC method name - * @param object $arg - * @param ContextInterface|null $ctx - * - * @return mixed * * @throw ClientException */ @@ -262,10 +255,6 @@ protected function invoke(string $method, object $arg, ?ContextInterface $ctx = * Used in {@see withInterceptorPipeline()} * * @param non-empty-string $method - * @param object $arg - * @param ContextInterface $ctx - * - * @return object * * @throws \Exception */ diff --git a/src/Client/GRPC/ContextInterface.php b/src/Client/GRPC/ContextInterface.php index 0a6bc61ed..8f33b51ef 100644 --- a/src/Client/GRPC/ContextInterface.php +++ b/src/Client/GRPC/ContextInterface.php @@ -21,52 +21,26 @@ interface ContextInterface { /** * @param DateIntervalValue $timeout - * @param string $format * @return $this */ public function withTimeout($timeout, string $format = DateInterval::FORMAT_SECONDS): ContextInterface; /** - * @param \DateTimeInterface $deadline * @return $this */ public function withDeadline(\DateTimeInterface $deadline): ContextInterface; - /** - * @param array $options - * @return ContextInterface - */ public function withOptions(array $options): ContextInterface; - /** - * @param array $metadata - * @return ContextInterface - */ public function withMetadata(array $metadata): ContextInterface; - /** - * @param RetryOptions $options - * @return ContextInterface - */ public function withRetryOptions(RetryOptions $options): ContextInterface; - /** - * @return array - */ public function getOptions(): array; - /** - * @return array - */ public function getMetadata(): array; - /** - * @return \DateTimeInterface|null - */ public function getDeadline(): ?\DateTimeInterface; - /** - * @return RetryOptions - */ public function getRetryOptions(): RetryOptions; } diff --git a/src/Client/GRPC/ServiceClient.php b/src/Client/GRPC/ServiceClient.php index a1bb3b070..bdeedc2ca 100644 --- a/src/Client/GRPC/ServiceClient.php +++ b/src/Client/GRPC/ServiceClient.php @@ -27,9 +27,6 @@ class ServiceClient extends BaseClient * exactly one * namespace. * - * @param V1\RegisterNamespaceRequest $arg - * @param ContextInterface|null $ctx - * @return V1\RegisterNamespaceResponse * @throws ServiceClientException */ public function RegisterNamespace(V1\RegisterNamespaceRequest $arg, ContextInterface $ctx = null): V1\RegisterNamespaceResponse @@ -41,9 +38,6 @@ public function RegisterNamespace(V1\RegisterNamespaceRequest $arg, ContextInter * DescribeNamespace returns the information and configuration for a registered * namespace. * - * @param V1\DescribeNamespaceRequest $arg - * @param ContextInterface|null $ctx - * @return V1\DescribeNamespaceResponse * @throws ServiceClientException */ public function DescribeNamespace(V1\DescribeNamespaceRequest $arg, ContextInterface $ctx = null): V1\DescribeNamespaceResponse @@ -54,9 +48,6 @@ public function DescribeNamespace(V1\DescribeNamespaceRequest $arg, ContextInter /** * ListNamespaces returns the information and configuration for all namespaces. * - * @param V1\ListNamespacesRequest $arg - * @param ContextInterface|null $ctx - * @return V1\ListNamespacesResponse * @throws ServiceClientException */ public function ListNamespaces(V1\ListNamespacesRequest $arg, ContextInterface $ctx = null): V1\ListNamespacesResponse @@ -69,9 +60,6 @@ public function ListNamespaces(V1\ListNamespacesRequest $arg, ContextInterface $ * registered * namespace. * - * @param V1\UpdateNamespaceRequest $arg - * @param ContextInterface|null $ctx - * @return V1\UpdateNamespaceResponse * @throws ServiceClientException */ public function UpdateNamespace(V1\UpdateNamespaceRequest $arg, ContextInterface $ctx = null): V1\UpdateNamespaceResponse @@ -91,9 +79,6 @@ public function UpdateNamespace(V1\UpdateNamespaceRequest $arg, ContextInterface * (-- api-linter: core::0127::http-annotation=disabled * aip.dev/not-precedent: Deprecated --) * - * @param V1\DeprecateNamespaceRequest $arg - * @param ContextInterface|null $ctx - * @return V1\DeprecateNamespaceResponse * @throws ServiceClientException */ public function DeprecateNamespace(V1\DeprecateNamespaceRequest $arg, ContextInterface $ctx = null): V1\DeprecateNamespaceResponse @@ -110,9 +95,6 @@ public function DeprecateNamespace(V1\DeprecateNamespaceRequest $arg, ContextInt * `WorkflowExecutionAlreadyStarted`, if an * instance already exists with same workflow id. * - * @param V1\StartWorkflowExecutionRequest $arg - * @param ContextInterface|null $ctx - * @return V1\StartWorkflowExecutionResponse * @throws ServiceClientException */ public function StartWorkflowExecution(V1\StartWorkflowExecutionRequest $arg, ContextInterface $ctx = null): V1\StartWorkflowExecutionResponse @@ -125,9 +107,6 @@ public function StartWorkflowExecution(V1\StartWorkflowExecutionRequest $arg, Co * Fails with * `NotFound` if the specified workflow execution is unknown to the service. * - * @param V1\GetWorkflowExecutionHistoryRequest $arg - * @param ContextInterface|null $ctx - * @return V1\GetWorkflowExecutionHistoryResponse * @throws ServiceClientException */ public function GetWorkflowExecutionHistory(V1\GetWorkflowExecutionHistoryRequest $arg, ContextInterface $ctx = null): V1\GetWorkflowExecutionHistoryResponse @@ -142,9 +121,6 @@ public function GetWorkflowExecutionHistory(V1\GetWorkflowExecutionHistoryReques * execution is * unknown to the service. * - * @param V1\GetWorkflowExecutionHistoryReverseRequest $arg - * @param ContextInterface|null $ctx - * @return V1\GetWorkflowExecutionHistoryReverseResponse * @throws ServiceClientException */ public function GetWorkflowExecutionHistoryReverse(V1\GetWorkflowExecutionHistoryReverseRequest $arg, ContextInterface $ctx = null): V1\GetWorkflowExecutionHistoryReverseResponse @@ -166,9 +142,6 @@ public function GetWorkflowExecutionHistoryReverse(V1\GetWorkflowExecutionHistor * (-- api-linter: core::0127::http-annotation=disabled * aip.dev/not-precedent: We do not expose worker API to HTTP. --) * - * @param V1\PollWorkflowTaskQueueRequest $arg - * @param ContextInterface|null $ctx - * @return V1\PollWorkflowTaskQueueResponse * @throws ServiceClientException */ public function PollWorkflowTaskQueue(V1\PollWorkflowTaskQueueRequest $arg, ContextInterface $ctx = null): V1\PollWorkflowTaskQueueResponse @@ -190,9 +163,6 @@ public function PollWorkflowTaskQueue(V1\PollWorkflowTaskQueueRequest $arg, Cont * (-- api-linter: core::0127::http-annotation=disabled * aip.dev/not-precedent: We do not expose worker API to HTTP. --) * - * @param V1\RespondWorkflowTaskCompletedRequest $arg - * @param ContextInterface|null $ctx - * @return V1\RespondWorkflowTaskCompletedResponse * @throws ServiceClientException */ public function RespondWorkflowTaskCompleted(V1\RespondWorkflowTaskCompletedRequest $arg, ContextInterface $ctx = null): V1\RespondWorkflowTaskCompletedResponse @@ -218,9 +188,6 @@ public function RespondWorkflowTaskCompleted(V1\RespondWorkflowTaskCompletedRequ * (-- api-linter: core::0127::http-annotation=disabled * aip.dev/not-precedent: We do not expose worker API to HTTP. --) * - * @param V1\RespondWorkflowTaskFailedRequest $arg - * @param ContextInterface|null $ctx - * @return V1\RespondWorkflowTaskFailedResponse * @throws ServiceClientException */ public function RespondWorkflowTaskFailed(V1\RespondWorkflowTaskFailedRequest $arg, ContextInterface $ctx = null): V1\RespondWorkflowTaskFailedResponse @@ -252,9 +219,6 @@ public function RespondWorkflowTaskFailed(V1\RespondWorkflowTaskFailedRequest $a * (-- api-linter: core::0127::http-annotation=disabled * aip.dev/not-precedent: We do not expose worker API to HTTP. --) * - * @param V1\PollActivityTaskQueueRequest $arg - * @param ContextInterface|null $ctx - * @return V1\PollActivityTaskQueueResponse * @throws ServiceClientException */ public function PollActivityTaskQueue(V1\PollActivityTaskQueueRequest $arg, ContextInterface $ctx = null): V1\PollActivityTaskQueueResponse @@ -275,9 +239,6 @@ public function PollActivityTaskQueue(V1\PollActivityTaskQueueRequest $arg, Cont * such situations, in that event, the SDK should request cancellation of the * activity. * - * @param V1\RecordActivityTaskHeartbeatRequest $arg - * @param ContextInterface|null $ctx - * @return V1\RecordActivityTaskHeartbeatResponse * @throws ServiceClientException */ public function RecordActivityTaskHeartbeat(V1\RecordActivityTaskHeartbeatRequest $arg, ContextInterface $ctx = null): V1\RecordActivityTaskHeartbeatResponse @@ -293,9 +254,6 @@ 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 ContextInterface|null $ctx - * @return V1\RecordActivityTaskHeartbeatByIdResponse * @throws ServiceClientException */ public function RecordActivityTaskHeartbeatById(V1\RecordActivityTaskHeartbeatByIdRequest $arg, ContextInterface $ctx = null): V1\RecordActivityTaskHeartbeatByIdResponse @@ -315,9 +273,6 @@ public function RecordActivityTaskHeartbeatById(V1\RecordActivityTaskHeartbeatBy * no longer valid due to activity timeout, already being completed, or never * having existed. * - * @param V1\RespondActivityTaskCompletedRequest $arg - * @param ContextInterface|null $ctx - * @return V1\RespondActivityTaskCompletedResponse * @throws ServiceClientException */ public function RespondActivityTaskCompleted(V1\RespondActivityTaskCompletedRequest $arg, ContextInterface $ctx = null): V1\RespondActivityTaskCompletedResponse @@ -333,9 +288,6 @@ 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 ContextInterface|null $ctx - * @return V1\RespondActivityTaskCompletedByIdResponse * @throws ServiceClientException */ public function RespondActivityTaskCompletedById(V1\RespondActivityTaskCompletedByIdRequest $arg, ContextInterface $ctx = null): V1\RespondActivityTaskCompletedByIdResponse @@ -354,9 +306,6 @@ public function RespondActivityTaskCompletedById(V1\RespondActivityTaskCompleted * longer valid due to activity timeout, already being completed, or never having * existed. * - * @param V1\RespondActivityTaskFailedRequest $arg - * @param ContextInterface|null $ctx - * @return V1\RespondActivityTaskFailedResponse * @throws ServiceClientException */ public function RespondActivityTaskFailed(V1\RespondActivityTaskFailedRequest $arg, ContextInterface $ctx = null): V1\RespondActivityTaskFailedResponse @@ -372,9 +321,6 @@ 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 ContextInterface|null $ctx - * @return V1\RespondActivityTaskFailedByIdResponse * @throws ServiceClientException */ public function RespondActivityTaskFailedById(V1\RespondActivityTaskFailedByIdRequest $arg, ContextInterface $ctx = null): V1\RespondActivityTaskFailedByIdResponse @@ -393,9 +339,6 @@ public function RespondActivityTaskFailedById(V1\RespondActivityTaskFailedByIdRe * no longer valid due to activity timeout, already being completed, or never * having existed. * - * @param V1\RespondActivityTaskCanceledRequest $arg - * @param ContextInterface|null $ctx - * @return V1\RespondActivityTaskCanceledResponse * @throws ServiceClientException */ public function RespondActivityTaskCanceled(V1\RespondActivityTaskCanceledRequest $arg, ContextInterface $ctx = null): V1\RespondActivityTaskCanceledResponse @@ -411,9 +354,6 @@ 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 ContextInterface|null $ctx - * @return V1\RespondActivityTaskCanceledByIdResponse * @throws ServiceClientException */ public function RespondActivityTaskCanceledById(V1\RespondActivityTaskCanceledByIdRequest $arg, ContextInterface $ctx = null): V1\RespondActivityTaskCanceledByIdResponse @@ -433,9 +373,6 @@ 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 ContextInterface|null $ctx - * @return V1\RequestCancelWorkflowExecutionResponse * @throws ServiceClientException */ public function RequestCancelWorkflowExecution(V1\RequestCancelWorkflowExecutionRequest $arg, ContextInterface $ctx = null): V1\RequestCancelWorkflowExecutionResponse @@ -451,9 +388,6 @@ public function RequestCancelWorkflowExecution(V1\RequestCancelWorkflowExecution * and a workflow * task being created for the execution. * - * @param V1\SignalWorkflowExecutionRequest $arg - * @param ContextInterface|null $ctx - * @return V1\SignalWorkflowExecutionResponse * @throws ServiceClientException */ public function SignalWorkflowExecution(V1\SignalWorkflowExecutionRequest $arg, ContextInterface $ctx = null): V1\SignalWorkflowExecutionResponse @@ -478,9 +412,6 @@ 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 ContextInterface|null $ctx - * @return V1\SignalWithStartWorkflowExecutionResponse * @throws ServiceClientException */ public function SignalWithStartWorkflowExecution(V1\SignalWithStartWorkflowExecutionRequest $arg, ContextInterface $ctx = null): V1\SignalWithStartWorkflowExecutionResponse @@ -496,9 +427,6 @@ public function SignalWithStartWorkflowExecution(V1\SignalWithStartWorkflowExecu * TODO: Does exclusive here mean *just* the completed event, or also WFT started? * Otherwise the task is doomed to time out? * - * @param V1\ResetWorkflowExecutionRequest $arg - * @param ContextInterface|null $ctx - * @return V1\ResetWorkflowExecutionResponse * @throws ServiceClientException */ public function ResetWorkflowExecution(V1\ResetWorkflowExecutionRequest $arg, ContextInterface $ctx = null): V1\ResetWorkflowExecutionResponse @@ -513,9 +441,6 @@ public function ResetWorkflowExecution(V1\ResetWorkflowExecutionRequest $arg, Co * the * execution instance. * - * @param V1\TerminateWorkflowExecutionRequest $arg - * @param ContextInterface|null $ctx - * @return V1\TerminateWorkflowExecutionResponse * @throws ServiceClientException */ public function TerminateWorkflowExecution(V1\TerminateWorkflowExecutionRequest $arg, ContextInterface $ctx = null): V1\TerminateWorkflowExecutionResponse @@ -535,9 +460,6 @@ public function TerminateWorkflowExecution(V1\TerminateWorkflowExecutionRequest * aip.dev/not-precedent: Workflow deletion not exposed to HTTP, users should use * cancel or terminate. --) * - * @param V1\DeleteWorkflowExecutionRequest $arg - * @param ContextInterface|null $ctx - * @return V1\DeleteWorkflowExecutionResponse * @throws ServiceClientException */ public function DeleteWorkflowExecution(V1\DeleteWorkflowExecutionRequest $arg, ContextInterface $ctx = null): V1\DeleteWorkflowExecutionResponse @@ -552,9 +474,6 @@ public function DeleteWorkflowExecution(V1\DeleteWorkflowExecutionRequest $arg, * (-- api-linter: core::0127::http-annotation=disabled * aip.dev/not-precedent: HTTP users should use ListWorkflowExecutions instead. --) * - * @param V1\ListOpenWorkflowExecutionsRequest $arg - * @param ContextInterface|null $ctx - * @return V1\ListOpenWorkflowExecutionsResponse * @throws ServiceClientException */ public function ListOpenWorkflowExecutions(V1\ListOpenWorkflowExecutionsRequest $arg, ContextInterface $ctx = null): V1\ListOpenWorkflowExecutionsResponse @@ -569,9 +488,6 @@ public function ListOpenWorkflowExecutions(V1\ListOpenWorkflowExecutionsRequest * (-- api-linter: core::0127::http-annotation=disabled * aip.dev/not-precedent: HTTP users should use ListWorkflowExecutions instead. --) * - * @param V1\ListClosedWorkflowExecutionsRequest $arg - * @param ContextInterface|null $ctx - * @return V1\ListClosedWorkflowExecutionsResponse * @throws ServiceClientException */ public function ListClosedWorkflowExecutions(V1\ListClosedWorkflowExecutionsRequest $arg, ContextInterface $ctx = null): V1\ListClosedWorkflowExecutionsResponse @@ -583,9 +499,6 @@ public function ListClosedWorkflowExecutions(V1\ListClosedWorkflowExecutionsRequ * ListWorkflowExecutions is a visibility API to list workflow executions in a * specific namespace. * - * @param V1\ListWorkflowExecutionsRequest $arg - * @param ContextInterface|null $ctx - * @return V1\ListWorkflowExecutionsResponse * @throws ServiceClientException */ public function ListWorkflowExecutions(V1\ListWorkflowExecutionsRequest $arg, ContextInterface $ctx = null): V1\ListWorkflowExecutionsResponse @@ -597,9 +510,6 @@ 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 ContextInterface|null $ctx - * @return V1\ListArchivedWorkflowExecutionsResponse * @throws ServiceClientException */ public function ListArchivedWorkflowExecutions(V1\ListArchivedWorkflowExecutionsRequest $arg, ContextInterface $ctx = null): V1\ListArchivedWorkflowExecutionsResponse @@ -614,9 +524,6 @@ public function ListArchivedWorkflowExecutions(V1\ListArchivedWorkflowExecutions * (-- api-linter: core::0127::http-annotation=disabled * aip.dev/not-precedent: HTTP users should use ListWorkflowExecutions instead. --) * - * @param V1\ScanWorkflowExecutionsRequest $arg - * @param ContextInterface|null $ctx - * @return V1\ScanWorkflowExecutionsResponse * @throws ServiceClientException */ public function ScanWorkflowExecutions(V1\ScanWorkflowExecutionsRequest $arg, ContextInterface $ctx = null): V1\ScanWorkflowExecutionsResponse @@ -628,9 +535,6 @@ public function ScanWorkflowExecutions(V1\ScanWorkflowExecutionsRequest $arg, Co * CountWorkflowExecutions is a visibility API to count of workflow executions in a * specific namespace. * - * @param V1\CountWorkflowExecutionsRequest $arg - * @param ContextInterface|null $ctx - * @return V1\CountWorkflowExecutionsResponse * @throws ServiceClientException */ public function CountWorkflowExecutions(V1\CountWorkflowExecutionsRequest $arg, ContextInterface $ctx = null): V1\CountWorkflowExecutionsResponse @@ -646,9 +550,6 @@ public function CountWorkflowExecutions(V1\CountWorkflowExecutionsRequest $arg, * aip.dev/not-precedent: We do not expose this search attribute API to HTTP (but * may expose on OperatorService). --) * - * @param V1\GetSearchAttributesRequest $arg - * @param ContextInterface|null $ctx - * @return V1\GetSearchAttributesResponse * @throws ServiceClientException */ public function GetSearchAttributes(V1\GetSearchAttributesRequest $arg, ContextInterface $ctx = null): V1\GetSearchAttributesResponse @@ -668,9 +569,6 @@ public function GetSearchAttributes(V1\GetSearchAttributesRequest $arg, ContextI * (-- api-linter: core::0127::http-annotation=disabled * aip.dev/not-precedent: We do not expose worker API to HTTP. --) * - * @param V1\RespondQueryTaskCompletedRequest $arg - * @param ContextInterface|null $ctx - * @return V1\RespondQueryTaskCompletedResponse * @throws ServiceClientException */ public function RespondQueryTaskCompleted(V1\RespondQueryTaskCompletedRequest $arg, ContextInterface $ctx = null): V1\RespondQueryTaskCompletedResponse @@ -692,9 +590,6 @@ public function RespondQueryTaskCompleted(V1\RespondQueryTaskCompletedRequest $a * (-- api-linter: core::0127::http-annotation=disabled * aip.dev/not-precedent: We do not expose worker API to HTTP. --) * - * @param V1\ResetStickyTaskQueueRequest $arg - * @param ContextInterface|null $ctx - * @return V1\ResetStickyTaskQueueResponse * @throws ServiceClientException */ public function ResetStickyTaskQueue(V1\ResetStickyTaskQueueRequest $arg, ContextInterface $ctx = null): V1\ResetStickyTaskQueueResponse @@ -705,9 +600,6 @@ public function ResetStickyTaskQueue(V1\ResetStickyTaskQueueRequest $arg, Contex /** * QueryWorkflow requests a query be executed for a specified workflow execution. * - * @param V1\QueryWorkflowRequest $arg - * @param ContextInterface|null $ctx - * @return V1\QueryWorkflowResponse * @throws ServiceClientException */ public function QueryWorkflow(V1\QueryWorkflowRequest $arg, ContextInterface $ctx = null): V1\QueryWorkflowResponse @@ -719,9 +611,6 @@ public function QueryWorkflow(V1\QueryWorkflowRequest $arg, ContextInterface $ct * DescribeWorkflowExecution returns information about the specified workflow * execution. * - * @param V1\DescribeWorkflowExecutionRequest $arg - * @param ContextInterface|null $ctx - * @return V1\DescribeWorkflowExecutionResponse * @throws ServiceClientException */ public function DescribeWorkflowExecution(V1\DescribeWorkflowExecutionRequest $arg, ContextInterface $ctx = null): V1\DescribeWorkflowExecutionResponse @@ -736,9 +625,6 @@ public function DescribeWorkflowExecution(V1\DescribeWorkflowExecutionRequest $a * - Workflow Reachability status * - Backlog info for Workflow and/or Activity tasks * - * @param V1\DescribeTaskQueueRequest $arg - * @param ContextInterface|null $ctx - * @return V1\DescribeTaskQueueResponse * @throws ServiceClientException */ public function DescribeTaskQueue(V1\DescribeTaskQueueRequest $arg, ContextInterface $ctx = null): V1\DescribeTaskQueueResponse @@ -749,9 +635,6 @@ public function DescribeTaskQueue(V1\DescribeTaskQueueRequest $arg, ContextInter /** * GetClusterInfo returns information about temporal cluster * - * @param V1\GetClusterInfoRequest $arg - * @param ContextInterface|null $ctx - * @return V1\GetClusterInfoResponse * @throws ServiceClientException */ public function GetClusterInfo(V1\GetClusterInfoRequest $arg, ContextInterface $ctx = null): V1\GetClusterInfoResponse @@ -762,9 +645,6 @@ public function GetClusterInfo(V1\GetClusterInfoRequest $arg, ContextInterface $ /** * GetSystemInfo returns information about the system. * - * @param V1\GetSystemInfoRequest $arg - * @param ContextInterface|null $ctx - * @return V1\GetSystemInfoResponse * @throws ServiceClientException */ public function GetSystemInfo(V1\GetSystemInfoRequest $arg, ContextInterface $ctx = null): V1\GetSystemInfoResponse @@ -776,9 +656,6 @@ public function GetSystemInfo(V1\GetSystemInfoRequest $arg, ContextInterface $ct * (-- api-linter: core::0127::http-annotation=disabled * aip.dev/not-precedent: We do not expose this low-level API to HTTP. --) * - * @param V1\ListTaskQueuePartitionsRequest $arg - * @param ContextInterface|null $ctx - * @return V1\ListTaskQueuePartitionsResponse * @throws ServiceClientException */ public function ListTaskQueuePartitions(V1\ListTaskQueuePartitionsRequest $arg, ContextInterface $ctx = null): V1\ListTaskQueuePartitionsResponse @@ -789,9 +666,6 @@ public function ListTaskQueuePartitions(V1\ListTaskQueuePartitionsRequest $arg, /** * Creates a new schedule. * - * @param V1\CreateScheduleRequest $arg - * @param ContextInterface|null $ctx - * @return V1\CreateScheduleResponse * @throws ServiceClientException */ public function CreateSchedule(V1\CreateScheduleRequest $arg, ContextInterface $ctx = null): V1\CreateScheduleResponse @@ -802,9 +676,6 @@ public function CreateSchedule(V1\CreateScheduleRequest $arg, ContextInterface $ /** * Returns the schedule description and current state of an existing schedule. * - * @param V1\DescribeScheduleRequest $arg - * @param ContextInterface|null $ctx - * @return V1\DescribeScheduleResponse * @throws ServiceClientException */ public function DescribeSchedule(V1\DescribeScheduleRequest $arg, ContextInterface $ctx = null): V1\DescribeScheduleResponse @@ -815,9 +686,6 @@ public function DescribeSchedule(V1\DescribeScheduleRequest $arg, ContextInterfa /** * Changes the configuration or state of an existing schedule. * - * @param V1\UpdateScheduleRequest $arg - * @param ContextInterface|null $ctx - * @return V1\UpdateScheduleResponse * @throws ServiceClientException */ public function UpdateSchedule(V1\UpdateScheduleRequest $arg, ContextInterface $ctx = null): V1\UpdateScheduleResponse @@ -828,9 +696,6 @@ public function UpdateSchedule(V1\UpdateScheduleRequest $arg, ContextInterface $ /** * Makes a specific change to a schedule or triggers an immediate action. * - * @param V1\PatchScheduleRequest $arg - * @param ContextInterface|null $ctx - * @return V1\PatchScheduleResponse * @throws ServiceClientException */ public function PatchSchedule(V1\PatchScheduleRequest $arg, ContextInterface $ctx = null): V1\PatchScheduleResponse @@ -841,9 +706,6 @@ public function PatchSchedule(V1\PatchScheduleRequest $arg, ContextInterface $ct /** * Lists matching times within a range. * - * @param V1\ListScheduleMatchingTimesRequest $arg - * @param ContextInterface|null $ctx - * @return V1\ListScheduleMatchingTimesResponse * @throws ServiceClientException */ public function ListScheduleMatchingTimes(V1\ListScheduleMatchingTimesRequest $arg, ContextInterface $ctx = null): V1\ListScheduleMatchingTimesResponse @@ -854,9 +716,6 @@ public function ListScheduleMatchingTimes(V1\ListScheduleMatchingTimesRequest $a /** * Deletes a schedule, removing it from the system. * - * @param V1\DeleteScheduleRequest $arg - * @param ContextInterface|null $ctx - * @return V1\DeleteScheduleResponse * @throws ServiceClientException */ public function DeleteSchedule(V1\DeleteScheduleRequest $arg, ContextInterface $ctx = null): V1\DeleteScheduleResponse @@ -867,9 +726,6 @@ public function DeleteSchedule(V1\DeleteScheduleRequest $arg, ContextInterface $ /** * List all schedules in a namespace. * - * @param V1\ListSchedulesRequest $arg - * @param ContextInterface|null $ctx - * @return V1\ListSchedulesResponse * @throws ServiceClientException */ public function ListSchedules(V1\ListSchedulesRequest $arg, ContextInterface $ctx = null): V1\ListSchedulesResponse @@ -902,9 +758,6 @@ public function ListSchedules(V1\ListSchedulesRequest $arg, ContextInterface $ct * (-- api-linter: core::0127::http-annotation=disabled * aip.dev/not-precedent: We do yet expose versioning API to HTTP. --) * - * @param V1\UpdateWorkerBuildIdCompatibilityRequest $arg - * @param ContextInterface|null $ctx - * @return V1\UpdateWorkerBuildIdCompatibilityResponse * @throws ServiceClientException */ public function UpdateWorkerBuildIdCompatibility(V1\UpdateWorkerBuildIdCompatibilityRequest $arg, ContextInterface $ctx = null): V1\UpdateWorkerBuildIdCompatibilityResponse @@ -916,9 +769,6 @@ public function UpdateWorkerBuildIdCompatibility(V1\UpdateWorkerBuildIdCompatibi * Deprecated. Use `GetWorkerVersioningRules`. * Fetches the worker build id versioning sets for a task queue. * - * @param V1\GetWorkerBuildIdCompatibilityRequest $arg - * @param ContextInterface|null $ctx - * @return V1\GetWorkerBuildIdCompatibilityResponse * @throws ServiceClientException */ public function GetWorkerBuildIdCompatibility(V1\GetWorkerBuildIdCompatibilityRequest $arg, ContextInterface $ctx = null): V1\GetWorkerBuildIdCompatibilityResponse @@ -934,9 +784,6 @@ public function GetWorkerBuildIdCompatibility(V1\GetWorkerBuildIdCompatibilityRe * (-- api-linter: core::0127::http-annotation=disabled * aip.dev/not-precedent: We do yet expose versioning API to HTTP. --) * - * @param V1\UpdateWorkerVersioningRulesRequest $arg - * @param ContextInterface|null $ctx - * @return V1\UpdateWorkerVersioningRulesResponse * @throws ServiceClientException */ public function UpdateWorkerVersioningRules(V1\UpdateWorkerVersioningRulesRequest $arg, ContextInterface $ctx = null): V1\UpdateWorkerVersioningRulesResponse @@ -949,9 +796,6 @@ public function UpdateWorkerVersioningRules(V1\UpdateWorkerVersioningRulesReques * WARNING: Worker Versioning is not yet stable and the API and behavior may change * incompatibly. * - * @param V1\GetWorkerVersioningRulesRequest $arg - * @param ContextInterface|null $ctx - * @return V1\GetWorkerVersioningRulesResponse * @throws ServiceClientException */ public function GetWorkerVersioningRules(V1\GetWorkerVersioningRulesRequest $arg, ContextInterface $ctx = null): V1\GetWorkerVersioningRulesResponse @@ -982,9 +826,6 @@ public function GetWorkerVersioningRules(V1\GetWorkerVersioningRulesRequest $arg * `limit.reachabilityTaskQueueScan` with the caveat that this call can strain the * visibility store. * - * @param V1\GetWorkerTaskReachabilityRequest $arg - * @param ContextInterface|null $ctx - * @return V1\GetWorkerTaskReachabilityResponse * @throws ServiceClientException */ public function GetWorkerTaskReachability(V1\GetWorkerTaskReachabilityRequest $arg, ContextInterface $ctx = null): V1\GetWorkerTaskReachabilityResponse @@ -995,9 +836,6 @@ public function GetWorkerTaskReachability(V1\GetWorkerTaskReachabilityRequest $a /** * Invokes the specified update function on user workflow code. * - * @param V1\UpdateWorkflowExecutionRequest $arg - * @param ContextInterface|null $ctx - * @return V1\UpdateWorkflowExecutionResponse * @throws ServiceClientException */ public function UpdateWorkflowExecution(V1\UpdateWorkflowExecutionRequest $arg, ContextInterface $ctx = null): V1\UpdateWorkflowExecutionResponse @@ -1015,9 +853,6 @@ public function UpdateWorkflowExecution(V1\UpdateWorkflowExecutionRequest $arg, * aip.dev/not-precedent: We don't expose update polling API to HTTP in favor of a * potential future non-blocking form. --) * - * @param V1\PollWorkflowExecutionUpdateRequest $arg - * @param ContextInterface|null $ctx - * @return V1\PollWorkflowExecutionUpdateResponse * @throws ServiceClientException */ public function PollWorkflowExecutionUpdate(V1\PollWorkflowExecutionUpdateRequest $arg, ContextInterface $ctx = null): V1\PollWorkflowExecutionUpdateResponse @@ -1028,9 +863,6 @@ public function PollWorkflowExecutionUpdate(V1\PollWorkflowExecutionUpdateReques /** * StartBatchOperation starts a new batch operation * - * @param V1\StartBatchOperationRequest $arg - * @param ContextInterface|null $ctx - * @return V1\StartBatchOperationResponse * @throws ServiceClientException */ public function StartBatchOperation(V1\StartBatchOperationRequest $arg, ContextInterface $ctx = null): V1\StartBatchOperationResponse @@ -1041,9 +873,6 @@ public function StartBatchOperation(V1\StartBatchOperationRequest $arg, ContextI /** * StopBatchOperation stops a batch operation * - * @param V1\StopBatchOperationRequest $arg - * @param ContextInterface|null $ctx - * @return V1\StopBatchOperationResponse * @throws ServiceClientException */ public function StopBatchOperation(V1\StopBatchOperationRequest $arg, ContextInterface $ctx = null): V1\StopBatchOperationResponse @@ -1054,9 +883,6 @@ public function StopBatchOperation(V1\StopBatchOperationRequest $arg, ContextInt /** * DescribeBatchOperation returns the information about a batch operation * - * @param V1\DescribeBatchOperationRequest $arg - * @param ContextInterface|null $ctx - * @return V1\DescribeBatchOperationResponse * @throws ServiceClientException */ public function DescribeBatchOperation(V1\DescribeBatchOperationRequest $arg, ContextInterface $ctx = null): V1\DescribeBatchOperationResponse @@ -1067,9 +893,6 @@ public function DescribeBatchOperation(V1\DescribeBatchOperationRequest $arg, Co /** * ListBatchOperations returns a list of batch operations * - * @param V1\ListBatchOperationsRequest $arg - * @param ContextInterface|null $ctx - * @return V1\ListBatchOperationsResponse * @throws ServiceClientException */ public function ListBatchOperations(V1\ListBatchOperationsRequest $arg, ContextInterface $ctx = null): V1\ListBatchOperationsResponse @@ -1082,9 +905,6 @@ public function ListBatchOperations(V1\ListBatchOperationsRequest $arg, ContextI * (-- api-linter: core::0127::http-annotation=disabled * aip.dev/not-precedent: We do not expose worker API to HTTP. --) * - * @param V1\PollNexusTaskQueueRequest $arg - * @param ContextInterface|null $ctx - * @return V1\PollNexusTaskQueueResponse * @throws ServiceClientException */ public function PollNexusTaskQueue(V1\PollNexusTaskQueueRequest $arg, ContextInterface $ctx = null): V1\PollNexusTaskQueueResponse @@ -1098,9 +918,6 @@ public function PollNexusTaskQueue(V1\PollNexusTaskQueueRequest $arg, ContextInt * (-- api-linter: core::0127::http-annotation=disabled * aip.dev/not-precedent: We do not expose worker API to HTTP. --) * - * @param V1\RespondNexusTaskCompletedRequest $arg - * @param ContextInterface|null $ctx - * @return V1\RespondNexusTaskCompletedResponse * @throws ServiceClientException */ public function RespondNexusTaskCompleted(V1\RespondNexusTaskCompletedRequest $arg, ContextInterface $ctx = null): V1\RespondNexusTaskCompletedResponse @@ -1114,9 +931,6 @@ public function RespondNexusTaskCompleted(V1\RespondNexusTaskCompletedRequest $a * (-- api-linter: core::0127::http-annotation=disabled * aip.dev/not-precedent: We do not expose worker API to HTTP. --) * - * @param V1\RespondNexusTaskFailedRequest $arg - * @param ContextInterface|null $ctx - * @return V1\RespondNexusTaskFailedResponse * @throws ServiceClientException */ public function RespondNexusTaskFailed(V1\RespondNexusTaskFailedRequest $arg, ContextInterface $ctx = null): V1\RespondNexusTaskFailedResponse diff --git a/src/Client/ScheduleClient.php b/src/Client/ScheduleClient.php index 5348cdab6..9a486a439 100644 --- a/src/Client/ScheduleClient.php +++ b/src/Client/ScheduleClient.php @@ -46,11 +46,6 @@ final class ScheduleClient implements ScheduleClientInterface private MarshallerInterface $marshaller; private ProtoToArrayConverter $protoConverter; - /** - * @param ServiceClientInterface $serviceClient - * @param ClientOptions|null $options - * @param DataConverterInterface|null $converter - */ public function __construct( ServiceClientInterface $serviceClient, ClientOptions $options = null, diff --git a/src/Client/Update/UpdateHandle.php b/src/Client/Update/UpdateHandle.php index 4183e5314..9ae65569d 100644 --- a/src/Client/Update/UpdateHandle.php +++ b/src/Client/Update/UpdateHandle.php @@ -57,7 +57,6 @@ public function getId(): string /** * Check there is a cached accepted result or failure for this update request. * - * @return bool */ public function hasResult(): bool { diff --git a/src/Client/WorkflowClient.php b/src/Client/WorkflowClient.php index 0065915f6..7eb2d7206 100644 --- a/src/Client/WorkflowClient.php +++ b/src/Client/WorkflowClient.php @@ -64,12 +64,6 @@ class WorkflowClient implements WorkflowClientInterface /** @var Pipeline */ private Pipeline $interceptorPipeline; - /** - * @param ServiceClientInterface $serviceClient - * @param ClientOptions|null $options - * @param DataConverterInterface|null $converter - * @param PipelineProvider|null $interceptorProvider - */ public function __construct( ServiceClientInterface $serviceClient, ClientOptions $options = null, @@ -85,9 +79,6 @@ public function __construct( } /** - * @param ServiceClientInterface $serviceClient - * @param ClientOptions|null $options - * @param DataConverterInterface|null $converter * @return static */ public static function create( @@ -99,9 +90,6 @@ public static function create( return new self($serviceClient, $options, $converter, $interceptorProvider); } - /** - * @return ServiceClientInterface - */ public function getServiceClient(): ServiceClientInterface { return $this->client; @@ -113,7 +101,6 @@ public function getServiceClient(): ServiceClientInterface * * @param object|WorkflowStubInterface $workflow * @param mixed ...$args - * @return WorkflowRunInterface */ public function start($workflow, ...$args): WorkflowRunInterface { @@ -159,10 +146,6 @@ public function start($workflow, ...$args): WorkflowRunInterface /** * @param object|WorkflowStubInterface $workflow - * @param string $signal - * @param array $signalArgs - * @param array $startArgs - * @return WorkflowRunInterface */ public function startWithSignal( $workflow, @@ -222,9 +205,6 @@ public function startWithSignal( ); } - /** - * {@inheritDoc} - */ public function newWorkflowStub( string $class, WorkflowOptions $options = null, @@ -238,9 +218,6 @@ public function newWorkflowStub( ); } - /** - * {@inheritDoc} - */ public function newUntypedWorkflowStub( string $workflowType, WorkflowOptions $options = null, @@ -257,9 +234,6 @@ public function newUntypedWorkflowStub( ); } - /** - * {@inheritDoc} - */ public function newRunningWorkflowStub(string $class, string $workflowID, ?string $runID = null): object { $workflow = $this->reader->fromClass($class); @@ -271,9 +245,6 @@ public function newRunningWorkflowStub(string $class, string $workflowID, ?strin ); } - /** - * {@inheritDoc} - */ public function newUntypedRunningWorkflowStub( string $workflowID, ?string $runID = null, @@ -291,17 +262,11 @@ public function newUntypedRunningWorkflowStub( return $untyped; } - /** - * {@inheritDoc} - */ public function newActivityCompletionClient(): ActivityCompletionClientInterface { return new ActivityCompletionClient($this->client, $this->clientOptions, $this->converter); } - /** - * @inheritDoc - */ public function listWorkflowExecutions( string $query, ?string $namespace = null, @@ -338,9 +303,6 @@ public function listWorkflowExecutions( return Paginator::createFromGenerator($loader($request), $counter); } - /** - * @inheritDoc - */ public function countWorkflowExecutions( string $query, ?string $namespace = null, @@ -356,9 +318,6 @@ public function countWorkflowExecutions( ); } - /** - * @inheritDoc - */ public function getWorkflowHistory( WorkflowExecution $execution, ?string $namespace = null, @@ -404,9 +363,6 @@ public function __clone() $this->starter = null; } - /** - * @return ReaderInterface - */ private function createReader(): ReaderInterface { if (\interface_exists(Reader::class)) { diff --git a/src/Client/WorkflowClientInterface.php b/src/Client/WorkflowClientInterface.php index 2a95eae8c..bcb7de0c4 100644 --- a/src/Client/WorkflowClientInterface.php +++ b/src/Client/WorkflowClientInterface.php @@ -23,9 +23,6 @@ interface WorkflowClientInterface extends ClientContextInterface { - /** - * @return ServiceClientInterface - */ public function getServiceClient(): ServiceClientInterface; /** @@ -33,7 +30,6 @@ public function getServiceClient(): ServiceClientInterface; * * @param WorkflowStubInterface|object $workflow * @param mixed $args - * @return WorkflowRunInterface */ public function start($workflow, ...$args): WorkflowRunInterface; @@ -41,10 +37,6 @@ public function start($workflow, ...$args): WorkflowRunInterface; * Starts untyped and typed workflow stubs in async mode. Sends signal on start. * * @param object|WorkflowStubInterface $workflow - * @param string $signal - * @param array $signalArgs - * @param array $startArgs - * @return WorkflowRunInterface */ public function startWithSignal( $workflow, @@ -66,7 +58,6 @@ public function startWithSignal( * * @psalm-template T of object * @param class-string $class - * @param WorkflowOptions|null $options * @return T */ public function newWorkflowStub( @@ -84,9 +75,6 @@ public function newWorkflowStub( * IMPORTANT! Stub is per workflow instance. So new stub should be created * for each new one. * - * @param string $workflowType - * @param WorkflowOptions|null $options - * @return WorkflowStubInterface */ public function newUntypedWorkflowStub( string $workflowType, @@ -98,8 +86,6 @@ public function newUntypedWorkflowStub( * * @psalm-template T of object * @param class-string $class - * @param string $workflowID - * @param string|null $runID * @return T */ public function newRunningWorkflowStub( @@ -111,10 +97,6 @@ public function newRunningWorkflowStub( /** * Returns untyped workflow stub associated with running workflow. * - * @param string $workflowID - * @param string|null $runID - * @param string|null $workflowType - * @return WorkflowStubInterface */ public function newUntypedRunningWorkflowStub( string $workflowID, @@ -130,7 +112,6 @@ public function newUntypedRunningWorkflowStub( * * @see ActivityCompletionClient * - * @return ActivityCompletionClientInterface */ public function newActivityCompletionClient(): ActivityCompletionClientInterface; @@ -177,18 +158,15 @@ public function countWorkflowExecutions( ): CountWorkflowExecutions; /** - * @param WorkflowExecution $execution * @param non-empty-string|null $namespace If null, the preconfigured namespace will be used. * @param bool $waitNewEvent If set to true, the RPC call will not resolve until there is a new event which matches, * the $historyEventFilterType, or a timeout is hit. The RPC call will be resolved immediately if the * workflow was already finished. * @param int<0, 2>| $historyEventFilterType Filter returned events such that they match the specified filter type. * Available values are {@see HistoryEventFilterType} constants. - * @param bool $skipArchival * @param int<0, max> $pageSize Size of the pages to be requested. It affects internal queries only. Use it if you * want to load limited number of events from the history. * - * @return WorkflowExecutionHistory */ public function getWorkflowHistory( WorkflowExecution $execution, diff --git a/src/Client/WorkflowOptions.php b/src/Client/WorkflowOptions.php index 9716c1f07..f25e325e7 100644 --- a/src/Client/WorkflowOptions.php +++ b/src/Client/WorkflowOptions.php @@ -163,8 +163,6 @@ public function __construct() } /** - * @param MethodRetry|null $retry - * @param CronSchedule|null $cron * * @return self return a new {@see self} instance with merged options */ @@ -189,7 +187,6 @@ public function mergeWith(MethodRetry $retry = null, CronSchedule $cron = null): * deduplication will happen based on the generated id. So prefer assigning * business meaningful ids if possible. * - * @param string $workflowId * @return $this */ #[Pure] @@ -207,7 +204,6 @@ public function withWorkflowId(string $workflowId): self * specified when creating a {@see Worker} that hosts the * workflow code. * - * @param string $taskQueue * @return $this */ #[Pure] @@ -227,7 +223,6 @@ public function withTaskQueue(string $taskQueue): self * Eager Workflow Dispatch can be enabled if the server supports it and a local worker * is available the task is fed directly to the worker. * - * @param bool $value * @return $this */ #[Pure] @@ -375,7 +370,6 @@ public function withWorkflowIdConflictPolicy(WorkflowIdConflictPolicy $policy): * RetryOptions that define how child workflow is retried in case of * failure. Default is null which is no reties. * - * @param RetryOptions|null $options * @return $this */ #[Pure] @@ -389,7 +383,6 @@ public function withRetryOptions(?RetryOptions $options): self } /** - * @param string|null $expression * @return $this */ #[Pure] @@ -405,7 +398,6 @@ public function withCronSchedule(?string $expression): self /** * Specifies additional non-indexed information in result of list workflow. * - * @param array|null $memo * @return $this */ #[Pure] @@ -421,7 +413,6 @@ public function withMemo(?array $memo): self /** * Specifies additional indexed information in result of list workflow. * - * @param array|null $searchAttributes * @return $this */ #[Pure] @@ -435,8 +426,6 @@ public function withSearchAttributes(?array $searchAttributes): self } /** - * @param DataConverterInterface $converter - * @return Memo|null * @internal */ public function toMemo(DataConverterInterface $converter): ?Memo @@ -458,8 +447,6 @@ public function toMemo(DataConverterInterface $converter): ?Memo } /** - * @param DataConverterInterface $converter - * @return SearchAttributes|null * @internal */ public function toSearchAttributes(DataConverterInterface $converter): ?SearchAttributes diff --git a/src/Client/WorkflowStubInterface.php b/src/Client/WorkflowStubInterface.php index b939b1eda..065a2f10c 100644 --- a/src/Client/WorkflowStubInterface.php +++ b/src/Client/WorkflowStubInterface.php @@ -32,16 +32,12 @@ */ interface WorkflowStubInterface extends WorkflowRunInterface { - /** - * @return string|null - */ public function getWorkflowType(): ?string; /** * Returns associated workflow options. Empty for running workflows. Workflow options are immutable and can * not be changed after the workflow was created. * - * @return WorkflowOptions|null */ public function getOptions(): ?WorkflowOptions; @@ -55,21 +51,18 @@ public function getExecution(): WorkflowExecution; /** * Check if workflow was started and has associated execution. * - * @return bool */ public function hasExecution(): bool; /** * Attaches running workflow context to the workflow stub. * - * @param WorkflowExecution $execution */ public function setExecution(WorkflowExecution $execution): void; /** * Sends named signal to the workflow execution. * - * @param string $name * @param mixed ...$args */ public function signal(string $name, ...$args): void; @@ -79,9 +72,7 @@ public function signal(string $name, ...$args): void; * * Usually a query handler is a method annotated with {@see QueryMethod}. * - * @param string $name * @param mixed ...$args - * @return ValuesInterface|null */ public function query(string $name, ...$args): ?ValuesInterface; @@ -92,7 +83,6 @@ public function query(string $name, ...$args): ?ValuesInterface; * * @param non-empty-string $name Name of the update handler. * @param mixed ...$args Arguments to pass to the update handler. - * @return ValuesInterface|null * @throws WorkflowUpdateException * @throws WorkflowUpdateRPCTimeoutOrCanceledException */ @@ -130,7 +120,6 @@ public function getUpdateHandle(string $updateId, mixed $resultType = null): Upd * main workflow method. Note that workflow can take long time to get * canceled or even completely ignore the cancellation request. * - * @return void */ public function cancel(): void; @@ -140,9 +129,6 @@ public function cancel(): void; * Termination is a hard stop of a workflow execution which doesn't give * workflow code any chance to perform cleanup. * - * @param string $reason - * @param array $details - * @return void */ public function terminate(string $reason, array $details = []): void; } diff --git a/src/Common/CronSchedule.php b/src/Common/CronSchedule.php index 956930a59..abc9141ef 100644 --- a/src/Common/CronSchedule.php +++ b/src/Common/CronSchedule.php @@ -50,22 +50,15 @@ final class CronSchedule implements \Stringable * * * * * * * ``` * - * @var string */ #[Immutable] public string $interval; - /** - * @param string $interval - */ public function __construct(string $interval) { $this->interval = $interval; } - /** - * {@inheritDoc} - */ public function __toString(): string { return (string) $this->interval; diff --git a/src/Common/MethodRetry.php b/src/Common/MethodRetry.php index 658b454dd..d488b1234 100644 --- a/src/Common/MethodRetry.php +++ b/src/Common/MethodRetry.php @@ -37,7 +37,6 @@ final class MethodRetry extends RetryOptions * @param DateIntervalValue|null $initialInterval * @param DateIntervalValue|null $maximumInterval * @param int<0, max> $maximumAttempts - * @param float $backoffCoefficient * @param ExceptionsList $nonRetryableExceptions */ public function __construct( diff --git a/src/Common/RetryOptions.php b/src/Common/RetryOptions.php index 1a4b65269..bffacb4a6 100644 --- a/src/Common/RetryOptions.php +++ b/src/Common/RetryOptions.php @@ -106,10 +106,6 @@ class RetryOptions extends Options #[Marshal(name: 'non_retryable_error_types')] public array $nonRetryableExceptions = self::DEFAULT_NON_RETRYABLE_EXCEPTIONS; - /** - * @param MethodRetry|null $retry - * @return self - */ public function mergeWith(MethodRetry $retry = null): self { $self = clone $this; @@ -142,7 +138,6 @@ public function withInitialInterval($interval): self /** * @psalm-suppress ImpureMethodCall * - * @param float $coefficient * @return static */ #[Pure] @@ -207,7 +202,6 @@ public function withNonRetryableExceptions(array $exceptions): self /** * Converts DTO to protobuf object * - * @return RetryPolicy * @psalm-suppress ImpureMethodCall */ public function toWorkflowRetryPolicy(): RetryPolicy diff --git a/src/Common/Uuid.php b/src/Common/Uuid.php index 17f7612da..d8230f91f 100644 --- a/src/Common/Uuid.php +++ b/src/Common/Uuid.php @@ -25,9 +25,6 @@ final class Uuid */ public const NIL = '00000000-0000-0000-0000-000000000000'; - /** - * @return string - */ public static function nil(): string { return self::NIL; @@ -56,7 +53,6 @@ public static function v4(): string } /** - * @return string * @throws \Exception */ private static function bytes(): string @@ -81,9 +77,6 @@ private static function bytes(): string * @see http://tools.ietf.org/html/rfc4122#section-4.1.3 * * @psalm-pure - * @param int $timeHi - * @param int $version - * @return int */ private static function version(int $timeHi, int $version): int { @@ -96,8 +89,6 @@ private static function version(int $timeHi, int $version): int * @see http://tools.ietf.org/html/rfc4122#section-4.1.1 * * @psalm-pure - * @param int $clockSeq - * @return int */ private static function variant(int $clockSeq): int { diff --git a/src/DataConverter/BinaryConverter.php b/src/DataConverter/BinaryConverter.php index 03c8658b9..dd708d040 100644 --- a/src/DataConverter/BinaryConverter.php +++ b/src/DataConverter/BinaryConverter.php @@ -16,9 +16,6 @@ class BinaryConverter extends Converter { - /** - * @return string - */ public function getEncodingType(): string { return EncodingKeys::METADATA_ENCODING_RAW; @@ -26,7 +23,6 @@ public function getEncodingType(): string /** * @param mixed $value - * @return Payload|null */ public function toPayload($value): ?Payload { @@ -38,8 +34,6 @@ public function toPayload($value): ?Payload } /** - * @param Payload $payload - * @param Type $type * @return Bytes */ public function fromPayload(Payload $payload, Type $type) diff --git a/src/DataConverter/Bytes.php b/src/DataConverter/Bytes.php index fa8b86006..462225851 100644 --- a/src/DataConverter/Bytes.php +++ b/src/DataConverter/Bytes.php @@ -13,30 +13,18 @@ final class Bytes implements \Stringable { - /** - * @var string - */ private string $data; - /** - * @param string $data - */ public function __construct(string $data) { $this->data = $data; } - /** - * @return int - */ public function getSize(): int { return \strlen($this->data); } - /** - * @return string - */ public function getData(): string { return $this->data; diff --git a/src/DataConverter/Converter.php b/src/DataConverter/Converter.php index f6aa05d44..abb6dd2fd 100644 --- a/src/DataConverter/Converter.php +++ b/src/DataConverter/Converter.php @@ -15,10 +15,6 @@ abstract class Converter implements PayloadConverterInterface { - /** - * @param string $data - * @return Payload - */ protected function create(string $data): Payload { $payload = new Payload(); diff --git a/src/DataConverter/DataConverter.php b/src/DataConverter/DataConverter.php index 6ba436aaa..d3ea48b55 100644 --- a/src/DataConverter/DataConverter.php +++ b/src/DataConverter/DataConverter.php @@ -21,9 +21,6 @@ final class DataConverter implements DataConverterInterface */ private array $converters = []; - /** - * @param PayloadConverterInterface ...$converter - */ public function __construct(PayloadConverterInterface ...$converter) { foreach ($converter as $c) { @@ -31,9 +28,6 @@ public function __construct(PayloadConverterInterface ...$converter) } } - /** - * @return DataConverterInterface - */ public static function createDefault(): DataConverterInterface { return new DataConverter( @@ -45,9 +39,6 @@ public static function createDefault(): DataConverterInterface ); } - /** - * {@inheritDoc} - */ public function fromPayload(Payload $payload, $type) { /** @var \ArrayAccess $meta */ @@ -73,7 +64,6 @@ public function fromPayload(Payload $payload, $type) /** * @param mixed $value - * @return Payload * * @throws DataConverterException */ diff --git a/src/DataConverter/DataConverterInterface.php b/src/DataConverter/DataConverterInterface.php index b20806481..0033d0f98 100644 --- a/src/DataConverter/DataConverterInterface.php +++ b/src/DataConverter/DataConverterInterface.php @@ -17,7 +17,6 @@ interface DataConverterInterface { /** - * @param Payload $payload * @param string|\ReflectionClass|\ReflectionType|Type|null $type * @return mixed * @@ -28,7 +27,6 @@ public function fromPayload(Payload $payload, $type); /** * @param mixed $value - * @return Payload * * @throws DataConverterException */ diff --git a/src/DataConverter/EncodedCollection.php b/src/DataConverter/EncodedCollection.php index b245ffd4f..75ef277dd 100644 --- a/src/DataConverter/EncodedCollection.php +++ b/src/DataConverter/EncodedCollection.php @@ -24,9 +24,6 @@ */ class EncodedCollection implements \IteratorAggregate, \Countable { - /** - * @var DataConverterInterface|null - */ private ?DataConverterInterface $converter = null; /** diff --git a/src/DataConverter/EncodedValues.php b/src/DataConverter/EncodedValues.php index f11662189..5122431a3 100644 --- a/src/DataConverter/EncodedValues.php +++ b/src/DataConverter/EncodedValues.php @@ -38,9 +38,6 @@ class EncodedValues implements ValuesInterface */ protected ?array $values = null; - /** - * @var DataConverterInterface|null - */ private ?DataConverterInterface $converter = null; /** @@ -48,9 +45,6 @@ class EncodedValues implements ValuesInterface */ private function __construct() {} - /** - * @return static - */ public static function empty(): static { $ev = new static(); @@ -59,25 +53,11 @@ public static function empty(): static return $ev; } - /** - * @param Payloads $payloads - * @param DataConverterInterface $dataConverter - * - * @return EncodedValues - */ public static function fromPayloads(Payloads $payloads, DataConverterInterface $dataConverter): EncodedValues { return static::fromPayloadCollection($payloads->getPayloads(), $dataConverter); } - /** - * @param DataConverterInterface $converter - * @param ValuesInterface $values - * @param int $offset - * @param int|null $length - * - * @return ValuesInterface - */ public static function sliceValues( DataConverterInterface $converter, ValuesInterface $values, @@ -94,10 +74,8 @@ public static function sliceValues( /** * Decode promise response upon returning it to the domain layer. * - * @param PromiseInterface $promise * @param string|\ReflectionClass|\ReflectionType|Type|null $type * - * @return PromiseInterface */ public static function decodePromise(PromiseInterface $promise, $type = null): PromiseInterface { @@ -112,12 +90,6 @@ static function (mixed $value) use ($type) { ); } - /** - * @param array $values - * @param DataConverterInterface|null $dataConverter - * - * @return static - */ public static function fromValues(array $values, DataConverterInterface $dataConverter = null): static { $ev = new static(); @@ -129,9 +101,7 @@ public static function fromValues(array $values, DataConverterInterface $dataCon /** * @param TPayloadsCollection $payloads - * @param ?DataConverterInterface $dataConverter * - * @return static */ public static function fromPayloadCollection( \Traversable $payloads, @@ -189,9 +159,6 @@ public function getValues(): array return $result; } - /** - * @param DataConverterInterface $converter - */ public function setDataConverter(DataConverterInterface $converter): void { $this->converter = $converter; diff --git a/src/DataConverter/JsonConverter.php b/src/DataConverter/JsonConverter.php index dbff0ca30..d9fe7fb78 100644 --- a/src/DataConverter/JsonConverter.php +++ b/src/DataConverter/JsonConverter.php @@ -34,22 +34,13 @@ class JsonConverter extends Converter */ public const JSON_FLAGS = \JSON_THROW_ON_ERROR | \JSON_PRESERVE_ZERO_FRACTION; - /** - * @var MarshallerInterface - */ private MarshallerInterface $marshaller; - /** - * @param MarshallerInterface|null $marshaller - */ public function __construct(MarshallerInterface $marshaller = null) { $this->marshaller = $marshaller ?? self::createDefaultMarshaller(); } - /** - * @return string - */ public function getEncodingType(): string { return EncodingKeys::METADATA_ENCODING_JSON; @@ -57,7 +48,6 @@ public function getEncodingType(): string /** * @param mixed $value - * @return Payload|null * @throws DataConverterException */ public function toPayload($value): ?Payload @@ -78,8 +68,6 @@ public function toPayload($value): ?Payload } /** - * @param Payload $payload - * @param Type $type * @return mixed|void * @throws DataConverterException */ @@ -178,17 +166,11 @@ public function fromPayload(Payload $payload, Type $type) throw $this->errorInvalidTypeName($type); } - /** - * @return MarshallerInterface - */ private static function createDefaultMarshaller(): MarshallerInterface { return new Marshaller(new AttributeMapperFactory(self::createDefaultReader())); } - /** - * @return ReaderInterface - */ private static function createDefaultReader(): ReaderInterface { if (\interface_exists(Reader::class)) { @@ -200,7 +182,6 @@ private static function createDefaultReader(): ReaderInterface /** * @param object|array $context - * @return array */ private function toHashMap($context): array { @@ -217,10 +198,6 @@ private function toHashMap($context): array return $context; } - /** - * @param Type $type - * @return DataConverterException - */ private function errorInvalidTypeName(Type $type): DataConverterException { $message = \vsprintf('Type named "%s" is not a valid type name', [ @@ -231,9 +208,7 @@ private function errorInvalidTypeName(Type $type): DataConverterException } /** - * @param Type $type * @param mixed $data - * @return DataConverterException */ private function errorInvalidType(Type $type, $data): DataConverterException { @@ -248,7 +223,6 @@ private function errorInvalidType(Type $type, $data): DataConverterException /** * @template T of object * - * @param object|array $data * @param \ReflectionClass $reflection * * @return T diff --git a/src/DataConverter/NullConverter.php b/src/DataConverter/NullConverter.php index de2afb435..588a5fe89 100644 --- a/src/DataConverter/NullConverter.php +++ b/src/DataConverter/NullConverter.php @@ -16,9 +16,6 @@ class NullConverter extends Converter { - /** - * @return string - */ public function getEncodingType(): string { return EncodingKeys::METADATA_ENCODING_NULL; @@ -26,7 +23,6 @@ public function getEncodingType(): string /** * @param mixed $value - * @return Payload|null */ public function toPayload($value): ?Payload { @@ -38,8 +34,6 @@ public function toPayload($value): ?Payload } /** - * @param Payload $payload - * @param Type $type * @return null */ public function fromPayload(Payload $payload, Type $type) diff --git a/src/DataConverter/PayloadConverterInterface.php b/src/DataConverter/PayloadConverterInterface.php index e28629737..464683f52 100644 --- a/src/DataConverter/PayloadConverterInterface.php +++ b/src/DataConverter/PayloadConverterInterface.php @@ -19,7 +19,6 @@ interface PayloadConverterInterface /** * Returns associated encoding type. * - * @return string */ public function getEncodingType(): string; @@ -27,15 +26,12 @@ public function getEncodingType(): string; * Implements conversion of a single value to Payload. Must return null if value can't be encoded. * * @param mixed $value - * @return Payload|null * * @throws DataConverterException */ public function toPayload($value): ?Payload; /** - * @param Payload $payload - * @param Type $type * @return mixed * * @throws DataConverterException diff --git a/src/DataConverter/ProtoConverter.php b/src/DataConverter/ProtoConverter.php index 27720d73e..a29276505 100644 --- a/src/DataConverter/ProtoConverter.php +++ b/src/DataConverter/ProtoConverter.php @@ -17,9 +17,6 @@ class ProtoConverter extends Converter { - /** - * @return string - */ public function getEncodingType(): string { return EncodingKeys::METADATA_ENCODING_PROTOBUF; @@ -27,7 +24,6 @@ public function getEncodingType(): string /** * @param mixed $value - * @return Payload|null */ public function toPayload($value): ?Payload { @@ -48,8 +44,6 @@ public function toPayload($value): ?Payload } /** - * @param Payload $payload - * @param Type $type * @return Message * @throws DataConverterException */ diff --git a/src/DataConverter/ProtoJsonConverter.php b/src/DataConverter/ProtoJsonConverter.php index 4474a0f8d..34daf6599 100644 --- a/src/DataConverter/ProtoJsonConverter.php +++ b/src/DataConverter/ProtoJsonConverter.php @@ -17,9 +17,6 @@ class ProtoJsonConverter extends Converter { - /** - * @return string - */ public function getEncodingType(): string { return EncodingKeys::METADATA_ENCODING_PROTOBUF_JSON; @@ -27,7 +24,6 @@ public function getEncodingType(): string /** * @param mixed $value - * @return Payload|null */ public function toPayload($value): ?Payload { @@ -48,8 +44,6 @@ public function toPayload($value): ?Payload } /** - * @param Payload $payload - * @param Type $type * @return Message * @throws DataConverterException */ diff --git a/src/DataConverter/Type.php b/src/DataConverter/Type.php index fa20e3e0e..540edecee 100644 --- a/src/DataConverter/Type.php +++ b/src/DataConverter/Type.php @@ -30,15 +30,10 @@ final class Type public const TYPE_TRUE = 'true'; public const TYPE_FALSE = 'false'; - /** - * @var bool - */ private readonly bool $allowsNull; /** * @param TypeEnum|string $name - * @param bool|null $allowsNull - * @param bool $isArrayOf */ public function __construct( private readonly string $name = Type::TYPE_ANY, @@ -55,20 +50,11 @@ public static function arrayOf(string $class): self return new self($class, null, true); } - /** - * @param \ReflectionClass $class - * @param bool $nullable - * @return Type - */ public static function fromReflectionClass(\ReflectionClass $class, bool $nullable = false): self { return new self($class->getName(), $nullable); } - /** - * @param \ReflectionType $type - * @return Type - */ public static function fromReflectionType(\ReflectionType $type): self { if ($type instanceof \ReflectionNamedType) { @@ -90,7 +76,6 @@ public static function fromReflectionType(\ReflectionType $type): self /** * @param string|\ReflectionClass|\ReflectionType|Type|ReturnType $type - * @return Type */ public static function create($type): Type { @@ -115,33 +100,21 @@ public static function create($type): Type } } - /** - * @return string - */ public function getName(): string { return $this->name; } - /** - * @return bool - */ public function allowsNull(): bool { return $this->allowsNull; } - /** - * @return bool - */ public function isUntyped(): bool { return $this->name === self::TYPE_ANY; } - /** - * @return bool - */ public function isClass(): bool { return \class_exists($this->name); diff --git a/src/DataConverter/ValuesInterface.php b/src/DataConverter/ValuesInterface.php index e08f9e1cc..27ddea517 100644 --- a/src/DataConverter/ValuesInterface.php +++ b/src/DataConverter/ValuesInterface.php @@ -23,13 +23,9 @@ interface ValuesInterface extends \Countable /** * Checks if any value present. * - * @return bool */ public function isEmpty(): bool; - /** - * @param DataConverterInterface $converter - */ public function setDataConverter(DataConverterInterface $converter); /** @@ -38,7 +34,6 @@ public function setDataConverter(DataConverterInterface $converter); * Returns {@see null} if there are no values and $type has null value * like {@see null}, {@see Type::TYPE_VOID} or {@see Type::TYPE_NULL}. * - * @param int $index * @param string|\ReflectionClass|\ReflectionType|Type|null $type * @return mixed */ @@ -47,7 +42,6 @@ public function getValue(int $index, $type); /** * Returns associated payloads. * - * @return Payloads */ public function toPayloads(): Payloads; } diff --git a/src/Exception/Client/ActivityCompletionException.php b/src/Exception/Client/ActivityCompletionException.php index 83858559e..a474047df 100644 --- a/src/Exception/Client/ActivityCompletionException.php +++ b/src/Exception/Client/ActivityCompletionException.php @@ -22,7 +22,6 @@ class ActivityCompletionException extends TemporalException private ?string $activityId = null; /** - * @param \Throwable $e * @return static */ public static function fromPrevious(\Throwable $e): self @@ -35,8 +34,6 @@ public static function fromPrevious(\Throwable $e): self } /** - * @param string $activityId - * @param \Throwable $e * @return static */ public static function fromPreviousWithActivityId(string $activityId, \Throwable $e): self @@ -48,8 +45,6 @@ public static function fromPreviousWithActivityId(string $activityId, \Throwable } /** - * @param ActivityInfo $info - * @param \Throwable|null $e * @return static */ public static function fromActivityInfo(ActivityInfo $info, \Throwable $e = null): self @@ -75,33 +70,21 @@ public static function fromActivityInfo(ActivityInfo $info, \Throwable $e = null return $e; } - /** - * @return string|null - */ public function getWorkflowId(): ?string { return $this->workflowId; } - /** - * @return string|null - */ public function getRunId(): ?string { return $this->runId; } - /** - * @return string|null - */ public function getActivityType(): ?string { return $this->activityType; } - /** - * @return string|null - */ public function getActivityId(): ?string { return $this->activityId; diff --git a/src/Exception/Client/ServiceClientException.php b/src/Exception/Client/ServiceClientException.php index cca9679ab..9bad38e4a 100644 --- a/src/Exception/Client/ServiceClientException.php +++ b/src/Exception/Client/ServiceClientException.php @@ -18,14 +18,9 @@ class ServiceClientException extends \RuntimeException { - /** - * @var Status - */ private Status $status; /** - * @param \stdClass $status - * @param \Throwable|null $previous * @throws \Exception */ public function __construct(\stdClass $status, \Throwable $previous = null) @@ -39,17 +34,11 @@ public function __construct(\stdClass $status, \Throwable $previous = null) parent::__construct($status->details . " (code: $status->code)", $status->code, $previous); } - /** - * @return Status - */ public function getStatus(): Status { return $this->status; } - /** - * @return RepeatedField - */ public function getDetails(): RepeatedField { return $this->status->getDetails(); @@ -58,8 +47,6 @@ public function getDetails(): RepeatedField /** * @link https://dev.to/khepin/grpc-advanced-error-handling-from-go-to-php-1omc * - * @param string $class - * @return object|null * @throws \Exception */ public function getFailure(string $class): ?object diff --git a/src/Exception/Client/WorkflowException.php b/src/Exception/Client/WorkflowException.php index dfb72d8b9..e11e63bcb 100644 --- a/src/Exception/Client/WorkflowException.php +++ b/src/Exception/Client/WorkflowException.php @@ -16,22 +16,10 @@ class WorkflowException extends TemporalException { - /** - * @var WorkflowExecution - */ private WorkflowExecution $execution; - /** - * @var string|null - */ private ?string $type; - /** - * @param string|null $message - * @param WorkflowExecution $execution - * @param string|null $workflowType - * @param \Throwable|null $previous - */ public function __construct( ?string $message, WorkflowExecution $execution, @@ -53,12 +41,6 @@ public function __construct( $this->type = $workflowType; } - /** - * @param WorkflowExecution $execution - * @param string|null $workflowType - * @param \Throwable|null $previous - * @return WorkflowException - */ public static function withoutMessage( WorkflowExecution $execution, string $workflowType = null, @@ -67,17 +49,11 @@ public static function withoutMessage( return new static(null, $execution, $workflowType, $previous); } - /** - * @return WorkflowExecution - */ public function getExecution(): WorkflowExecution { return $this->execution; } - /** - * @return string|null - */ public function getWorkflowType(): ?string { return $this->type; diff --git a/src/Exception/Client/WorkflowExecutionAlreadyStartedException.php b/src/Exception/Client/WorkflowExecutionAlreadyStartedException.php index f6d6b976b..c9ecfc32f 100644 --- a/src/Exception/Client/WorkflowExecutionAlreadyStartedException.php +++ b/src/Exception/Client/WorkflowExecutionAlreadyStartedException.php @@ -15,11 +15,6 @@ class WorkflowExecutionAlreadyStartedException extends WorkflowException { - /** - * @param WorkflowExecution $execution - * @param string|null $type - * @param \Throwable|null $previous - */ public function __construct( WorkflowExecution $execution, string $type = null, diff --git a/src/Exception/Client/WorkflowFailedException.php b/src/Exception/Client/WorkflowFailedException.php index 99595b1e5..5e698050c 100644 --- a/src/Exception/Client/WorkflowFailedException.php +++ b/src/Exception/Client/WorkflowFailedException.php @@ -18,11 +18,7 @@ class WorkflowFailedException extends WorkflowException private int $lastWorkflowTaskCompletedEventId; /** - * @param WorkflowExecution $execution * @param non-empty-string|null $type - * @param int $lastWorkflowTaskCompletedEventId - * @param int $retryState - * @param \Throwable|null $previous */ public function __construct( WorkflowExecution $execution, @@ -46,9 +42,6 @@ public function __construct( $this->lastWorkflowTaskCompletedEventId = $lastWorkflowTaskCompletedEventId; } - /** - * @return int - */ public function getWorkflowTaskCompletedEventId(): int { return $this->lastWorkflowTaskCompletedEventId; diff --git a/src/Exception/Client/WorkflowQueryRejectedException.php b/src/Exception/Client/WorkflowQueryRejectedException.php index 0adc6474e..8fade37aa 100644 --- a/src/Exception/Client/WorkflowQueryRejectedException.php +++ b/src/Exception/Client/WorkflowQueryRejectedException.php @@ -15,20 +15,10 @@ class WorkflowQueryRejectedException extends WorkflowQueryException { - /** - * @var int - */ private int $queryRejectCondition; private int $workflowExecutionStatus; - /** - * @param WorkflowExecution $execution - * @param string $type - * @param int $queryRejectCondition - * @param int $workflowExecutionStatus - * @param \Throwable|null $previous - */ public function __construct( WorkflowExecution $execution, string $type, @@ -41,17 +31,11 @@ public function __construct( $this->workflowExecutionStatus = $workflowExecutionStatus; } - /** - * @return int - */ public function getQueryRejectCondition(): int { return $this->queryRejectCondition; } - /** - * @return int - */ public function getWorkflowExecutionStatus(): int { return $this->workflowExecutionStatus; diff --git a/src/Exception/CompensationException.php b/src/Exception/CompensationException.php index 8f5c7bfe3..2793aef77 100644 --- a/src/Exception/CompensationException.php +++ b/src/Exception/CompensationException.php @@ -18,9 +18,6 @@ class CompensationException extends TemporalException */ private array $suppressed = []; - /** - * @param \Throwable $e - */ public function addSuppressed(\Throwable $e): void { $this->suppressed[] = $e; diff --git a/src/Exception/ExceptionInterceptor.php b/src/Exception/ExceptionInterceptor.php index 771730c64..b55c857f6 100644 --- a/src/Exception/ExceptionInterceptor.php +++ b/src/Exception/ExceptionInterceptor.php @@ -17,14 +17,8 @@ */ class ExceptionInterceptor implements ExceptionInterceptorInterface { - /** - * @var array - */ private array $retryableErrors; - /** - * @param array $retryableErrors - */ public function __construct(array $retryableErrors) { $this->retryableErrors = $retryableErrors; @@ -38,10 +32,6 @@ public static function createDefault(): self return new self([\Error::class]); } - /** - * @param \Throwable $e - * @return bool - */ public function isRetryable(\Throwable $e): bool { foreach ($this->retryableErrors as $retryableError) { diff --git a/src/Exception/ExceptionInterceptorInterface.php b/src/Exception/ExceptionInterceptorInterface.php index 2b7ffd9db..0fefdce5c 100644 --- a/src/Exception/ExceptionInterceptorInterface.php +++ b/src/Exception/ExceptionInterceptorInterface.php @@ -17,9 +17,5 @@ */ interface ExceptionInterceptorInterface { - /** - * @param \Throwable $e - * @return bool - */ public function isRetryable(\Throwable $e): bool; } diff --git a/src/Exception/Failure/ActivityFailure.php b/src/Exception/Failure/ActivityFailure.php index 9037c8cb4..8574d66e9 100644 --- a/src/Exception/Failure/ActivityFailure.php +++ b/src/Exception/Failure/ActivityFailure.php @@ -20,15 +20,6 @@ class ActivityFailure extends TemporalFailure private string $identity; private int $retryState; - /** - * @param int $scheduledEventId - * @param int $startedEventId - * @param string $activityType - * @param string $activityId - * @param int $retryState - * @param string $identity - * @param \Throwable|null $previous - */ public function __construct( int $scheduledEventId, int $startedEventId, @@ -61,49 +52,31 @@ public function __construct( $this->retryState = $retryState; } - /** - * @return int - */ public function getScheduledEventId(): int { return $this->scheduledEventId; } - /** - * @return int - */ public function getStartedEventId(): int { return $this->startedEventId; } - /** - * @return string - */ public function getActivityType(): string { return $this->activityType; } - /** - * @return string - */ public function getActivityId(): string { return $this->activityId; } - /** - * @return string - */ public function getIdentity(): string { return $this->identity; } - /** - * @return int - */ public function getRetryState(): int { return $this->retryState; diff --git a/src/Exception/Failure/ApplicationFailure.php b/src/Exception/Failure/ApplicationFailure.php index 7e82c9d22..677413709 100644 --- a/src/Exception/Failure/ApplicationFailure.php +++ b/src/Exception/Failure/ApplicationFailure.php @@ -47,11 +47,7 @@ class ApplicationFailure extends TemporalFailure private bool $nonRetryable; /** - * @param string $message - * @param string $type - * @param bool $nonRetryable * @param ValuesInterface|null $details Optional details about the failure. - * @param \Throwable|null $previous * @param \DateInterval|null $nextRetryDelay Delay before the next retry attempt. */ public function __construct( @@ -73,17 +69,11 @@ public function __construct( $this->details = $details ?? EncodedValues::empty(); } - /** - * @return string - */ public function getType(): string { return $this->type; } - /** - * @return ValuesInterface - */ public function getDetails(): ValuesInterface { return $this->details; @@ -94,25 +84,16 @@ public function getNextRetryDelay(): ?\DateInterval return $this->nextRetryDelay; } - /** - * @return bool - */ public function isNonRetryable(): bool { return $this->nonRetryable; } - /** - * @param bool $nonRetryable - */ public function setNonRetryable(bool $nonRetryable): void { $this->nonRetryable = $nonRetryable; } - /** - * @param DataConverterInterface $converter - */ public function setDataConverter(DataConverterInterface $converter): void { $this->details->setDataConverter($converter); diff --git a/src/Exception/Failure/CanceledFailure.php b/src/Exception/Failure/CanceledFailure.php index 640f85213..c18a2563e 100644 --- a/src/Exception/Failure/CanceledFailure.php +++ b/src/Exception/Failure/CanceledFailure.php @@ -19,28 +19,17 @@ class CanceledFailure extends TemporalFailure { private ValuesInterface $details; - /** - * @param string $message - * @param ValuesInterface|null $details - * @param \Throwable|null $previous - */ public function __construct(string $message, ValuesInterface $details = null, \Throwable $previous = null) { parent::__construct($message, '', $previous); $this->details = $details ?? EncodedValues::empty(); } - /** - * @return ValuesInterface - */ public function getDetails(): ValuesInterface { return $this->details; } - /** - * @param DataConverterInterface $converter - */ public function setDataConverter(DataConverterInterface $converter): void { $this->details->setDataConverter($converter); diff --git a/src/Exception/Failure/ChildWorkflowFailure.php b/src/Exception/Failure/ChildWorkflowFailure.php index 70e1630fe..eccb17e93 100644 --- a/src/Exception/Failure/ChildWorkflowFailure.php +++ b/src/Exception/Failure/ChildWorkflowFailure.php @@ -22,15 +22,6 @@ class ChildWorkflowFailure extends TemporalFailure private WorkflowExecution $execution; private string $workflowType; - /** - * @param int $initiatedEventId - * @param int $startedEventId - * @param string $workflowType - * @param WorkflowExecution $execution - * @param string $namespace - * @param int $retryState - * @param \Throwable|null $previous - */ public function __construct( int $initiatedEventId, int $startedEventId, @@ -64,49 +55,31 @@ public function __construct( $this->retryState = $retryState; } - /** - * @return int - */ public function getInitiatedEventId(): int { return $this->initiatedEventId; } - /** - * @return int - */ public function getStartedEventId(): int { return $this->startedEventId; } - /** - * @return string - */ public function getNamespace(): string { return $this->namespace; } - /** - * @return int - */ public function getRetryState(): int { return $this->retryState; } - /** - * @return WorkflowExecution - */ public function getExecution(): WorkflowExecution { return $this->execution; } - /** - * @return string - */ public function getWorkflowType(): string { return $this->workflowType; diff --git a/src/Exception/Failure/FailureConverter.php b/src/Exception/Failure/FailureConverter.php index faf941b5c..1d1d4262e 100644 --- a/src/Exception/Failure/FailureConverter.php +++ b/src/Exception/Failure/FailureConverter.php @@ -30,16 +30,8 @@ final class FailureConverter { - /** - * @var LoggerInterface|null - */ private static ?LoggerInterface $logger; - /** - * @param Failure $failure - * @param DataConverterInterface $converter - * @return TemporalFailure - */ public static function mapFailureToException(Failure $failure, DataConverterInterface $converter): TemporalFailure { $e = self::createFailureException($failure, $converter); @@ -52,11 +44,6 @@ public static function mapFailureToException(Failure $failure, DataConverterInte return $e; } - /** - * @param \Throwable $e - * @param DataConverterInterface $converter - * @return Failure - */ public static function mapExceptionToFailure(\Throwable $e, DataConverterInterface $converter): Failure { $failure = new Failure(); @@ -173,19 +160,11 @@ public static function mapExceptionToFailure(\Throwable $e, DataConverterInterfa return $failure; } - /** - * @param LoggerInterface $logger - */ public function setLogger(LoggerInterface $logger): void { self::$logger = $logger; } - /** - * @param Failure $failure - * @param DataConverterInterface $converter - * @return TemporalFailure - */ private static function createFailureException(Failure $failure, DataConverterInterface $converter): TemporalFailure { $previous = null; diff --git a/src/Exception/Failure/ServerFailure.php b/src/Exception/Failure/ServerFailure.php index c7a297177..2fadd0ab4 100644 --- a/src/Exception/Failure/ServerFailure.php +++ b/src/Exception/Failure/ServerFailure.php @@ -15,11 +15,6 @@ class ServerFailure extends TemporalFailure { private bool $nonRetryable; - /** - * @param string $message - * @param bool $nonRetryable - * @param \Throwable|null $previous - */ public function __construct(string $message, bool $nonRetryable, \Throwable $previous = null) { parent::__construct( @@ -30,9 +25,6 @@ public function __construct(string $message, bool $nonRetryable, \Throwable $pre $this->nonRetryable = $nonRetryable; } - /** - * @return bool - */ public function isNonRetryable(): bool { return $this->nonRetryable; diff --git a/src/Exception/Failure/TemporalFailure.php b/src/Exception/Failure/TemporalFailure.php index 97d20bd8f..677edb0a6 100644 --- a/src/Exception/Failure/TemporalFailure.php +++ b/src/Exception/Failure/TemporalFailure.php @@ -35,11 +35,6 @@ class TemporalFailure extends TemporalException implements \Stringable private string $originalMessage; private ?string $originalStackTrace = null; - /** - * @param string $message - * @param string|null $originalMessage - * @param \Throwable|null $previous - */ public function __construct(string $message, string $originalMessage = null, \Throwable $previous = null) { parent::__construct($message, 0, $previous); @@ -47,33 +42,21 @@ public function __construct(string $message, string $originalMessage = null, \Th $this->originalMessage = $originalMessage ?? ''; } - /** - * @return Failure|null - */ public function getFailure(): ?Failure { return $this->failure; } - /** - * @param Failure|null $failure - */ public function setFailure(?Failure $failure): void { $this->failure = $failure; } - /** - * @return string - */ public function getOriginalMessage(): string { return $this->originalMessage; } - /** - * @param string $stackTrace - */ public function setOriginalStackTrace(string $stackTrace): void { $this->originalStackTrace = $stackTrace; @@ -89,25 +72,16 @@ public function hasOriginalStackTrace(): bool return $this->originalStackTrace !== null; } - /** - * @return string|null - */ public function getOriginalStackTrace(): ?string { return $this->originalStackTrace; } - /** - * @param DataConverterInterface $converter - */ public function setDataConverter(DataConverterInterface $converter): void { // typically handled by children } - /** - * @return string - */ public function __toString(): string { if ($this->hasOriginalStackTrace()) { @@ -120,8 +94,6 @@ public function __toString(): string /** * Explain known types of key=>value pairs. * - * @param array $values - * @return string */ protected static function buildMessage(array $values): string { diff --git a/src/Exception/Failure/TerminatedFailure.php b/src/Exception/Failure/TerminatedFailure.php index badfb7e82..4d5e101ec 100644 --- a/src/Exception/Failure/TerminatedFailure.php +++ b/src/Exception/Failure/TerminatedFailure.php @@ -13,10 +13,6 @@ class TerminatedFailure extends TemporalFailure { - /** - * @param string $message - * @param \Throwable|null $previous - */ public function __construct(string $message, \Throwable $previous = null) { parent::__construct($message, $message, $previous); diff --git a/src/Exception/Failure/TimeoutFailure.php b/src/Exception/Failure/TimeoutFailure.php index a0080dde5..c2f53e8ca 100644 --- a/src/Exception/Failure/TimeoutFailure.php +++ b/src/Exception/Failure/TimeoutFailure.php @@ -19,12 +19,6 @@ class TimeoutFailure extends TemporalFailure private ValuesInterface $lastHeartbeatDetails; private int $timeoutType; - /** - * @param string $message - * @param ValuesInterface $lastHeartbeatDetails - * @param int $timeoutWorkflowType - * @param \Throwable|null $previous - */ public function __construct( string $message, ValuesInterface $lastHeartbeatDetails, @@ -41,25 +35,16 @@ public function __construct( $this->timeoutType = $timeoutWorkflowType; } - /** - * @return int - */ public function getTimeoutType(): int { return $this->timeoutType; } - /** - * @return ValuesInterface - */ public function getLastHeartbeatDetails(): ValuesInterface { return $this->lastHeartbeatDetails; } - /** - * @param DataConverterInterface $converter - */ public function setDataConverter(DataConverterInterface $converter): void { $this->lastHeartbeatDetails->setDataConverter($converter); diff --git a/src/Exception/TemporalException.php b/src/Exception/TemporalException.php index 1b58cf19a..39ced09b8 100644 --- a/src/Exception/TemporalException.php +++ b/src/Exception/TemporalException.php @@ -17,7 +17,6 @@ class TemporalException extends \RuntimeException * Build key-value list to explain exception. Skips empty values. * * @param array $values - * @return string */ protected static function buildMessage(array $values): string { diff --git a/src/Exception/WorkflowExecutionFailedException.php b/src/Exception/WorkflowExecutionFailedException.php index e9f9db736..ad2865e70 100644 --- a/src/Exception/WorkflowExecutionFailedException.php +++ b/src/Exception/WorkflowExecutionFailedException.php @@ -15,26 +15,14 @@ class WorkflowExecutionFailedException extends TemporalException { - /** - * @var Failure - */ private Failure $failure; - /** - * @var int - */ private int $lastWorkflowTaskCompletedEventId; - /** - * @var int - */ private int $retryState; /** * WorkflowExecutionFailedException constructor. - * @param Failure $failure - * @param int $lastWorkflowTaskCompletedEventId - * @param int $retryState */ public function __construct(Failure $failure, int $lastWorkflowTaskCompletedEventId, int $retryState) { @@ -44,25 +32,16 @@ public function __construct(Failure $failure, int $lastWorkflowTaskCompletedEven $this->retryState = $retryState; } - /** - * @return Failure - */ public function getFailure(): Failure { return $this->failure; } - /** - * @return int - */ public function getWorkflowTaskCompletedEventId(): int { return $this->lastWorkflowTaskCompletedEventId; } - /** - * @return int - */ public function getRetryState(): int { return $this->retryState; diff --git a/src/Interceptor/ActivityInboundInterceptor.php b/src/Interceptor/ActivityInboundInterceptor.php index 9ac3738cb..16fd81227 100644 --- a/src/Interceptor/ActivityInboundInterceptor.php +++ b/src/Interceptor/ActivityInboundInterceptor.php @@ -26,10 +26,8 @@ interface ActivityInboundInterceptor extends Interceptor /** * Intercepts a call to the main activity entry method. * - * @param ActivityInput $input * @param callable(ActivityInput): mixed $next * - * @return mixed */ public function handleActivityInbound(ActivityInput $input, callable $next): mixed; } diff --git a/src/Interceptor/GrpcClientInterceptor.php b/src/Interceptor/GrpcClientInterceptor.php index f7a98f060..2d36e14bf 100644 --- a/src/Interceptor/GrpcClientInterceptor.php +++ b/src/Interceptor/GrpcClientInterceptor.php @@ -23,11 +23,8 @@ interface GrpcClientInterceptor extends Interceptor * Intercepts a gRPC call. * * @param non-empty-string $method - * @param object $arg - * @param ContextInterface $ctx * @param callable(non-empty-string, object, ContextInterface): object $next * - * @return object */ public function interceptCall(string $method, object $arg, ContextInterface $ctx, callable $next): object; } diff --git a/src/Interceptor/SimplePipelineProvider.php b/src/Interceptor/SimplePipelineProvider.php index 216316941..56360f6a1 100644 --- a/src/Interceptor/SimplePipelineProvider.php +++ b/src/Interceptor/SimplePipelineProvider.php @@ -25,9 +25,6 @@ public function __construct( private iterable $interceptors = [], ) {} - /** - * @inheritDoc - */ public function getPipeline(string $interceptorClass): Pipeline { return $this->cache[$interceptorClass] ??= Pipeline::prepare( diff --git a/src/Interceptor/Trait/WorkflowOutboundRequestInterceptorTrait.php b/src/Interceptor/Trait/WorkflowOutboundRequestInterceptorTrait.php index 33125b380..992ff7a7c 100644 --- a/src/Interceptor/Trait/WorkflowOutboundRequestInterceptorTrait.php +++ b/src/Interceptor/Trait/WorkflowOutboundRequestInterceptorTrait.php @@ -60,10 +60,8 @@ final public function handleOutboundRequest(RequestInterface $request, callable } /** - * @param ExecuteActivity $request * @param callable(ExecuteActivity): PromiseInterface $next * - * @return PromiseInterface */ private function executeActivityRequest(ExecuteActivity $request, callable $next): PromiseInterface { @@ -71,10 +69,8 @@ private function executeActivityRequest(ExecuteActivity $request, callable $next } /** - * @param ExecuteLocalActivity $request * @param callable(ExecuteLocalActivity): PromiseInterface $next * - * @return PromiseInterface */ private function executeLocalActivityRequest(ExecuteLocalActivity $request, callable $next): PromiseInterface { @@ -82,10 +78,8 @@ private function executeLocalActivityRequest(ExecuteLocalActivity $request, call } /** - * @param ExecuteChildWorkflow $request * @param callable(ExecuteChildWorkflow): PromiseInterface $next * - * @return PromiseInterface */ private function executeChildWorkflowRequest(ExecuteChildWorkflow $request, callable $next): PromiseInterface { @@ -93,10 +87,8 @@ private function executeChildWorkflowRequest(ExecuteChildWorkflow $request, call } /** - * @param NewTimer $request * @param callable(NewTimer): PromiseInterface $next * - * @return PromiseInterface */ private function newTimerRequest(NewTimer $request, callable $next): PromiseInterface { @@ -104,10 +96,8 @@ private function newTimerRequest(NewTimer $request, callable $next): PromiseInte } /** - * @param ContinueAsNew $request * @param callable(ContinueAsNew): PromiseInterface $next * - * @return PromiseInterface */ private function continueAsNewRequest(ContinueAsNew $request, callable $next): PromiseInterface { @@ -115,10 +105,8 @@ private function continueAsNewRequest(ContinueAsNew $request, callable $next): P } /** - * @param SignalExternalWorkflow $request * @param callable(SignalExternalWorkflow): PromiseInterface $next * - * @return PromiseInterface */ private function signalExternalWorkflowRequest(SignalExternalWorkflow $request, callable $next): PromiseInterface { @@ -126,10 +114,8 @@ private function signalExternalWorkflowRequest(SignalExternalWorkflow $request, } /** - * @param CompleteWorkflow $request * @param callable(CompleteWorkflow): PromiseInterface $next * - * @return PromiseInterface */ private function completeWorkflowRequest(CompleteWorkflow $request, callable $next): PromiseInterface { @@ -137,10 +123,8 @@ private function completeWorkflowRequest(CompleteWorkflow $request, callable $ne } /** - * @param CancelExternalWorkflow $request * @param callable(CancelExternalWorkflow): PromiseInterface $next * - * @return PromiseInterface */ private function cancelExternalWorkflowRequest(CancelExternalWorkflow $request, callable $next): PromiseInterface { @@ -148,10 +132,8 @@ private function cancelExternalWorkflowRequest(CancelExternalWorkflow $request, } /** - * @param GetVersion $request * @param callable(GetVersion): PromiseInterface $next * - * @return PromiseInterface */ private function getVersionRequest(GetVersion $request, callable $next): PromiseInterface { @@ -159,10 +141,8 @@ private function getVersionRequest(GetVersion $request, callable $next): Promise } /** - * @param Panic $request * @param callable(Panic): PromiseInterface $next * - * @return PromiseInterface */ private function panicRequest(Panic $request, callable $next): PromiseInterface { @@ -170,10 +150,8 @@ private function panicRequest(Panic $request, callable $next): PromiseInterface } /** - * @param SideEffect $request * @param callable(SideEffect): PromiseInterface $next * - * @return PromiseInterface */ private function sideEffectRequest(SideEffect $request, callable $next): PromiseInterface { @@ -181,10 +159,8 @@ private function sideEffectRequest(SideEffect $request, callable $next): Promise } /** - * @param UpsertSearchAttributes $request * @param callable(UpsertSearchAttributes): PromiseInterface $next * - * @return PromiseInterface */ private function upsertSearchAttributesRequest(UpsertSearchAttributes $request, callable $next): PromiseInterface { @@ -192,10 +168,8 @@ private function upsertSearchAttributesRequest(UpsertSearchAttributes $request, } /** - * @param Cancel $request * @param callable(Cancel): PromiseInterface $next * - * @return PromiseInterface */ private function cancelRequest(Cancel $request, callable $next): PromiseInterface { diff --git a/src/Interceptor/WorkflowClientCallsInterceptor.php b/src/Interceptor/WorkflowClientCallsInterceptor.php index e09059a91..64727e3c2 100644 --- a/src/Interceptor/WorkflowClientCallsInterceptor.php +++ b/src/Interceptor/WorkflowClientCallsInterceptor.php @@ -50,74 +50,56 @@ interface WorkflowClientCallsInterceptor extends Interceptor { /** - * @param StartInput $input * @param callable(StartInput): WorkflowExecution $next * - * @return WorkflowExecution */ public function start(StartInput $input, callable $next): WorkflowExecution; /** - * @param SignalInput $input * @param callable(SignalInput): void $next * - * @return void */ public function signal(SignalInput $input, callable $next): void; /** - * @param UpdateInput $input * @param callable(UpdateInput): StartUpdateOutput $next * - * @return StartUpdateOutput */ public function update(UpdateInput $input, callable $next): StartUpdateOutput; /** - * @param SignalWithStartInput $input * @param callable(SignalWithStartInput): WorkflowExecution $next * - * @return WorkflowExecution */ public function signalWithStart(SignalWithStartInput $input, callable $next): WorkflowExecution; /** - * @param GetResultInput $input * @param callable(GetResultInput): ?ValuesInterface $next * - * @return ValuesInterface|null */ public function getResult(GetResultInput $input, callable $next): ?ValuesInterface; /** - * @param QueryInput $input * @param callable(QueryInput): ?ValuesInterface $next * - * @return ValuesInterface|null */ public function query(QueryInput $input, callable $next): ?ValuesInterface; /** - * @param CancelInput $input * @param callable(CancelInput): void $next * - * @return void */ public function cancel(CancelInput $input, callable $next): void; /** - * @param TerminateInput $input * @param callable(TerminateInput): void $next * - * @return void */ public function terminate(TerminateInput $input, callable $next): void; /** - * @param DescribeInput $input * @param callable(DescribeInput): void $next * - * @return WorkflowExecutionDescription */ public function describe(DescribeInput $input, callable $next): WorkflowExecutionDescription; } diff --git a/src/Interceptor/WorkflowInboundCallsInterceptor.php b/src/Interceptor/WorkflowInboundCallsInterceptor.php index 27b1bf401..f528eca76 100644 --- a/src/Interceptor/WorkflowInboundCallsInterceptor.php +++ b/src/Interceptor/WorkflowInboundCallsInterceptor.php @@ -41,31 +41,26 @@ interface WorkflowInboundCallsInterceptor extends Interceptor { /** - * @param WorkflowInput $input * @param callable(WorkflowInput): void $next */ public function execute(WorkflowInput $input, callable $next): void; /** - * @param SignalInput $input * @param callable(SignalInput): void $next */ public function handleSignal(SignalInput $input, callable $next): void; /** - * @param QueryInput $input * @param callable(QueryInput): mixed $next */ public function handleQuery(QueryInput $input, callable $next): mixed; /** - * @param UpdateInput $input * @param callable(UpdateInput): mixed $next */ public function handleUpdate(UpdateInput $input, callable $next): mixed; /** - * @param UpdateInput $input * @param callable(UpdateInput): void $next */ public function validateUpdate(UpdateInput $input, callable $next): void; diff --git a/src/Interceptor/WorkflowOutboundCallsInterceptor.php b/src/Interceptor/WorkflowOutboundCallsInterceptor.php index dd2c3b0c4..7b078a2c2 100644 --- a/src/Interceptor/WorkflowOutboundCallsInterceptor.php +++ b/src/Interceptor/WorkflowOutboundCallsInterceptor.php @@ -54,10 +54,8 @@ interface WorkflowOutboundCallsInterceptor extends Interceptor { /** - * @param ExecuteActivityInput $input * @param callable(ExecuteActivityInput): PromiseInterface $next * - * @return PromiseInterface */ public function executeActivity( ExecuteActivityInput $input, @@ -65,41 +63,32 @@ public function executeActivity( ): PromiseInterface; /** - * @param ExecuteLocalActivityInput $input * @param callable(ExecuteLocalActivityInput): PromiseInterface $next * - * @return PromiseInterface */ public function executeLocalActivity(ExecuteLocalActivityInput $input, callable $next): PromiseInterface; /** - * @param ExecuteChildWorkflowInput $input * @param callable(ExecuteChildWorkflowInput): PromiseInterface $next * - * @return PromiseInterface */ public function executeChildWorkflow(ExecuteChildWorkflowInput $input, callable $next): PromiseInterface; /** - * @param SignalExternalWorkflowInput $input * @param callable(SignalExternalWorkflowInput): PromiseInterface $next * - * @return PromiseInterface */ public function signalExternalWorkflow(SignalExternalWorkflowInput $input, callable $next): PromiseInterface; /** - * @param CancelExternalWorkflowInput $input * @param callable(CancelExternalWorkflowInput): PromiseInterface $next * - * @return PromiseInterface */ public function cancelExternalWorkflow(CancelExternalWorkflowInput $input, callable $next): PromiseInterface; /** * Intercept {@see SideEffectInput::$callable} execution. * - * @param SideEffectInput $input * @param callable(SideEffectInput): mixed $next * * @return mixed The result of the callable execution. @@ -107,66 +96,50 @@ public function cancelExternalWorkflow(CancelExternalWorkflowInput $input, calla public function sideEffect(SideEffectInput $input, callable $next): mixed; /** - * @param TimerInput $input * @param callable(TimerInput): PromiseInterface $next * - * @return PromiseInterface */ public function timer(TimerInput $input, callable $next): PromiseInterface; /** - * @param PanicInput $input * @param callable(PanicInput): PromiseInterface $next * - * @return PromiseInterface */ public function panic(PanicInput $input, callable $next): PromiseInterface; /** - * @param CompleteInput $input * @param callable(CompleteInput): PromiseInterface $next * - * @return PromiseInterface */ public function complete(CompleteInput $input, callable $next): PromiseInterface; /** - * @param ContinueAsNewInput $input * @param callable(ContinueAsNewInput): PromiseInterface $next * - * @return PromiseInterface */ public function continueAsNew(ContinueAsNewInput $input, callable $next): PromiseInterface; /** - * @param GetVersionInput $input * @param callable(GetVersionInput): PromiseInterface $next * - * @return PromiseInterface */ public function getVersion(GetVersionInput $input, callable $next): PromiseInterface; /** - * @param UpsertSearchAttributesInput $input * @param callable(UpsertSearchAttributesInput): PromiseInterface $next * - * @return PromiseInterface */ public function upsertSearchAttributes(UpsertSearchAttributesInput $input, callable $next): PromiseInterface; /** - * @param AwaitInput $input * @param callable(AwaitInput): PromiseInterface $next * - * @return PromiseInterface */ public function await(AwaitInput $input, callable $next): PromiseInterface; /** - * @param AwaitWithTimeoutInput $input * @param callable(AwaitWithTimeoutInput): PromiseInterface $next * - * @return PromiseInterface */ public function awaitWithTimeout(AwaitWithTimeoutInput $input, callable $next): PromiseInterface; } diff --git a/src/Interceptor/WorkflowOutboundRequestInterceptor.php b/src/Interceptor/WorkflowOutboundRequestInterceptor.php index 58fe921bd..9619a1006 100644 --- a/src/Interceptor/WorkflowOutboundRequestInterceptor.php +++ b/src/Interceptor/WorkflowOutboundRequestInterceptor.php @@ -39,10 +39,8 @@ interface WorkflowOutboundRequestInterceptor extends Interceptor { /** - * @param RequestInterface $request * @param callable(RequestInterface): PromiseInterface $next * - * @return PromiseInterface */ public function handleOutboundRequest(RequestInterface $request, callable $next): PromiseInterface; } diff --git a/src/Internal/Activity/ActivityContext.php b/src/Internal/Activity/ActivityContext.php index 070264ebb..4905be808 100644 --- a/src/Internal/Activity/ActivityContext.php +++ b/src/Internal/Activity/ActivityContext.php @@ -37,12 +37,6 @@ final class ActivityContext implements ActivityContextInterface, HeaderCarrier private ValuesInterface $input; private HeaderInterface $header; - /** - * @param RPCConnectionInterface $rpc - * @param DataConverterInterface $converter - * @param ValuesInterface $input - * @param ValuesInterface|null $lastHeartbeatDetails - */ public function __construct( RPCConnectionInterface $rpc, DataConverterInterface $converter, @@ -58,17 +52,11 @@ public function __construct( $this->header = $header; } - /** - * {@inheritDoc} - */ public function getInfo(): ActivityInfo { return $this->info; } - /** - * {@inheritDoc} - */ public function getInput(): ValuesInterface { return $this->input; @@ -95,17 +83,11 @@ public function withHeader(HeaderInterface $header): self return $context; } - /** - * @return DataConverterInterface - */ public function getDataConverter(): DataConverterInterface { return $this->converter; } - /** - * @return bool - */ public function hasHeartbeatDetails(): bool { return $this->heartbeatDetails !== null; @@ -124,17 +106,11 @@ public function getHeartbeatDetails($type = null) return $this->heartbeatDetails->getValue(0, $type); } - /** - * {@inheritDoc} - */ public function doNotCompleteOnReturn(): void { $this->doNotCompleteOnReturn = true; } - /** - * @return bool - */ public function isDoNotCompleteOnReturn(): bool { return $this->doNotCompleteOnReturn; diff --git a/src/Internal/Assert.php b/src/Internal/Assert.php index 99ef88e7e..2827d6101 100644 --- a/src/Internal/Assert.php +++ b/src/Internal/Assert.php @@ -16,7 +16,6 @@ final class Assert /** * @param mixed $value * @param class-string $enum - * @return bool */ public static function enum($value, string $enum): bool { @@ -38,7 +37,6 @@ public static function enum($value, string $enum): bool /** * @param array $values * @param class-string $of - * @return bool */ public static function valuesInstanceOf(array $values, string $of): bool { @@ -48,7 +46,6 @@ public static function valuesInstanceOf(array $values, string $of): bool /** * @param array $values * @param class-string $of - * @return bool */ public static function valuesSubclassOfOrSameClass(array $values, string $of): bool { @@ -57,8 +54,6 @@ public static function valuesSubclassOfOrSameClass(array $values, string $of): b /** * @param array $values - * @param callable $filter - * @return bool */ public static function all(array $values, callable $filter): bool { diff --git a/src/Internal/Client/ActivityCompletionClient.php b/src/Internal/Client/ActivityCompletionClient.php index 930a9a016..55a2cdd35 100644 --- a/src/Internal/Client/ActivityCompletionClient.php +++ b/src/Internal/Client/ActivityCompletionClient.php @@ -30,11 +30,6 @@ final class ActivityCompletionClient implements ActivityCompletionClientInterfac private ClientOptions $clientOptions; private DataConverterInterface $converter; - /** - * @param ServiceClientInterface $client - * @param ClientOptions $clientOptions - * @param DataConverterInterface $converter - */ public function __construct( ServiceClientInterface $client, ClientOptions $clientOptions, @@ -45,9 +40,6 @@ public function __construct( $this->converter = $converter; } - /** - * {@inheritDoc} - */ public function complete(string $workflowId, ?string $runId, string $activityId, $result = null): void { $r = new Proto\RespondActivityTaskCompletedByIdRequest(); @@ -74,9 +66,6 @@ public function complete(string $workflowId, ?string $runId, string $activityId, } } - /** - * {@inheritDoc} - */ public function completeByToken(string $taskToken, $result = null): void { $r = new Proto\RespondActivityTaskCompletedRequest(); @@ -102,9 +91,6 @@ public function completeByToken(string $taskToken, $result = null): void } } - /** - * {@inheritDoc} - */ public function completeExceptionally( string $workflowId, ?string $runId, @@ -131,9 +117,6 @@ public function completeExceptionally( } } - /** - * {@inheritDoc} - */ public function completeExceptionallyByToken(string $taskToken, \Throwable $error): void { $r = new Proto\RespondActivityTaskFailedRequest(); @@ -154,9 +137,6 @@ public function completeExceptionallyByToken(string $taskToken, \Throwable $erro } } - /** - * {@inheritDoc} - */ public function reportCancellation(string $workflowId, ?string $runId, string $activityId, $details = null): void { $r = new Proto\RespondActivityTaskCanceledByIdRequest(); @@ -178,9 +158,6 @@ public function reportCancellation(string $workflowId, ?string $runId, string $a } } - /** - * {@inheritDoc} - */ public function reportCancellationByToken(string $taskToken, $details = null): void { $r = new Proto\RespondActivityTaskCanceledRequest(); @@ -200,9 +177,6 @@ public function reportCancellationByToken(string $taskToken, $details = null): v } } - /** - * {@inheritDoc} - */ public function recordHeartbeat(string $workflowId, ?string $runId, string $activityId, $details = null): void { $r = new Proto\RecordActivityTaskHeartbeatByIdRequest(); @@ -231,9 +205,6 @@ public function recordHeartbeat(string $workflowId, ?string $runId, string $acti } } - /** - * {@inheritDoc} - */ public function recordHeartbeatByToken(string $taskToken, $details = null): void { $r = new Proto\RecordActivityTaskHeartbeatRequest(); diff --git a/src/Internal/Client/WorkflowProxy.php b/src/Internal/Client/WorkflowProxy.php index 6b8d5821f..9b0331ddf 100644 --- a/src/Internal/Client/WorkflowProxy.php +++ b/src/Internal/Client/WorkflowProxy.php @@ -42,9 +42,6 @@ public function hasHandler(): bool return $this->prototype->getHandler() !== null; } - /** - * @return \ReflectionMethod - */ public function getHandlerReflection(): \ReflectionMethod { return $this->prototype->getHandler() ?? throw new \LogicException( diff --git a/src/Internal/Client/WorkflowRun.php b/src/Internal/Client/WorkflowRun.php index 64620b6ef..384795eb2 100644 --- a/src/Internal/Client/WorkflowRun.php +++ b/src/Internal/Client/WorkflowRun.php @@ -20,7 +20,6 @@ final class WorkflowRun implements WorkflowRunInterface { /** - * @param WorkflowStubInterface $stub * @param \ReflectionClass|\ReflectionType|string|Type|null $returnType */ public function __construct( @@ -28,17 +27,11 @@ public function __construct( private $returnType = null, ) {} - /** - * @return WorkflowExecution - */ public function getExecution(): WorkflowExecution { return $this->stub->getExecution(); } - /** - * {@inheritDoc} - */ public function getResult($type = null, int $timeout = null): mixed { return $this->stub->getResult($type ?? $this->returnType, $timeout); diff --git a/src/Internal/Client/WorkflowStarter.php b/src/Internal/Client/WorkflowStarter.php index 4d9b2cd1b..da0c98c53 100644 --- a/src/Internal/Client/WorkflowStarter.php +++ b/src/Internal/Client/WorkflowStarter.php @@ -25,7 +25,6 @@ use Temporal\Exception\Client\ServiceClientException; use Temporal\Exception\Client\WorkflowExecutionAlreadyStartedException; use Temporal\Interceptor\Header; -use Temporal\Interceptor\HeaderInterface; use Temporal\Interceptor\WorkflowClient\SignalWithStartInput; use Temporal\Interceptor\WorkflowClient\StartInput; use Temporal\Interceptor\WorkflowClientCallsInterceptor; @@ -39,9 +38,6 @@ final class WorkflowStarter { /** - * @param ServiceClientInterface $serviceClient - * @param DataConverterInterface $converter - * @param ClientOptions $clientOptions * @param Pipeline $interceptors */ public function __construct( @@ -52,12 +48,7 @@ public function __construct( ) {} /** - * @param string $workflowType - * @param WorkflowOptions $options - * @param array $args - * @param HeaderInterface|null $header * - * @return WorkflowExecution * * @throws ServiceClientException * @throws WorkflowExecutionAlreadyStartedException @@ -80,14 +71,7 @@ public function start( } /** - * @param string $workflowType - * @param WorkflowOptions $options - * @param string $signal - * @param array $signalArgs - * @param array $startArgs - * @param HeaderInterface|null $header * - * @return WorkflowExecution * * @throws ServiceClientException * @throws WorkflowExecutionAlreadyStartedException @@ -169,7 +153,6 @@ private function executeRequest( * @template TRequest of StartWorkflowExecutionRequest|SignalWithStartWorkflowExecutionRequest * * @param TRequest $req - * @param StartInput $input * * @return TRequest * diff --git a/src/Internal/Client/WorkflowStub.php b/src/Internal/Client/WorkflowStub.php index 9d85c55ea..588d93908 100644 --- a/src/Internal/Client/WorkflowStub.php +++ b/src/Internal/Client/WorkflowStub.php @@ -82,12 +82,8 @@ final class WorkflowStub implements WorkflowStubInterface, HeaderCarrier private HeaderInterface $header; /** - * @param ServiceClientInterface $serviceClient - * @param ClientOptions $clientOptions - * @param DataConverterInterface $converter * @param Pipeline $interceptors * @param non-empty-string|null $workflowType - * @param WorkflowOptions|null $options */ public function __construct( private readonly ServiceClientInterface $serviceClient, @@ -100,17 +96,11 @@ public function __construct( $this->header = Header::empty(); } - /** - * {@inheritDoc} - */ public function getWorkflowType(): ?string { return $this->workflowType; } - /** - * {@inheritDoc} - */ public function getOptions(): ?WorkflowOptions { return $this->options; @@ -121,9 +111,6 @@ public function getHeader(): HeaderInterface return $this->header; } - /** - * {@inheritDoc} - */ public function getExecution(): WorkflowExecution { $this->assertStarted(__FUNCTION__); @@ -134,24 +121,17 @@ public function getExecution(): WorkflowExecution /** * Connects stub to running workflow. * - * @param WorkflowExecution $execution */ public function setExecution(WorkflowExecution $execution): void { $this->execution = $execution; } - /** - * @return bool - */ public function hasExecution(): bool { return $this->execution !== null; } - /** - * {@inheritDoc} - */ public function signal(string $name, ...$args): void { $this->assertStarted(__FUNCTION__); @@ -195,9 +175,6 @@ static function (SignalInput $input) use ($request, $serviceClient): void { )); } - /** - * {@inheritDoc} - */ public function query(string $name, ...$args): ?ValuesInterface { $this->assertStarted(__FUNCTION__); @@ -264,9 +241,6 @@ static function (QueryInput $input) use ($serviceClient, $converter, $clientOpti )); } - /** - * {@inheritDoc} - */ public function update(string $name, ...$args): ?ValuesInterface { $options = UpdateOptions::new($name) @@ -275,9 +249,6 @@ public function update(string $name, ...$args): ?ValuesInterface return $this->startUpdate($options, ...$args)->getEncodedValues(); } - /** - * {@inheritDoc} - */ public function startUpdate(string|UpdateOptions $nameOrOptions, ...$args): UpdateHandle { $nameOrOptions = \is_string($nameOrOptions) @@ -412,9 +383,6 @@ static function ( ); } - /** - * {@inheritDoc} - */ public function getUpdateHandle(string $updateId, mixed $resultType = null): UpdateHandle { return new UpdateHandle( @@ -430,9 +398,6 @@ public function getUpdateHandle(string $updateId, mixed $resultType = null): Upd ); } - /** - * {@inheritDoc} - */ public function cancel(): void { $this->assertStarted(__FUNCTION__); @@ -457,9 +422,6 @@ static function (CancelInput $input) use ($serviceClient, $clientOptions): void )); } - /** - * {@inheritDoc} - */ public function terminate(string $reason, array $details = []): void { $this->assertStarted(__FUNCTION__); @@ -491,7 +453,7 @@ static function (TerminateInput $input) use ($serviceClient, $clientOptions, $de } /** - * {@inheritDoc} + * * * @throws \Throwable */ @@ -551,7 +513,6 @@ function (DescribeInput $input): WorkflowExecutionDescription { } /** - * @param string $method * @psalm-assert !null $this->execution */ private function assertStarted(string $method): void @@ -564,8 +525,6 @@ private function assertStarted(string $method): void } /** - * @param int|null $timeout - * @return EncodedValues|null * @throws \ErrorException */ private function fetchResult(int $timeout = null): ?EncodedValues @@ -644,8 +603,6 @@ private function fetchResult(int $timeout = null): ?EncodedValues } /** - * @param int|null $timeout - * @return HistoryEvent * @throws \ErrorException */ private function getCloseEvent(int $timeout = null): HistoryEvent @@ -703,10 +660,6 @@ private function getCloseEvent(int $timeout = null): HistoryEvent } while (true); } - /** - * @param \Throwable $failure - * @return \Throwable - */ private function mapWorkflowFailureToException(\Throwable $failure): \Throwable { switch (true) { diff --git a/src/Internal/Declaration/ActivityInstance.php b/src/Internal/Declaration/ActivityInstance.php index e34b5d173..81e8c0c80 100644 --- a/src/Internal/Declaration/ActivityInstance.php +++ b/src/Internal/Declaration/ActivityInstance.php @@ -15,10 +15,6 @@ final class ActivityInstance extends Instance implements ActivityInstanceInterface { - /** - * @param ActivityPrototype $prototype - * @param object $context - */ public function __construct( ActivityPrototype $prototype, object $context, diff --git a/src/Internal/Declaration/Dispatcher/Dispatcher.php b/src/Internal/Declaration/Dispatcher/Dispatcher.php index 9e3eb2cfd..8d5bcc187 100644 --- a/src/Internal/Declaration/Dispatcher/Dispatcher.php +++ b/src/Internal/Declaration/Dispatcher/Dispatcher.php @@ -39,47 +39,29 @@ class Dispatcher implements DispatcherInterface */ private $types; - /** - * @var int - */ private int $scope = 0; - /** - * @param \ReflectionFunctionAbstract $fun - */ public function __construct(\ReflectionFunctionAbstract $fun) { $this->boot($fun); } - /** - * @return bool - */ public function isObjectContextRequired(): bool { return $this->scope === static::SCOPE_OBJECT; } - /** - * @return bool - */ #[Pure] public function isObjectContextAllowed(): bool { return $this->scopeMatches(static::SCOPE_OBJECT); } - /** - * @return bool - */ public function isStaticContextRequired(): bool { return $this->scope === static::SCOPE_STATIC; } - /** - * @return bool - */ #[Pure] public function isStaticContextAllowed(): bool { @@ -99,10 +81,6 @@ public function dispatch(object $ctx, array $arguments): mixed return ($this->executor)($ctx, $arguments); } - /** - * @param int $scope - * @return bool - */ #[Pure] private function scopeMatches(int $scope): bool { @@ -112,7 +90,6 @@ private function scopeMatches(int $scope): bool /** * @psalm-return FunctionExecutor * - * @param \ReflectionMethod $fun * @return \Closure(object, array): mixed */ private function createExecutorFromMethod(\ReflectionMethod $fun): \Closure @@ -129,7 +106,6 @@ private function createExecutorFromMethod(\ReflectionMethod $fun): \Closure /** * @psalm-return FunctionExecutor * - * @param \ReflectionFunction $fun * @return \Closure(object, array): mixed */ private function createExecutorFromFunction(\ReflectionFunction $fun): \Closure @@ -154,8 +130,6 @@ private function createExecutorFromFunction(\ReflectionFunction $fun): \Closure /** * @psalm-return FunctionExecutor * - * @param \ReflectionFunctionAbstract $fun - * @return void */ private function boot(\ReflectionFunctionAbstract $fun): void { diff --git a/src/Internal/Declaration/Graph/ClassNode.php b/src/Internal/Declaration/Graph/ClassNode.php index b0dd7888f..dea4b08f0 100644 --- a/src/Internal/Declaration/Graph/ClassNode.php +++ b/src/Internal/Declaration/Graph/ClassNode.php @@ -13,14 +13,8 @@ final class ClassNode implements NodeInterface { - /** - * @var array|null - */ private ?array $inheritance = null; - /** - * @param \ReflectionClass $class - */ public function __construct( private \ReflectionClass $class, ) {} @@ -53,9 +47,6 @@ public function getAllMethods(): array return $result; } - /** - * {@inheritDoc} - */ public function count(): int { return \count( @@ -96,17 +87,11 @@ public function getIterator(): \Traversable ); } - /** - * @return string - */ public function __toString(): string { return $this->class->getName(); } - /** - * @return array - */ private function getClassInheritance(): array { $result = []; @@ -161,10 +146,6 @@ private function getSiblings(): \Traversable } } - /** - * @param \ReflectionClass $interface - * @return bool - */ private function isDirectInterfaceImplementation(\ReflectionClass $interface): bool { if ($parent = $this->class->getParentClass()) { @@ -175,8 +156,6 @@ private function isDirectInterfaceImplementation(\ReflectionClass $interface): b } /** - * @param string $name - * @return bool * @throws \ReflectionException */ private function isDirectMethodImplementation(string $name): bool @@ -192,9 +171,6 @@ private function isDirectMethodImplementation(string $name): bool return false; } - /** - * @return ClassNode|null - */ private function getParent(): ?ClassNode { if ($parent = $this->class->getParentClass()) { @@ -214,8 +190,6 @@ private function getInheritance(): array /** * @param iterable $classes - * @param string $name - * @return array * @throws \ReflectionException */ private function boxMethods(iterable $classes, string $name): array @@ -231,10 +205,6 @@ private function boxMethods(iterable $classes, string $name): array return $result; } - /** - * @param array $boxed - * @return \Traversable - */ private function unboxMethods(array $boxed): \Traversable { $unpack = static function () use ($boxed) { diff --git a/src/Internal/Declaration/Instance.php b/src/Internal/Declaration/Instance.php index 9150b09f8..8b047412e 100644 --- a/src/Internal/Declaration/Instance.php +++ b/src/Internal/Declaration/Instance.php @@ -47,9 +47,6 @@ public function getContext(): object return $this->context; } - /** - * {@inheritDoc} - */ public function getHandler(): callable { return $this->handler; @@ -61,7 +58,6 @@ public function destroy(): void } /** - * @param \ReflectionFunctionAbstract $func * @return \Closure(ValuesInterface): mixed * * @psalm-return DispatchableHandler diff --git a/src/Internal/Declaration/Instantiator/ActivityInstantiator.php b/src/Internal/Declaration/Instantiator/ActivityInstantiator.php index a94fb378c..533196f67 100644 --- a/src/Internal/Declaration/Instantiator/ActivityInstantiator.php +++ b/src/Internal/Declaration/Instantiator/ActivityInstantiator.php @@ -20,9 +20,6 @@ */ final class ActivityInstantiator extends Instantiator { - /** - * {@inheritDoc} - */ public function instantiate(PrototypeInterface $prototype): ActivityInstance { \assert($prototype instanceof ActivityPrototype, 'Precondition failed'); diff --git a/src/Internal/Declaration/Instantiator/Instantiator.php b/src/Internal/Declaration/Instantiator/Instantiator.php index ebde7d2c5..600343074 100644 --- a/src/Internal/Declaration/Instantiator/Instantiator.php +++ b/src/Internal/Declaration/Instantiator/Instantiator.php @@ -16,8 +16,6 @@ abstract class Instantiator implements InstantiatorInterface { /** - * @param PrototypeInterface $prototype - * @return object * @throws \ReflectionException */ protected function getInstance(PrototypeInterface $prototype): object diff --git a/src/Internal/Declaration/Instantiator/WorkflowInstantiator.php b/src/Internal/Declaration/Instantiator/WorkflowInstantiator.php index c6ac77857..6f675a0c2 100644 --- a/src/Internal/Declaration/Instantiator/WorkflowInstantiator.php +++ b/src/Internal/Declaration/Instantiator/WorkflowInstantiator.php @@ -27,9 +27,6 @@ public function __construct( private PipelineProvider $interceptorProvider, ) {} - /** - * {@inheritDoc} - */ public function instantiate(PrototypeInterface $prototype): WorkflowInstance { \assert($prototype instanceof WorkflowPrototype, 'Precondition failed'); @@ -42,8 +39,6 @@ public function instantiate(PrototypeInterface $prototype): WorkflowInstance } /** - * @param PrototypeInterface $prototype - * @return object * @throws \ReflectionException */ protected function getInstance(PrototypeInterface $prototype): object diff --git a/src/Internal/Declaration/Prototype/ActivityPrototype.php b/src/Internal/Declaration/Prototype/ActivityPrototype.php index 325edb643..7e5041091 100644 --- a/src/Internal/Declaration/Prototype/ActivityPrototype.php +++ b/src/Internal/Declaration/Prototype/ActivityPrototype.php @@ -18,14 +18,8 @@ final class ActivityPrototype extends Prototype { - /** - * @var MethodRetry|null - */ private ?MethodRetry $methodRetry = null; - /** - * @var ActivityInstance|null - */ private ?ActivityInstance $instance = null; private ?\Closure $factory = null; @@ -45,9 +39,6 @@ public function __construct( parent::__construct($name, $handler, $class); } - /** - * @return \ReflectionMethod - */ public function getHandler(): \ReflectionMethod { $handler = parent::getHandler(); @@ -56,17 +47,11 @@ public function getHandler(): \ReflectionMethod return $handler; } - /** - * @return MethodRetry|null - */ public function getMethodRetry(): ?MethodRetry { return $this->methodRetry; } - /** - * @param MethodRetry|null $attribute - */ public function setMethodRetry(?MethodRetry $attribute): void { $this->methodRetry = $attribute; @@ -87,7 +72,6 @@ public function getInstance(): ActivityInstance } /** - * @param object $instance * @return $this */ public function withInstance(object $instance): self diff --git a/src/Internal/Declaration/Prototype/Prototype.php b/src/Internal/Declaration/Prototype/Prototype.php index 895f9fc06..c15709945 100644 --- a/src/Internal/Declaration/Prototype/Prototype.php +++ b/src/Internal/Declaration/Prototype/Prototype.php @@ -15,26 +15,12 @@ abstract class Prototype implements PrototypeInterface { - /** - * @var string - */ protected string $name; - /** - * @var \ReflectionMethod|null - */ protected ?\ReflectionMethod $handler; - /** - * @var \ReflectionClass - */ private \ReflectionClass $class; - /** - * @param string $name - * @param \ReflectionMethod|null $handler - * @param \ReflectionClass $class - */ public function __construct(string $name, ?\ReflectionMethod $handler, \ReflectionClass $class) { $this->handler = $handler; @@ -45,8 +31,6 @@ public function __construct(string $name, ?\ReflectionMethod $handler, \Reflecti /** * @template T of PrototypeInterface * - * @param string $class - * @param string $method * @param RepositoryInterface $repository * @return T|null */ @@ -62,35 +46,21 @@ public static function find(string $class, string $method, RepositoryInterface $ return null; } - /** - * @return string - */ public function getID(): string { return $this->name; } - /** - * @return \ReflectionClass - */ public function getClass(): \ReflectionClass { return $this->class; } - /** - * @return \ReflectionMethod|null - */ public function getHandler(): ?\ReflectionMethod { return $this->handler; } - /** - * @param PrototypeInterface $prototype - * @param string $class - * @return bool - */ private static function matchClass(PrototypeInterface $prototype, string $class): bool { $reflection = $prototype->getClass(); @@ -98,11 +68,6 @@ private static function matchClass(PrototypeInterface $prototype, string $class) return $reflection && $reflection->getName() === \trim($class, '\\'); } - /** - * @param PrototypeInterface $prototype - * @param string $method - * @return bool - */ private static function matchMethod(PrototypeInterface $prototype, string $method): bool { $handler = $prototype->getHandler(); diff --git a/src/Internal/Declaration/Prototype/PrototypeInterface.php b/src/Internal/Declaration/Prototype/PrototypeInterface.php index 83292151c..a3e293ead 100644 --- a/src/Internal/Declaration/Prototype/PrototypeInterface.php +++ b/src/Internal/Declaration/Prototype/PrototypeInterface.php @@ -18,21 +18,18 @@ interface PrototypeInterface extends Identifiable /** * Returns the name of the main handler. * - * @return string */ public function getID(): string; /** * Returns a link to the class within which the handler is defined. * - * @return \ReflectionClass */ public function getClass(): \ReflectionClass; /** * Returns the reflection of the handler function. * - * @return \ReflectionMethod|null */ public function getHandler(): ?\ReflectionMethod; } diff --git a/src/Internal/Declaration/Prototype/WorkflowPrototype.php b/src/Internal/Declaration/Prototype/WorkflowPrototype.php index 0ea832735..554d21f6a 100644 --- a/src/Internal/Declaration/Prototype/WorkflowPrototype.php +++ b/src/Internal/Declaration/Prototype/WorkflowPrototype.php @@ -37,64 +37,37 @@ final class WorkflowPrototype extends Prototype */ private array $updateValidators = []; - /** - * @var CronSchedule|null - */ private ?CronSchedule $cronSchedule = null; - /** - * @var MethodRetry|null - */ private ?MethodRetry $methodRetry = null; - /** - * @var ReturnType|null - */ private ?ReturnType $returnType = null; - /** - * @return CronSchedule|null - */ public function getCronSchedule(): ?CronSchedule { return $this->cronSchedule; } - /** - * @param CronSchedule|null $attribute - */ public function setCronSchedule(?CronSchedule $attribute): void { $this->cronSchedule = $attribute; } - /** - * @return MethodRetry|null - */ public function getMethodRetry(): ?MethodRetry { return $this->methodRetry; } - /** - * @param MethodRetry|null $attribute - */ public function setMethodRetry(?MethodRetry $attribute): void { $this->methodRetry = $attribute; } - /** - * @return ReturnType|null - */ public function getReturnType(): ?ReturnType { return $this->returnType; } - /** - * @param ReturnType|null $attribute - */ public function setReturnType(?ReturnType $attribute): void { $this->returnType = $attribute; @@ -133,7 +106,6 @@ public function addUpdateHandler(UpdateDefinition $definition): void /** * @param non-empty-string $name - * @param \ReflectionFunctionAbstract $fun */ public function addValidateUpdateHandler(string $name, \ReflectionFunctionAbstract $fun): void { diff --git a/src/Internal/Declaration/Reader/ActivityReader.php b/src/Internal/Declaration/Reader/ActivityReader.php index c818764a2..8d3b4c49e 100644 --- a/src/Internal/Declaration/Reader/ActivityReader.php +++ b/src/Internal/Declaration/Reader/ActivityReader.php @@ -47,7 +47,6 @@ public function fromClass(string $class): array } /** - * @param \ReflectionClass $class * @return array * @throws \ReflectionException */ @@ -68,8 +67,6 @@ protected function getActivityPrototypes(\ReflectionClass $class): array } /** - * @param ClassNode $graph - * @param \ReflectionMethod $root * @return array * @throws \ReflectionException */ @@ -165,12 +162,6 @@ private function getMethodGroups(ClassNode $graph, \ReflectionMethod $root): arr return $prototypes; } - /** - * @param \ReflectionMethod $ref - * @param ActivityInterface $int - * @param ActivityMethod|null $method - * @return string - */ private function activityName( \ReflectionMethod $ref, ActivityInterface $int, @@ -181,12 +172,6 @@ private function activityName( : $int->prefix . ($method->name ?? $ref->getName()); } - /** - * @param string $name - * @param array $activities - * @param \ReflectionClass $class - * @param \ReflectionMethod $method - */ private function assertActivityNotExists( string $name, array $activities, diff --git a/src/Internal/Declaration/Reader/Reader.php b/src/Internal/Declaration/Reader/Reader.php index 5a0805f08..c462e53a3 100644 --- a/src/Internal/Declaration/Reader/Reader.php +++ b/src/Internal/Declaration/Reader/Reader.php @@ -18,14 +18,8 @@ */ abstract class Reader { - /** - * @var ReaderInterface - */ protected ReaderInterface $reader; - /** - * @param ReaderInterface $reader - */ public function __construct(ReaderInterface $reader) { $this->reader = $reader; @@ -37,10 +31,6 @@ public function __construct(ReaderInterface $reader) */ abstract public function fromClass(string $class); - /** - * @param \ReflectionMethod $method - * @return bool - */ protected function isValidMethod(\ReflectionMethod $method): bool { return !$method->isStatic() && $method->isPublic(); diff --git a/src/Internal/Declaration/Reader/RecursiveAttributeReducerInterface.php b/src/Internal/Declaration/Reader/RecursiveAttributeReducerInterface.php index 48efaf8fb..62ec776ff 100644 --- a/src/Internal/Declaration/Reader/RecursiveAttributeReducerInterface.php +++ b/src/Internal/Declaration/Reader/RecursiveAttributeReducerInterface.php @@ -14,10 +14,6 @@ interface RecursiveAttributeReducerInterface { /** - * @param \ReflectionClass $class - * @param \ReflectionMethod $method - * @param object|null $interface - * @param array $attributes * @return mixed */ public function root( @@ -28,10 +24,6 @@ public function root( ); /** - * @param \ReflectionClass $class - * @param \ReflectionMethod $method - * @param object|null $interface - * @param array $attributes * @return mixed */ public function each( diff --git a/src/Internal/Declaration/Reader/WorkflowReader.php b/src/Internal/Declaration/Reader/WorkflowReader.php index 5b8183f6f..32b3deae3 100644 --- a/src/Internal/Declaration/Reader/WorkflowReader.php +++ b/src/Internal/Declaration/Reader/WorkflowReader.php @@ -69,8 +69,6 @@ class WorkflowReader extends Reader ; /** - * @param string $class - * @return WorkflowPrototype * @throws \ReflectionException */ public function fromClass(string $class): WorkflowPrototype @@ -101,7 +99,6 @@ public function fromObject(object $object): WorkflowPrototype } /** - * @param ClassNode $graph * @return \Traversable * @throws \ReflectionException */ @@ -119,9 +116,6 @@ protected function getWorkflowPrototypes(ClassNode $graph): \Traversable } /** - * @param ClassNode $graph - * @param WorkflowPrototype $prototype - * @return WorkflowPrototype * @throws \ReflectionException */ private function withMethods(ClassNode $graph, WorkflowPrototype $prototype): WorkflowPrototype @@ -247,9 +241,6 @@ private function withMethods(ClassNode $graph, WorkflowPrototype $prototype): Wo return $prototype; } - /** - * @param ClassNode $graph - */ private function assertWorkflowInterface(ClassNode $graph): void { foreach ($graph as $edge) { @@ -268,10 +259,6 @@ private function assertWorkflowInterface(ClassNode $graph): void } /** - * @param ClassNode $graph - * @param \ReflectionMethod $handler - * @param string $name - * @return object|null * @throws \ReflectionException */ private function getAttributedMethod(ClassNode $graph, \ReflectionMethod $handler, string $name): ?object @@ -290,9 +277,6 @@ private function getAttributedMethod(ClassNode $graph, \ReflectionMethod $handle } /** - * @param ClassNode $graph - * @param \ReflectionMethod $handler - * @return WorkflowPrototype|null * @throws \ReflectionException */ private function getPrototype(ClassNode $graph, \ReflectionMethod $handler): ?WorkflowPrototype @@ -387,7 +371,6 @@ private function getDefaultPrototype(ClassNode $graph): WorkflowPrototype * @param \ReflectionMethod $ctx Current method in the inheritance chain * @param \ReflectionClass $interface Class or Interface with #[WorkflowInterface] attribute * @param \ReflectionClass $class Target class - * @return WorkflowPrototype|null */ private function findProto( \ReflectionMethod $handler, diff --git a/src/Internal/Declaration/WorkflowInstance.php b/src/Internal/Declaration/WorkflowInstance.php index 3108f1554..0cff3bb88 100644 --- a/src/Internal/Declaration/WorkflowInstance.php +++ b/src/Internal/Declaration/WorkflowInstance.php @@ -147,9 +147,6 @@ public function initConstructor(): void } } - /** - * @return SignalQueue - */ public function getSignalQueue(): SignalQueue { return $this->signalQueue; @@ -189,8 +186,6 @@ public function findValidateUpdateHandler(string $name): ?\Closure } /** - * @param string $name - * @param callable $handler * @throws \ReflectionException */ public function addQueryHandler(string $name, callable $handler): void @@ -208,7 +203,6 @@ function (QueryInput $input) use ($fn) { /** * @param non-empty-string $name - * @param callable $handler * @throws \ReflectionException */ public function addUpdateHandler(string $name, callable $handler): void @@ -226,7 +220,6 @@ function (UpdateInput $input, Deferred $deferred) use ($fn) { /** * @param non-empty-string $name - * @param callable $handler * @throws \ReflectionException */ public function addValidateUpdateHandler(string $name, callable $handler): void @@ -257,8 +250,6 @@ public function getSignalHandler(string $name): \Closure } /** - * @param string $name - * @param callable $handler * @throws \ReflectionException */ public function addSignalHandler(string $name, callable $handler): void @@ -297,8 +288,6 @@ public function getPrototype(): WorkflowPrototype /** * Make a Closure from a callable. * - * @param callable $handler - * * @return \Closure(ValuesInterface): mixed * @throws \ReflectionException * diff --git a/src/Internal/Declaration/WorkflowInstance/SignalQueue.php b/src/Internal/Declaration/WorkflowInstance/SignalQueue.php index 13e3b17df..d4b61a919 100644 --- a/src/Internal/Declaration/WorkflowInstance/SignalQueue.php +++ b/src/Internal/Declaration/WorkflowInstance/SignalQueue.php @@ -37,7 +37,6 @@ final class SignalQueue /** * @param non-empty-string $signal - * @param ValuesInterface $values */ public function push(string $signal, ValuesInterface $values): void { @@ -59,9 +58,7 @@ public function onSignal(callable $handler): void } /** - * @param string $signal * @param Consumer $consumer - * @return void */ public function attach(string $signal, callable $consumer): void { @@ -75,7 +72,6 @@ public function clear(): void } /** - * @param string $signal * @psalm-suppress UnusedVariable */ private function flush(string $signal): void diff --git a/src/Internal/Declaration/WorkflowInstanceInterface.php b/src/Internal/Declaration/WorkflowInstanceInterface.php index 56c3c5e56..f64905f46 100644 --- a/src/Internal/Declaration/WorkflowInstanceInterface.php +++ b/src/Internal/Declaration/WorkflowInstanceInterface.php @@ -31,21 +31,15 @@ public function initConstructor(): void; */ public function findQueryHandler(string $name): ?\Closure; - /** - * @param string $name - * @param callable $handler - */ public function addQueryHandler(string $name, callable $handler): void; /** * @param non-empty-string $name - * @param callable $handler */ public function addUpdateHandler(string $name, callable $handler): void; /** * @param non-empty-string $name - * @param callable $handler */ public function addValidateUpdateHandler(string $name, callable $handler): void; @@ -61,10 +55,6 @@ public function getSignalHandler(string $name): \Closure; */ public function findUpdateHandler(string $name): ?\Closure; - /** - * @param string $name - * @param callable $handler - */ public function addSignalHandler(string $name, callable $handler): void; public function clearSignalQueue(): void; diff --git a/src/Internal/Events/EventEmitterInterface.php b/src/Internal/Events/EventEmitterInterface.php index 028587530..a49df23c6 100644 --- a/src/Internal/Events/EventEmitterInterface.php +++ b/src/Internal/Events/EventEmitterInterface.php @@ -18,8 +18,6 @@ interface EventEmitterInterface { /** * @param T $event - * @param array $arguments - * @return void */ public function emit(string $event, array $arguments = []): void; } diff --git a/src/Internal/Events/EventEmitterTrait.php b/src/Internal/Events/EventEmitterTrait.php index 9819dc385..c03b71657 100644 --- a/src/Internal/Events/EventEmitterTrait.php +++ b/src/Internal/Events/EventEmitterTrait.php @@ -27,9 +27,6 @@ trait EventEmitterTrait */ protected array $once = []; - /** - * {@inheritDoc} - */ public function once(string $event, callable $then): self { $this->once[$event][] = $then; @@ -37,9 +34,6 @@ public function once(string $event, callable $then): self return $this; } - /** - * {@inheritDoc} - */ public function emit(string $event, array $arguments = []): void { while (($this->once[$event] ?? []) !== []) { diff --git a/src/Internal/Events/EventListenerInterface.php b/src/Internal/Events/EventListenerInterface.php index d834f0148..c9cf01516 100644 --- a/src/Internal/Events/EventListenerInterface.php +++ b/src/Internal/Events/EventListenerInterface.php @@ -18,7 +18,6 @@ interface EventListenerInterface { /** * @param T $event - * @param callable $then * @return $this */ public function once(string $event, callable $then): self; diff --git a/src/Internal/Interceptor/HeaderCarrier.php b/src/Internal/Interceptor/HeaderCarrier.php index 8848fd343..4b7417a5a 100644 --- a/src/Internal/Interceptor/HeaderCarrier.php +++ b/src/Internal/Interceptor/HeaderCarrier.php @@ -21,8 +21,6 @@ interface HeaderCarrier /** * Get configured Header set. * - * @return HeaderInterface - * * @psalm-mutation-free */ public function getHeader(): HeaderInterface; diff --git a/src/Internal/Interceptor/Pipeline.php b/src/Internal/Interceptor/Pipeline.php index c6d8fd1f7..484b777b6 100644 --- a/src/Internal/Interceptor/Pipeline.php +++ b/src/Internal/Interceptor/Pipeline.php @@ -30,7 +30,6 @@ final class Pipeline /** @var non-empty-string */ private string $method; - /** @var \Closure */ private \Closure $last; /** @var list */ @@ -66,7 +65,6 @@ public static function prepare(iterable $interceptors): self } /** - * @param \Closure $last * @param non-empty-string $method Method name of the all interceptors. * * @return TCallable @@ -84,8 +82,6 @@ public function with(\Closure $last, string $method): callable /** * Must be used after {@see self::with()} method. * - * @param mixed ...$arguments - * * @return TReturn */ public function __invoke(mixed ...$arguments): mixed diff --git a/src/Internal/Marshaller/Mapper/AttributeMapper.php b/src/Internal/Marshaller/Mapper/AttributeMapper.php index 19a0336a4..02d165033 100644 --- a/src/Internal/Marshaller/Mapper/AttributeMapper.php +++ b/src/Internal/Marshaller/Mapper/AttributeMapper.php @@ -25,14 +25,8 @@ */ class AttributeMapper implements MapperInterface { - /** - * @var \ReflectionClass - */ private \ReflectionClass $class; - /** - * @var ReaderInterface - */ private ReaderInterface $reader; /** @@ -45,21 +39,10 @@ class AttributeMapper implements MapperInterface */ private array $setters = []; - /** - * @var Scope - */ private Scope $scope; - /** - * @var TypeFactoryInterface - */ private TypeFactoryInterface $factory; - /** - * @param \ReflectionClass $class - * @param TypeFactoryInterface $factory - * @param ReaderInterface $reader - */ public function __construct(\ReflectionClass $class, TypeFactoryInterface $factory, ReaderInterface $reader) { $this->class = $class; @@ -76,33 +59,21 @@ public function __construct(\ReflectionClass $class, TypeFactoryInterface $facto } } - /** - * @return bool - */ public function isCopyOnWrite(): bool { return $this->scope->copyOnWrite; } - /** - * {@inheritDoc} - */ public function getGetters(): iterable { return $this->getters; } - /** - * {@inheritDoc} - */ public function getSetters(): iterable { return $this->setters; } - /** - * @return Scope - */ private function getScope(): Scope { return $this->reader->firstClassMetadata($this->class, Scope::class) ?? new Scope(); @@ -112,8 +83,6 @@ private function getScope(): Scope * Generates property name as key and related {@see MarshallingRule} or {@see null} (if no {@see Marshal} * attributes found) as value. * - * @param Scope $scope - * * @return iterable<\ReflectionProperty, array{MarshallingRule|null, bool}> */ private function getPropertyMappings(Scope $scope): iterable @@ -136,22 +105,11 @@ private function getPropertyMappings(Scope $scope): iterable } } - /** - * @param \ReflectionProperty $property - * @param Scope $scope - * @return bool - */ private function isValidScope(\ReflectionProperty $property, Scope $scope): bool { return ($property->getModifiers() & $scope->properties) === $scope->properties; } - /** - * @param \ReflectionProperty $property - * @param MarshallingRule|null $rule - * - * @return TypeInterface|null - */ private function detectType(\ReflectionProperty $property, ?MarshallingRule &$rule): ?TypeInterface { if (($rule === null || !$rule->hasType()) && $this->factory instanceof RuleFactoryInterface) { @@ -175,11 +133,6 @@ private function detectType(\ReflectionProperty $property, ?MarshallingRule &$ru return $this->factory->create($rule->type, $rule->getConstructorArgs()); } - /** - * @param string $name - * @param TypeInterface|null $type - * @return \Closure - */ private function createGetter(string $name, ?TypeInterface $type): \Closure { return function () use ($name, $type) { @@ -193,11 +146,6 @@ private function createGetter(string $name, ?TypeInterface $type): \Closure }; } - /** - * @param string $name - * @param TypeInterface|null $type - * @return \Closure - */ private function createSetter(string $name, ?TypeInterface $type): \Closure { return function ($value) use ($name, $type): void { diff --git a/src/Internal/Marshaller/Mapper/AttributeMapperFactory.php b/src/Internal/Marshaller/Mapper/AttributeMapperFactory.php index 1aa56e4bb..b1d57f475 100644 --- a/src/Internal/Marshaller/Mapper/AttributeMapperFactory.php +++ b/src/Internal/Marshaller/Mapper/AttributeMapperFactory.php @@ -16,22 +16,13 @@ class AttributeMapperFactory implements MapperFactoryInterface { - /** - * @var ReaderInterface - */ private ReaderInterface $reader; - /** - * @param ReaderInterface $reader - */ public function __construct(ReaderInterface $reader) { $this->reader = $reader; } - /** - * {@inheritDoc} - */ public function create(\ReflectionClass $class, TypeFactoryInterface $types): MapperInterface { return new AttributeMapper($class, $types, $this->reader); diff --git a/src/Internal/Marshaller/Mapper/MapperFactoryInterface.php b/src/Internal/Marshaller/Mapper/MapperFactoryInterface.php index 8167b26ef..565cbe575 100644 --- a/src/Internal/Marshaller/Mapper/MapperFactoryInterface.php +++ b/src/Internal/Marshaller/Mapper/MapperFactoryInterface.php @@ -15,10 +15,5 @@ interface MapperFactoryInterface { - /** - * @param \ReflectionClass $class - * @param TypeFactoryInterface $types - * @return MapperInterface - */ public function create(\ReflectionClass $class, TypeFactoryInterface $types): MapperInterface; } diff --git a/src/Internal/Marshaller/Mapper/MapperInterface.php b/src/Internal/Marshaller/Mapper/MapperInterface.php index 227c289b0..48eda1b96 100644 --- a/src/Internal/Marshaller/Mapper/MapperInterface.php +++ b/src/Internal/Marshaller/Mapper/MapperInterface.php @@ -17,9 +17,6 @@ */ interface MapperInterface { - /** - * @return bool - */ public function isCopyOnWrite(): bool; /** diff --git a/src/Internal/Marshaller/Marshaller.php b/src/Internal/Marshaller/Marshaller.php index 535bddc64..6fc67804b 100644 --- a/src/Internal/Marshaller/Marshaller.php +++ b/src/Internal/Marshaller/Marshaller.php @@ -26,18 +26,11 @@ class Marshaller implements MarshallerInterface */ private array $mappers = []; - /** - * @var TypeFactory - */ private TypeFactory $type; - /** - * @var MapperFactoryInterface - */ private MapperFactoryInterface $mapper; /** - * @param MapperFactoryInterface $mapper * @param array $matchers */ public function __construct(MapperFactoryInterface $mapper, array $matchers = []) @@ -47,7 +40,7 @@ public function __construct(MapperFactoryInterface $mapper, array $matchers = [] } /** - * {@inheritDoc} + * * * @throws \ReflectionException */ @@ -72,7 +65,7 @@ public function marshal(object $from): array } /** - * {@inheritDoc} + * * * @throws \ReflectionException */ @@ -111,7 +104,6 @@ public function unmarshal(array $from, object $to): object /** * @param class-string $class - * @return MapperInterface * @throws \ReflectionException */ private function factory(string $class): MapperInterface @@ -123,7 +115,6 @@ private function factory(string $class): MapperInterface /** * @param class-string $class - * @return MapperInterface * @throws \ReflectionException */ private function getMapper(string $class): MapperInterface diff --git a/src/Internal/Marshaller/MarshallerInterface.php b/src/Internal/Marshaller/MarshallerInterface.php index d275af9fa..6557c94bb 100644 --- a/src/Internal/Marshaller/MarshallerInterface.php +++ b/src/Internal/Marshaller/MarshallerInterface.php @@ -27,7 +27,6 @@ public function marshal(object $from): mixed; /** * @template T of object - * @param array $from * @param T $to * @return T * diff --git a/src/Internal/Marshaller/MarshallingRule.php b/src/Internal/Marshaller/MarshallingRule.php index fb4bae40c..b08635fba 100644 --- a/src/Internal/Marshaller/MarshallingRule.php +++ b/src/Internal/Marshaller/MarshallingRule.php @@ -19,7 +19,6 @@ class MarshallingRule { /** - * @param string|null $name * @param class-string|null $type * @param self|class-string|string|null $of */ diff --git a/src/Internal/Marshaller/Meta/Marshal.php b/src/Internal/Marshaller/Meta/Marshal.php index d1b44c816..93200d733 100644 --- a/src/Internal/Marshaller/Meta/Marshal.php +++ b/src/Internal/Marshaller/Meta/Marshal.php @@ -28,10 +28,7 @@ class Marshal extends MarshallingRule { /** - * @param string|null $name * @param class-string|null $type - * @param null|Marshal|string $of - * @param bool $nullable */ public function __construct( ?string $name = null, @@ -42,9 +39,6 @@ public function __construct( parent::__construct($name, $type, $of); } - /** - * @return MarshallingRule - */ public function toTypeDto(): MarshallingRule { if (!$this->nullable) { diff --git a/src/Internal/Marshaller/Meta/MarshalArray.php b/src/Internal/Marshaller/Meta/MarshalArray.php index 8bf7ef7cc..61905ae37 100644 --- a/src/Internal/Marshaller/Meta/MarshalArray.php +++ b/src/Internal/Marshaller/Meta/MarshalArray.php @@ -27,11 +27,6 @@ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::IS_REPEATABLE), NamedArgumentConstructor] final class MarshalArray extends Marshal { - /** - * @param string|null $name - * @param Marshal|string|null $of - * @param bool $nullable - */ public function __construct( string $name = null, Marshal|string|null $of = null, diff --git a/src/Internal/Marshaller/Meta/MarshalAssocArray.php b/src/Internal/Marshaller/Meta/MarshalAssocArray.php index c051f6065..61feb6a1e 100644 --- a/src/Internal/Marshaller/Meta/MarshalAssocArray.php +++ b/src/Internal/Marshaller/Meta/MarshalAssocArray.php @@ -26,11 +26,6 @@ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::IS_REPEATABLE), NamedArgumentConstructor] final class MarshalAssocArray extends Marshal { - /** - * @param string|null $name - * @param Marshal|string|null $of - * @param bool $nullable - */ public function __construct( string $name = null, Marshal|string|null $of = null, diff --git a/src/Internal/Marshaller/Meta/MarshalDateTime.php b/src/Internal/Marshaller/Meta/MarshalDateTime.php index bbc047d35..b9214e773 100644 --- a/src/Internal/Marshaller/Meta/MarshalDateTime.php +++ b/src/Internal/Marshaller/Meta/MarshalDateTime.php @@ -24,7 +24,6 @@ final class MarshalDateTime extends Marshal * @param class-string<\DateTimeInterface>|null $of Local representation of the date. * May be any of internal or Carbon {@see DatetimeInterface} implementations. * @param non-empty-string $to Datetime format or {@see Timestamp} class name. - * @param bool $nullable */ public function __construct( string $name = null, diff --git a/src/Internal/Marshaller/Meta/MarshalOneOf.php b/src/Internal/Marshaller/Meta/MarshalOneOf.php index 69eedfb59..0c75583df 100644 --- a/src/Internal/Marshaller/Meta/MarshalOneOf.php +++ b/src/Internal/Marshaller/Meta/MarshalOneOf.php @@ -21,7 +21,6 @@ final class MarshalOneOf extends Marshal * @param non-empty-array $cases * @param non-empty-string|null $name * @param class-string|null $of - * @param bool $nullable */ public function __construct( private array $cases, diff --git a/src/Internal/Marshaller/Meta/Scope.php b/src/Internal/Marshaller/Meta/Scope.php index 8473f0123..761ad1310 100644 --- a/src/Internal/Marshaller/Meta/Scope.php +++ b/src/Internal/Marshaller/Meta/Scope.php @@ -50,14 +50,10 @@ class Scope #[ExpectedValues(valuesFromClass: Scope::class)] public int $properties; - /** - * @var bool - */ public bool $copyOnWrite; /** * @param ExportScope $properties - * @param bool $copyOnWrite */ public function __construct( int $properties = self::VISIBILITY_PUBLIC, diff --git a/src/Internal/Marshaller/RuleFactoryInterface.php b/src/Internal/Marshaller/RuleFactoryInterface.php index 014881209..0f4d19d7c 100644 --- a/src/Internal/Marshaller/RuleFactoryInterface.php +++ b/src/Internal/Marshaller/RuleFactoryInterface.php @@ -17,10 +17,5 @@ */ interface RuleFactoryInterface extends TypeFactoryInterface { - /** - * @param \ReflectionProperty $property - * - * @return null|MarshallingRule - */ public function makeRule(\ReflectionProperty $property): ?MarshallingRule; } diff --git a/src/Internal/Marshaller/Type/ArrayType.php b/src/Internal/Marshaller/Type/ArrayType.php index 271331a4b..a5824a997 100644 --- a/src/Internal/Marshaller/Type/ArrayType.php +++ b/src/Internal/Marshaller/Type/ArrayType.php @@ -24,14 +24,9 @@ class ArrayType extends Type implements DetectableTypeInterface, RuleFactoryInte */ private const ERROR_INVALID_TYPE = 'Passed value must be a type of array, but %s given'; - /** - * @var TypeInterface|null - */ private ?TypeInterface $type = null; /** - * @param MarshallerInterface $marshaller - * @param MarshallingRule|string|null $typeOrClass * * @throws \ReflectionException */ @@ -44,17 +39,11 @@ public function __construct(MarshallerInterface $marshaller, MarshallingRule|str parent::__construct($marshaller); } - /** - * {@inheritDoc} - */ public static function match(\ReflectionNamedType $type): bool { return $type->getName() === 'array' || $type->getName() === 'iterable'; } - /** - * {@inheritDoc} - */ public static function makeRule(\ReflectionProperty $property): ?MarshallingRule { $type = $property->getType(); @@ -95,7 +84,6 @@ public function parse($value, $current): array /** * @param iterable $value * - * @return array */ public function serialize($value): array { diff --git a/src/Internal/Marshaller/Type/AssocArrayType.php b/src/Internal/Marshaller/Type/AssocArrayType.php index 39154f057..3c770a960 100644 --- a/src/Internal/Marshaller/Type/AssocArrayType.php +++ b/src/Internal/Marshaller/Type/AssocArrayType.php @@ -26,14 +26,9 @@ class AssocArrayType extends Type */ private const ERROR_INVALID_TYPE = 'Passed value must be a type of array, but %s given'; - /** - * @var TypeInterface|null - */ private ?TypeInterface $type = null; /** - * @param MarshallerInterface $marshaller - * @param MarshallingRule|string|null $typeOrClass * * @throws \ReflectionException */ diff --git a/src/Internal/Marshaller/Type/CronType.php b/src/Internal/Marshaller/Type/CronType.php index ae5657cb0..5dec24744 100644 --- a/src/Internal/Marshaller/Type/CronType.php +++ b/src/Internal/Marshaller/Type/CronType.php @@ -23,9 +23,6 @@ class CronType extends Type 'Passed value must be a type of ' . 'cron-like string or cron expression, but %s given'; - /** - * {@inheritDoc} - */ public function parse($value, $current) { if ($value === '') { @@ -40,9 +37,6 @@ public function parse($value, $current) throw new \InvalidArgumentException(\sprintf(self::ERROR_INVALID_TYPE, \get_debug_type($value))); } - /** - * {@inheritDoc} - */ public function serialize($value): string { if (\is_string($value) || $value instanceof \Stringable) { diff --git a/src/Internal/Marshaller/Type/DateIntervalType.php b/src/Internal/Marshaller/Type/DateIntervalType.php index 27af8485c..819394213 100644 --- a/src/Internal/Marshaller/Type/DateIntervalType.php +++ b/src/Internal/Marshaller/Type/DateIntervalType.php @@ -24,15 +24,8 @@ */ class DateIntervalType extends Type implements DetectableTypeInterface, RuleFactoryInterface { - /** - * @var string - */ private string $format; - /** - * @param MarshallerInterface $marshaller - * @param string $format - */ public function __construct(MarshallerInterface $marshaller, string $format = DateInterval::FORMAT_NANOSECONDS) { $this->format = $format; @@ -40,17 +33,11 @@ public function __construct(MarshallerInterface $marshaller, string $format = Da parent::__construct($marshaller); } - /** - * {@inheritDoc} - */ public static function match(\ReflectionNamedType $type): bool { return !$type->isBuiltin() && Inheritance::extends($type->getName(), \DateInterval::class); } - /** - * {@inheritDoc} - */ public static function makeRule(\ReflectionProperty $property): ?MarshallingRule { $type = $property->getType(); @@ -64,9 +51,6 @@ public static function makeRule(\ReflectionProperty $property): ?MarshallingRule : new MarshallingRule($property->getName(), self::class); } - /** - * {@inheritDoc} - */ public function serialize($value): int|Duration { if ($this->format === DateInterval::FORMAT_NANOSECONDS) { @@ -89,9 +73,6 @@ public function serialize($value): int|Duration return (int) (DateInterval::parse($value, $this->format)->$method); } - /** - * {@inheritDoc} - */ public function parse($value, $current): CarbonInterval { return DateInterval::parse($value, $this->format); diff --git a/src/Internal/Marshaller/Type/DateTimeType.php b/src/Internal/Marshaller/Type/DateTimeType.php index 7e15d5e74..f9be701f3 100644 --- a/src/Internal/Marshaller/Type/DateTimeType.php +++ b/src/Internal/Marshaller/Type/DateTimeType.php @@ -23,9 +23,6 @@ */ class DateTimeType extends Type implements DetectableTypeInterface, RuleFactoryInterface { - /** - * @var string - */ private string $format; /** @@ -34,9 +31,7 @@ class DateTimeType extends Type implements DetectableTypeInterface, RuleFactoryI private string $class; /** - * @param MarshallerInterface $marshaller * @param class-string<\DateTimeInterface>|null $class - * @param string $format */ #[Pure] public function __construct( @@ -51,17 +46,11 @@ public function __construct( $this->class = $class; } - /** - * {@inheritDoc} - */ public static function match(\ReflectionNamedType $type): bool { return !$type->isBuiltin() && Inheritance::implements($type->getName(), \DateTimeInterface::class); } - /** - * {@inheritDoc} - */ public static function makeRule(\ReflectionProperty $property): ?MarshallingRule { $type = $property->getType(); @@ -79,9 +68,6 @@ public static function makeRule(\ReflectionProperty $property): ?MarshallingRule : new MarshallingRule($property->getName(), self::class, $type->getName()); } - /** - * {@inheritDoc} - */ public function parse($value, $current): \DateTimeInterface { return DateTime::parse($value, class: $this->class); diff --git a/src/Internal/Marshaller/Type/DetectableTypeInterface.php b/src/Internal/Marshaller/Type/DetectableTypeInterface.php index aedf9e65d..bbb4ed98e 100644 --- a/src/Internal/Marshaller/Type/DetectableTypeInterface.php +++ b/src/Internal/Marshaller/Type/DetectableTypeInterface.php @@ -13,9 +13,5 @@ interface DetectableTypeInterface { - /** - * @param \ReflectionNamedType $type - * @return bool - */ public static function match(\ReflectionNamedType $type): bool; } diff --git a/src/Internal/Marshaller/Type/DurationJsonType.php b/src/Internal/Marshaller/Type/DurationJsonType.php index 0605f6bdb..67e895e7a 100644 --- a/src/Internal/Marshaller/Type/DurationJsonType.php +++ b/src/Internal/Marshaller/Type/DurationJsonType.php @@ -30,7 +30,6 @@ class DurationJsonType extends Type implements DetectableTypeInterface, RuleFact private string $fallbackFormat; /** - * @param MarshallerInterface $marshaller * @param DateIntervalFormat $format Fall back format for parsing when the value is not an array. */ public function __construct(MarshallerInterface $marshaller, string $format = DateInterval::FORMAT_NANOSECONDS) @@ -40,17 +39,11 @@ public function __construct(MarshallerInterface $marshaller, string $format = Da parent::__construct($marshaller); } - /** - * {@inheritDoc} - */ public static function match(\ReflectionNamedType $type): bool { return !$type->isBuiltin() && Inheritance::extends($type->getName(), \DateInterval::class); } - /** - * {@inheritDoc} - */ public static function makeRule(\ReflectionProperty $property): ?MarshallingRule { $type = $property->getType(); @@ -64,9 +57,6 @@ public static function makeRule(\ReflectionProperty $property): ?MarshallingRule : new MarshallingRule($property->getName(), self::class); } - /** - * {@inheritDoc} - */ public function serialize($value): ?array { $duration = match (true) { @@ -82,9 +72,6 @@ public function serialize($value): ?array return ['seconds' => $duration->getSeconds(), 'nanos' => $duration->getNanos()]; } - /** - * {@inheritDoc} - */ public function parse($value, $current): CarbonInterval { if (\is_array($value) && isset($value['seconds']) && isset($value['nanos'])) { diff --git a/src/Internal/Marshaller/Type/EnumType.php b/src/Internal/Marshaller/Type/EnumType.php index 202740ff3..694141f68 100644 --- a/src/Internal/Marshaller/Type/EnumType.php +++ b/src/Internal/Marshaller/Type/EnumType.php @@ -35,9 +35,6 @@ public function __construct(MarshallerInterface $marshaller, string $class = nul parent::__construct($marshaller); } - /** - * {@inheritDoc} - */ public static function makeRule(\ReflectionProperty $property): ?MarshallingRule { $type = $property->getType(); @@ -55,9 +52,6 @@ public static function makeRule(\ReflectionProperty $property): ?MarshallingRule : new MarshallingRule($property->getName(), self::class, $type->getName()); } - /** - * {@inheritDoc} - */ public function parse($value, $current) { if (\is_object($value)) { diff --git a/src/Internal/Marshaller/Type/EnumValueType.php b/src/Internal/Marshaller/Type/EnumValueType.php index 92420bbb7..9ad8a12dd 100644 --- a/src/Internal/Marshaller/Type/EnumValueType.php +++ b/src/Internal/Marshaller/Type/EnumValueType.php @@ -36,9 +36,6 @@ public function __construct(MarshallerInterface $marshaller, ?string $class = nu parent::__construct($marshaller); } - /** - * {@inheritDoc} - */ public static function makeRule(\ReflectionProperty $property): ?MarshallingRule { $type = $property->getType(); @@ -56,9 +53,6 @@ public static function makeRule(\ReflectionProperty $property): ?MarshallingRule : new MarshallingRule($property->getName(), self::class, $type->getName()); } - /** - * {@inheritDoc} - */ public function parse($value, $current) { if (\is_object($value)) { diff --git a/src/Internal/Marshaller/Type/NullableType.php b/src/Internal/Marshaller/Type/NullableType.php index c303821e1..0e40efb73 100644 --- a/src/Internal/Marshaller/Type/NullableType.php +++ b/src/Internal/Marshaller/Type/NullableType.php @@ -19,14 +19,9 @@ */ class NullableType extends Type { - /** - * @var TypeInterface|null - */ private ?TypeInterface $type = null; /** - * @param MarshallerInterface $marshaller - * @param MarshallingRule|string|null $typeOrClass * * @throws \ReflectionException */ diff --git a/src/Internal/Marshaller/Type/ObjectType.php b/src/Internal/Marshaller/Type/ObjectType.php index 424b53806..c7f327922 100644 --- a/src/Internal/Marshaller/Type/ObjectType.php +++ b/src/Internal/Marshaller/Type/ObjectType.php @@ -26,7 +26,6 @@ class ObjectType extends Type implements DetectableTypeInterface, RuleFactoryInt private \ReflectionClass $reflection; /** - * @param MarshallerInterface $marshaller * @param class-string|null $class * @throws \ReflectionException */ @@ -37,17 +36,11 @@ public function __construct(MarshallerInterface $marshaller, string $class = nul parent::__construct($marshaller); } - /** - * {@inheritDoc} - */ public static function match(\ReflectionNamedType $type): bool { return !$type->isBuiltin() || $type->getName() === 'object'; } - /** - * {@inheritDoc} - */ public static function makeRule(\ReflectionProperty $property): ?MarshallingRule { $type = $property->getType(); @@ -65,9 +58,6 @@ public static function makeRule(\ReflectionProperty $property): ?MarshallingRule : new MarshallingRule($property->getName(), self::class, $type->getName()); } - /** - * {@inheritDoc} - */ public function parse($value, $current): object { if (\is_object($value)) { @@ -89,9 +79,6 @@ public function parse($value, $current): object return $this->marshaller->unmarshal($value ?? [], $current); } - /** - * {@inheritDoc} - */ public function serialize($value): array { return $this->reflection->getName() === \stdClass::class @@ -110,7 +97,6 @@ protected function emptyInstance(): object } /** - * @param array $data * * @return TClass * @throws \ReflectionException diff --git a/src/Internal/Marshaller/Type/OneOfType.php b/src/Internal/Marshaller/Type/OneOfType.php index 9338d0acb..fc5d8a7c0 100644 --- a/src/Internal/Marshaller/Type/OneOfType.php +++ b/src/Internal/Marshaller/Type/OneOfType.php @@ -32,9 +32,6 @@ public function __construct( parent::__construct($marshaller); } - /** - * {@inheritDoc} - */ public function parse(mixed $value, mixed $current): ?object { if (\is_object($value)) { @@ -84,9 +81,6 @@ public function parse(mixed $value, mixed $current): ?object return $this->marshaller->unmarshal($value, $dto); } - /** - * {@inheritDoc} - */ public function serialize(mixed $value): array { if ($this->nullable && $value === null) { diff --git a/src/Internal/Marshaller/Type/RuleFactoryInterface.php b/src/Internal/Marshaller/Type/RuleFactoryInterface.php index 1b5396444..753ce7a8c 100644 --- a/src/Internal/Marshaller/Type/RuleFactoryInterface.php +++ b/src/Internal/Marshaller/Type/RuleFactoryInterface.php @@ -23,9 +23,6 @@ interface RuleFactoryInterface extends TypeInterface /** * Make a marshalling rule for the given property. * - * @param \ReflectionProperty $property - * - * @return null|MarshallingRule */ public static function makeRule(\ReflectionProperty $property): ?MarshallingRule; } diff --git a/src/Internal/Marshaller/Type/Type.php b/src/Internal/Marshaller/Type/Type.php index e92981659..2142b28a1 100644 --- a/src/Internal/Marshaller/Type/Type.php +++ b/src/Internal/Marshaller/Type/Type.php @@ -29,10 +29,7 @@ public function __construct( ) {} /** - * @param MarshallerInterface $marshaller - * @param string|MarshallingRule $type * - * @return TypeInterface|null * @throws \ReflectionException */ protected function ofType(MarshallerInterface $marshaller, MarshallingRule|string $type): ?TypeInterface diff --git a/src/Internal/Marshaller/TypeFactory.php b/src/Internal/Marshaller/TypeFactory.php index d5b21575d..fb7d533cf 100644 --- a/src/Internal/Marshaller/TypeFactory.php +++ b/src/Internal/Marshaller/TypeFactory.php @@ -44,13 +44,9 @@ class TypeFactory implements RuleFactoryInterface */ private array $typeDtoMatchers = []; - /** - * @var MarshallerInterface - */ private MarshallerInterface $marshaller; /** - * @param MarshallerInterface $marshaller * @param array $matchers */ public function __construct(MarshallerInterface $marshaller, array $matchers) @@ -61,9 +57,6 @@ public function __construct(MarshallerInterface $marshaller, array $matchers) $this->createMatchers($this->getDefaultMatchers()); } - /** - * {@inheritDoc} - */ public function create(string $type, array $args): ?TypeInterface { if (!\is_subclass_of($type, TypeInterface::class)) { @@ -73,9 +66,6 @@ public function create(string $type, array $args): ?TypeInterface return new $type($this->marshaller, ...$args); } - /** - * {@inheritDoc} - */ public function detect(?\ReflectionType $type): ?string { /** @@ -96,9 +86,6 @@ public function detect(?\ReflectionType $type): ?string return null; } - /** - * {@inheritDoc} - */ public function makeRule(\ReflectionProperty $property): ?MarshallingRule { foreach ($this->typeDtoMatchers as $matcher) { diff --git a/src/Internal/Marshaller/TypeFactoryInterface.php b/src/Internal/Marshaller/TypeFactoryInterface.php index ea6b10a04..09978d60c 100644 --- a/src/Internal/Marshaller/TypeFactoryInterface.php +++ b/src/Internal/Marshaller/TypeFactoryInterface.php @@ -17,14 +17,11 @@ interface TypeFactoryInterface { /** * @param class-string $type - * @param array $args * - * @return TypeInterface|null */ public function create(string $type, array $args): ?TypeInterface; /** - * @param \ReflectionType|null $type * * @return class-string|null */ diff --git a/src/Internal/Queue/ArrayQueue.php b/src/Internal/Queue/ArrayQueue.php index abdcb34ae..bfff183d0 100644 --- a/src/Internal/Queue/ArrayQueue.php +++ b/src/Internal/Queue/ArrayQueue.php @@ -25,10 +25,6 @@ class ArrayQueue implements QueueInterface */ public function __construct() {} - /** - * @param int $commandId - * @return CommandInterface|null - */ public function pull(int $commandId): ?CommandInterface { foreach ($this->commands as $i => $command) { @@ -41,10 +37,6 @@ public function pull(int $commandId): ?CommandInterface return null; } - /** - * @param int $commandId - * @return bool - */ public function has(int $commandId): bool { foreach ($this->commands as $command) { @@ -56,9 +48,6 @@ public function has(int $commandId): bool return false; } - /** - * {@inheritDoc} - */ public function getIterator(): \Traversable { while (\count($this->commands)) { @@ -66,17 +55,11 @@ public function getIterator(): \Traversable } } - /** - * {@inheritDoc} - */ public function count(): int { return \count($this->commands); } - /** - * {@inheritDoc} - */ public function push(CommandInterface $command): void { $this->commands[] = $command; diff --git a/src/Internal/Queue/QueueInterface.php b/src/Internal/Queue/QueueInterface.php index 625f05cf7..1de678d7e 100644 --- a/src/Internal/Queue/QueueInterface.php +++ b/src/Internal/Queue/QueueInterface.php @@ -18,20 +18,9 @@ */ interface QueueInterface extends \IteratorAggregate, \Countable { - /** - * @param CommandInterface $command - */ public function push(CommandInterface $command): void; - /** - * @param int $commandId - * @return CommandInterface|null - */ public function pull(int $commandId): ?CommandInterface; - /** - * @param int $commandId - * @return bool - */ public function has(int $commandId): bool; } diff --git a/src/Internal/Repository/ArrayRepository.php b/src/Internal/Repository/ArrayRepository.php index c6e060f9f..1781f6cf1 100644 --- a/src/Internal/Repository/ArrayRepository.php +++ b/src/Internal/Repository/ArrayRepository.php @@ -31,7 +31,6 @@ class ArrayRepository implements RepositoryInterface /** * @param iterable $entries - * @param bool $overwrite */ public function __construct(iterable $entries = [], bool $overwrite = false) { @@ -40,33 +39,21 @@ public function __construct(iterable $entries = [], bool $overwrite = false) } } - /** - * {@inheritDoc} - */ public function filter(callable $filter): RepositoryInterface { return new static(\array_filter($this->entries, $filter)); } - /** - * {@inheritDoc} - */ public function getIterator(): \Traversable { return new \ArrayIterator($this->entries); } - /** - * {@inheritDoc} - */ public function count(): int { return \count($this->entries); } - /** - * {@inheritDoc} - */ public function add(Identifiable $entry, bool $overwrite = false): void { $name = $entry->getID(); @@ -78,25 +65,16 @@ public function add(Identifiable $entry, bool $overwrite = false): void $this->entries[$name] = $entry; } - /** - * {@inheritDoc} - */ public function find($id): ?Identifiable { return $this->entries[$id] ?? null; } - /** - * {@inheritDoc} - */ public function has($id): bool { return isset($this->entries[$id]); } - /** - * {@inheritDoc} - */ public function remove($id): void { unset($this->entries[$id]); diff --git a/src/Internal/Repository/RepositoryInterface.php b/src/Internal/Repository/RepositoryInterface.php index 8259f7d2a..2078d0721 100644 --- a/src/Internal/Repository/RepositoryInterface.php +++ b/src/Internal/Repository/RepositoryInterface.php @@ -31,8 +31,6 @@ public function filter(callable $filter): self; /** * Register a new {@see Identifiable} inside the repository. * - * @param Identifiable $entry - * @param bool $overwrite */ public function add(Identifiable $entry, bool $overwrite = false): void; @@ -51,7 +49,6 @@ public function find($id): ?Identifiable; * otherwise. * * @param Identifier $id - * @return bool */ public function has($id): bool; diff --git a/src/Internal/Support/DateInterval.php b/src/Internal/Support/DateInterval.php index 8c84a154c..fc61b28be 100644 --- a/src/Internal/Support/DateInterval.php +++ b/src/Internal/Support/DateInterval.php @@ -48,7 +48,6 @@ final class DateInterval /** * @param DateIntervalValue $interval * @param DateIntervalFormat $format - * @return CarbonInterval * @psalm-suppress InvalidOperand */ public static function parse($interval, string $format = self::FORMAT_MILLISECONDS): CarbonInterval @@ -114,7 +113,6 @@ public static function parse($interval, string $format = self::FORMAT_MILLISECON /** * @param DateIntervalValue|null $interval * @param DateIntervalFormat $format - * @return CarbonInterval|null */ public static function parseOrNull($interval, string $format = self::FORMAT_MILLISECONDS): ?CarbonInterval { @@ -127,7 +125,6 @@ public static function parseOrNull($interval, string $format = self::FORMAT_MILL /** * @param DateIntervalValue $interval - * @return bool */ public static function assert($interval): bool { @@ -137,7 +134,6 @@ public static function assert($interval): bool } /** - * @param \DateInterval|null $i * @return ($i is null ? null : Duration) */ public static function toDuration(\DateInterval $i = null): ?Duration @@ -154,10 +150,6 @@ public static function toDuration(\DateInterval $i = null): ?Duration return $d; } - /** - * @param string $format - * @return void - */ private static function validateFormat(string $format): void { if (!\in_array($format, self::AVAILABLE_FORMATS, true)) { diff --git a/src/Internal/Support/DateTime.php b/src/Internal/Support/DateTime.php index 14a2f0a25..39b28b918 100644 --- a/src/Internal/Support/DateTime.php +++ b/src/Internal/Support/DateTime.php @@ -63,7 +63,6 @@ public static function parse($time = null, $tz = null, string $class = \DateTime * TODO: This match function can only parse the "Z" timezone, and in the * case of an explicit timezone "+00:00" this case will be ignored. * - * @param string $time * @return null|array{0: string, 1: string} */ private static function extractRfc3339Accuracy(string $time): ?array diff --git a/src/Internal/Support/Diff.php b/src/Internal/Support/Diff.php index caa1233a7..c3d914e71 100644 --- a/src/Internal/Support/Diff.php +++ b/src/Internal/Support/Diff.php @@ -60,9 +60,7 @@ public function __construct(object $context) } /** - * @param object $context * @param non-empty-string|null $property - * @return bool */ public function isPresent(object $context, string $property = null): bool { @@ -70,9 +68,7 @@ public function isPresent(object $context, string $property = null): bool } /** - * @param object $context * @param non-empty-string|null $property - * @return bool */ public function isChanged(object $context, string $property = null): bool { @@ -91,7 +87,6 @@ public function isChanged(object $context, string $property = null): bool } /** - * @param object $context * @return array */ public function getPresentPropertyNames(object $context): array @@ -108,7 +103,6 @@ public function getDefaultProperties(): array } /** - * @param object $context * @return array */ public function getPresentProperties(object $context): array @@ -120,7 +114,6 @@ public function getPresentProperties(object $context): array } /** - * @param object $context * @return array */ public function getChangedPropertyNames(object $context): array @@ -129,7 +122,6 @@ public function getChangedPropertyNames(object $context): array } /** - * @param object $context * @return array */ public function getChangedProperties(object $context): array @@ -164,10 +156,6 @@ private function matchContext(object $context): void } } - /** - * @param object $context - * @return bool - */ private function isChangedAnyProperty(object $context): bool { foreach ($this->properties as $name => $value) { diff --git a/src/Internal/Support/Facade.php b/src/Internal/Support/Facade.php index 6d860bf21..dea6ef857 100644 --- a/src/Internal/Support/Facade.php +++ b/src/Internal/Support/Facade.php @@ -62,7 +62,6 @@ public static function getCurrentContext(): object } /** - * @return int * @throws OutOfContextException */ public static function getContextId(): int @@ -75,8 +74,6 @@ public static function getContextId(): int } /** - * @param string $name - * @param array $arguments * @return mixed */ public static function __callStatic(string $name, array $arguments) diff --git a/src/Internal/Support/Inheritance.php b/src/Internal/Support/Inheritance.php index 132351fb7..7f534968a 100644 --- a/src/Internal/Support/Inheritance.php +++ b/src/Internal/Support/Inheritance.php @@ -16,7 +16,6 @@ class Inheritance /** * @param class-string $haystack * @param class-string $trait - * @return bool */ public static function uses(string $haystack, string $trait): bool { @@ -40,7 +39,6 @@ public static function uses(string $haystack, string $trait): bool /** * @param class-string $haystack * @param class-string $class - * @return bool */ public static function extends(string $haystack, string $class): bool { @@ -67,7 +65,6 @@ public static function extends(string $haystack, string $class): bool * @param class-string $haystack * @param class-string $interface * - * @return bool * @psalm-assert-if-true class-string $haystack */ public static function implements(string $haystack, string $interface): bool diff --git a/src/Internal/Support/Options.php b/src/Internal/Support/Options.php index dc0e1cd6c..56d60da62 100644 --- a/src/Internal/Support/Options.php +++ b/src/Internal/Support/Options.php @@ -15,9 +15,6 @@ abstract class Options { - /** - * @var Diff - */ protected Diff $diff; /** @@ -28,18 +25,12 @@ public function __construct() $this->diff = new Diff($this); } - /** - * @return static - */ #[Pure] public static function new(): static { return new static(); } - /** - * @return array - */ public function __debugInfo(): array { $properties = \get_object_vars($this); diff --git a/src/Internal/Support/Process.php b/src/Internal/Support/Process.php index 9eb0d7222..f08b5038f 100644 --- a/src/Internal/Support/Process.php +++ b/src/Internal/Support/Process.php @@ -21,8 +21,6 @@ class Process /** * Run process with arguments and get result. * - * @param string ...$cmd - * @return string */ public static function run(string ...$cmd): string { diff --git a/src/Internal/Support/Reflection.php b/src/Internal/Support/Reflection.php index 734332ab9..a6ee820a3 100644 --- a/src/Internal/Support/Reflection.php +++ b/src/Internal/Support/Reflection.php @@ -18,7 +18,6 @@ final class Reflection * * @template T * - * @param \ReflectionFunctionAbstract $method * @param array $args * @return list Unnamed list of arguments in the correct order. */ diff --git a/src/Internal/Support/StackRenderer.php b/src/Internal/Support/StackRenderer.php index d503f1001..6cc8ce152 100644 --- a/src/Internal/Support/StackRenderer.php +++ b/src/Internal/Support/StackRenderer.php @@ -16,14 +16,12 @@ class StackRenderer /** * Sets files and prefixes to be ignored from the stack trace. * - * @var array */ private static array $ignorePaths = [ 'temporal/sdk/src/Internal/', ]; /** - * @param array $files * @internal please consult Temporal SDK prior to use of this function. */ public static function setIgnoredPaths(array $files): void @@ -34,8 +32,6 @@ public static function setIgnoredPaths(array $files): void /** * Renders trace in easy to digest form, removes references to internal functionality. * - * @param array $stackTrace - * @return string */ public static function renderTrace(array $stackTrace): string { diff --git a/src/Internal/Transport/ClientInterface.php b/src/Internal/Transport/ClientInterface.php index 338feb75c..4e2ab2a96 100644 --- a/src/Internal/Transport/ClientInterface.php +++ b/src/Internal/Transport/ClientInterface.php @@ -31,21 +31,14 @@ public function send(CommandInterface $request): void; /** * Check if command still in sending queue. * - * @param CommandInterface $command - * @return bool */ public function isQueued(CommandInterface $command): bool; - /** - * @param CommandInterface $command - */ public function cancel(CommandInterface $command): void; /** * Reject pending promise. * - * @param CommandInterface $command - * @param \Throwable $reason */ public function reject(CommandInterface $command, \Throwable $reason): void; } diff --git a/src/Internal/Transport/CompletableResult.php b/src/Internal/Transport/CompletableResult.php index 93a81805f..e260b83bb 100644 --- a/src/Internal/Transport/CompletableResult.php +++ b/src/Internal/Transport/CompletableResult.php @@ -23,9 +23,6 @@ */ class CompletableResult implements CompletableResultInterface { - /** - * @var bool - */ private bool $resolved = false; /** @@ -33,37 +30,18 @@ class CompletableResult implements CompletableResultInterface */ private $value; - /** - * @var WorkflowContextInterface - */ private WorkflowContextInterface $context; - /** - * @var LoopInterface - */ private LoopInterface $loop; - /** - * @var PromiseInterface - */ private PromiseInterface $promise; - /** - * @var Deferred - */ private Deferred $deferred; - /** - * @var string - */ private string $layer; /** * CompletableResult constructor. - * @param WorkflowContextInterface $context - * @param LoopInterface $loop - * @param PromiseInterface $promise - * @param string $layer */ public function __construct( WorkflowContextInterface $context, @@ -82,9 +60,6 @@ public function __construct( ); } - /** - * {@inheritDoc} - */ public function isComplete(): bool { return $this->resolved; @@ -101,9 +76,7 @@ public function getValue() /** * @param (callable(mixed): mixed)|null $onFulfilled * @param (callable(\Throwable): mixed)|null $onRejected - * @param callable|null $onProgress * - * @return PromiseInterface */ public function then( ?callable $onFulfilled = null, @@ -171,9 +144,6 @@ function (): void { ); } - /** - * @param \Throwable $e - */ private function onRejected(\Throwable $e): void { $this->resolved = true; diff --git a/src/Internal/Transport/CompletableResultInterface.php b/src/Internal/Transport/CompletableResultInterface.php index f4ceff288..8b4c8610b 100644 --- a/src/Internal/Transport/CompletableResultInterface.php +++ b/src/Internal/Transport/CompletableResultInterface.php @@ -19,9 +19,6 @@ */ interface CompletableResultInterface extends PromiseInterface { - /** - * @return bool - */ public function isComplete(): bool; /** diff --git a/src/Internal/Transport/Request/Cancel.php b/src/Internal/Transport/Request/Cancel.php index 0dfecbae1..a68ac9d79 100644 --- a/src/Internal/Transport/Request/Cancel.php +++ b/src/Internal/Transport/Request/Cancel.php @@ -25,9 +25,6 @@ final class Cancel extends Request /** @var int[] */ private array $requestIds; - /** - * @param int ...$requestId - */ public function __construct(int ...$requestId) { $this->requestIds = $requestId; diff --git a/src/Internal/Transport/Request/CancelExternalWorkflow.php b/src/Internal/Transport/Request/CancelExternalWorkflow.php index 5189270ac..5864788b7 100644 --- a/src/Internal/Transport/Request/CancelExternalWorkflow.php +++ b/src/Internal/Transport/Request/CancelExternalWorkflow.php @@ -20,11 +20,6 @@ class CancelExternalWorkflow extends Request { public const NAME = 'CancelExternalWorkflow'; - /** - * @param string $namespace - * @param string $workflowId - * @param string|null $runId - */ public function __construct( private string $namespace, private string $workflowId, @@ -39,25 +34,16 @@ public function __construct( parent::__construct(self::NAME, $options, null); } - /** - * @return string - */ public function getNamespace(): string { return $this->namespace; } - /** - * @return string - */ public function getWorkflowId(): string { return $this->workflowId; } - /** - * @return null|string - */ public function getRunId(): ?string { return $this->runId; diff --git a/src/Internal/Transport/Request/CompleteWorkflow.php b/src/Internal/Transport/Request/CompleteWorkflow.php index 920976d1c..16c60cf12 100644 --- a/src/Internal/Transport/Request/CompleteWorkflow.php +++ b/src/Internal/Transport/Request/CompleteWorkflow.php @@ -21,10 +21,6 @@ final class CompleteWorkflow extends Request { public const NAME = 'CompleteWorkflow'; - /** - * @param ValuesInterface $values - * @param \Throwable|null $failure - */ public function __construct(ValuesInterface $values, \Throwable $failure = null) { parent::__construct(self::NAME, [], $values); diff --git a/src/Internal/Transport/Request/ContinueAsNew.php b/src/Internal/Transport/Request/ContinueAsNew.php index aee7d2825..3d8ba7d44 100644 --- a/src/Internal/Transport/Request/ContinueAsNew.php +++ b/src/Internal/Transport/Request/ContinueAsNew.php @@ -29,7 +29,6 @@ final class ContinueAsNew extends Request /** * @param non-empty-string $name - * @param ValuesInterface $input * @param RequestOptions $options */ public function __construct(string $name, ValuesInterface $input, array $options, HeaderInterface $header) diff --git a/src/Internal/Transport/Request/ExecuteActivity.php b/src/Internal/Transport/Request/ExecuteActivity.php index ac4104d14..3b5fd276a 100644 --- a/src/Internal/Transport/Request/ExecuteActivity.php +++ b/src/Internal/Transport/Request/ExecuteActivity.php @@ -31,9 +31,7 @@ final class ExecuteActivity extends Request /** * @param non-empty-string $name Activity name - * @param ValuesInterface $args * @param RequestOptions $options - * @param HeaderInterface $header */ public function __construct(string $name, ValuesInterface $args, array $options, HeaderInterface $header) { diff --git a/src/Internal/Transport/Request/ExecuteChildWorkflow.php b/src/Internal/Transport/Request/ExecuteChildWorkflow.php index 55f713c0a..b04781c47 100644 --- a/src/Internal/Transport/Request/ExecuteChildWorkflow.php +++ b/src/Internal/Transport/Request/ExecuteChildWorkflow.php @@ -29,9 +29,7 @@ final class ExecuteChildWorkflow extends Request /** * @param non-empty-string $name Workflow name - * @param ValuesInterface $input * @param RequestOptions $options - * @param HeaderInterface $header */ public function __construct(string $name, ValuesInterface $input, array $options, HeaderInterface $header) { diff --git a/src/Internal/Transport/Request/ExecuteLocalActivity.php b/src/Internal/Transport/Request/ExecuteLocalActivity.php index 2d5df9b2c..6d906769b 100644 --- a/src/Internal/Transport/Request/ExecuteLocalActivity.php +++ b/src/Internal/Transport/Request/ExecuteLocalActivity.php @@ -31,9 +31,7 @@ final class ExecuteLocalActivity extends Request /** * @param non-empty-string $name Activity name - * @param ValuesInterface $args * @param RequestOptions $options - * @param HeaderInterface $header */ public function __construct(string $name, ValuesInterface $args, array $options, HeaderInterface $header) { diff --git a/src/Internal/Transport/Request/GetChildWorkflowExecution.php b/src/Internal/Transport/Request/GetChildWorkflowExecution.php index d56dea7f7..99616c5a2 100644 --- a/src/Internal/Transport/Request/GetChildWorkflowExecution.php +++ b/src/Internal/Transport/Request/GetChildWorkflowExecution.php @@ -21,9 +21,6 @@ final class GetChildWorkflowExecution extends Request /** @see ParentClosePolicy */ private int $parentClosePolicy; - /** - * @param ExecuteChildWorkflow $execution - */ public function __construct(ExecuteChildWorkflow $execution) { $this->parentClosePolicy = $execution->getOptions()['options']['ParentClosePolicy'] ?? ParentClosePolicy::POLICY_UNSPECIFIED; diff --git a/src/Internal/Transport/Request/GetVersion.php b/src/Internal/Transport/Request/GetVersion.php index 8bf4ddaef..a3a554adc 100644 --- a/src/Internal/Transport/Request/GetVersion.php +++ b/src/Internal/Transport/Request/GetVersion.php @@ -18,7 +18,6 @@ final class GetVersion extends Request public const NAME = 'GetVersion'; /** - * @param string $changeId * @param positive-int $minSupported * @param positive-int $maxSupported */ @@ -37,25 +36,16 @@ public function __construct( ); } - /** - * @return string - */ public function getChangeId(): string { return $this->changeId; } - /** - * @return int - */ public function getMinSupported(): int { return $this->minSupported; } - /** - * @return int - */ public function getMaxSupported(): int { return $this->maxSupported; diff --git a/src/Internal/Transport/Request/NewTimer.php b/src/Internal/Transport/Request/NewTimer.php index 1cafcaa02..077a4d0eb 100644 --- a/src/Internal/Transport/Request/NewTimer.php +++ b/src/Internal/Transport/Request/NewTimer.php @@ -21,17 +21,11 @@ final class NewTimer extends Request { public const NAME = 'NewTimer'; - /** - * @param \DateInterval $interval - */ public function __construct(private \DateInterval $interval) { parent::__construct(self::NAME, ['ms' => (int) CarbonInterval::make($interval)->totalMilliseconds]); } - /** - * @return \DateInterval - */ public function getInterval(): \DateInterval { return $this->interval; diff --git a/src/Internal/Transport/Request/Panic.php b/src/Internal/Transport/Request/Panic.php index b06711e68..6cf2e3a4d 100644 --- a/src/Internal/Transport/Request/Panic.php +++ b/src/Internal/Transport/Request/Panic.php @@ -20,9 +20,6 @@ final class Panic extends Request { public const NAME = 'Panic'; - /** - * @param \Throwable|null $failure - */ public function __construct(\Throwable $failure = null) { parent::__construct(self::NAME, [], null); diff --git a/src/Internal/Transport/Request/SideEffect.php b/src/Internal/Transport/Request/SideEffect.php index 4c53ec4ac..07c9cf97f 100644 --- a/src/Internal/Transport/Request/SideEffect.php +++ b/src/Internal/Transport/Request/SideEffect.php @@ -18,9 +18,6 @@ final class SideEffect extends Request { public const NAME = 'SideEffect'; - /** - * @param ValuesInterface $values - */ public function __construct(ValuesInterface $values) { parent::__construct(self::NAME, [], $values); diff --git a/src/Internal/Transport/Request/SignalExternalWorkflow.php b/src/Internal/Transport/Request/SignalExternalWorkflow.php index a2f3f6aa3..a00101b0a 100644 --- a/src/Internal/Transport/Request/SignalExternalWorkflow.php +++ b/src/Internal/Transport/Request/SignalExternalWorkflow.php @@ -21,14 +21,6 @@ final class SignalExternalWorkflow extends Request { public const NAME = 'SignalExternalWorkflow'; - /** - * @param string $namespace - * @param string $workflowId - * @param string|null $runId - * @param string $signal - * @param ValuesInterface|null $input - * @param bool $childWorkflowOnly - */ public function __construct( string $namespace, string $workflowId, diff --git a/src/Internal/Transport/Router.php b/src/Internal/Transport/Router.php index 64b421362..4fdef1fc5 100644 --- a/src/Internal/Transport/Router.php +++ b/src/Internal/Transport/Router.php @@ -35,9 +35,6 @@ final class Router implements RouterInterface */ private array $routes = []; - /** - * {@inheritDoc} - */ public function add(RouteInterface $route, bool $overwrite = false): void { if ($overwrite === false && isset($this->routes[$route->getName()])) { @@ -47,26 +44,16 @@ public function add(RouteInterface $route, bool $overwrite = false): void $this->routes[$route->getName()] = $route; } - /** - * {@inheritDoc} - */ public function remove(ServerRequestInterface $route): void { unset($this->routes[$route->getName()]); } - /** - * @param ServerRequestInterface $request - * @return RouteInterface|null - */ public function match(ServerRequestInterface $request): ?RouteInterface { return $this->routes[$request->getName()] ?? null; } - /** - * {@inheritDoc} - */ public function dispatch(ServerRequestInterface $request, array $headers = []): PromiseInterface { // assert($request instanceof ServerRequestInterface); diff --git a/src/Internal/Transport/Router/CancelWorkflow.php b/src/Internal/Transport/Router/CancelWorkflow.php index a2694e365..61d77b9cf 100644 --- a/src/Internal/Transport/Router/CancelWorkflow.php +++ b/src/Internal/Transport/Router/CancelWorkflow.php @@ -23,9 +23,6 @@ class CancelWorkflow extends WorkflowProcessAwareRoute */ private const ERROR_PROCESS_NOT_DEFINED = 'Unable to cancel workflow because workflow process #%s was not found'; - /** - * {@inheritDoc} - */ public function handle(ServerRequestInterface $request, array $headers, Deferred $resolver): void { $this->cancel($request->getID()); @@ -33,10 +30,6 @@ public function handle(ServerRequestInterface $request, array $headers, Deferred $resolver->resolve(EncodedValues::fromValues([null])); } - /** - * @param string $runId - * @return array - */ public function cancel(string $runId): array { /** @var Process $process */ diff --git a/src/Internal/Transport/Router/DestroyWorkflow.php b/src/Internal/Transport/Router/DestroyWorkflow.php index 538b5d5d2..6d5d804ad 100644 --- a/src/Internal/Transport/Router/DestroyWorkflow.php +++ b/src/Internal/Transport/Router/DestroyWorkflow.php @@ -38,9 +38,6 @@ public function __construct( parent::__construct($running); } - /** - * {@inheritDoc} - */ public function handle(ServerRequestInterface $request, array $headers, Deferred $resolver): void { $this->kill($request->getID()); @@ -48,10 +45,6 @@ public function handle(ServerRequestInterface $request, array $headers, Deferred $resolver->resolve(EncodedValues::fromValues([null])); } - /** - * @param string $runId - * @return array - */ public function kill(string $runId): array { /** @var Process $process */ diff --git a/src/Internal/Transport/Router/GetWorkerInfo.php b/src/Internal/Transport/Router/GetWorkerInfo.php index a3556de8b..ca26fbcc7 100644 --- a/src/Internal/Transport/Router/GetWorkerInfo.php +++ b/src/Internal/Transport/Router/GetWorkerInfo.php @@ -23,29 +23,16 @@ final class GetWorkerInfo extends Route { - /** - * @var RepositoryInterface - */ private RepositoryInterface $queues; - /** - * @var MarshallerInterface - */ private MarshallerInterface $marshaller; - /** - * @param RepositoryInterface $queues - * @param MarshallerInterface $marshaller - */ public function __construct(RepositoryInterface $queues, MarshallerInterface $marshaller) { $this->queues = $queues; $this->marshaller = $marshaller; } - /** - * {@inheritDoc} - */ public function handle(ServerRequestInterface $request, array $headers, Deferred $resolver): void { $result = []; @@ -57,10 +44,6 @@ public function handle(ServerRequestInterface $request, array $headers, Deferred $resolver->resolve(EncodedValues::fromValues($result)); } - /** - * @param WorkerInterface $worker - * @return array - */ private function workerToArray(WorkerInterface $worker): array { $workflowMap = static fn(WorkflowPrototype $workflow): array => [ @@ -86,11 +69,6 @@ private function workerToArray(WorkerInterface $worker): array ]; } - /** - * @param iterable $items - * @param \Closure $map - * @return array - */ private function map(iterable $items, \Closure $map): array { $result = []; diff --git a/src/Internal/Transport/Router/InvokeActivity.php b/src/Internal/Transport/Router/InvokeActivity.php index 7d6e8056e..413ff0dee 100644 --- a/src/Internal/Transport/Router/InvokeActivity.php +++ b/src/Internal/Transport/Router/InvokeActivity.php @@ -36,11 +36,6 @@ class InvokeActivity extends Route private RPCConnectionInterface $rpc; private PipelineProvider $interceptorProvider; - /** - * @param ServiceContainer $services - * @param RPCConnectionInterface $rpc - * @param PipelineProvider $interceptorProvider - */ public function __construct( ServiceContainer $services, RPCConnectionInterface $rpc, @@ -51,9 +46,6 @@ public function __construct( $this->interceptorProvider = $interceptorProvider; } - /** - * {@inheritDoc} - */ public function handle(ServerRequestInterface $request, array $headers, Deferred $resolver): void { $options = $request->getOptions(); @@ -121,10 +113,6 @@ static function (ActivityInput $input) use ($handler, $context): mixed { } } - /** - * @param ActivityInfo $info - * @return ActivityPrototype - */ private function findDeclarationOrFail(ActivityInfo $info): ActivityPrototype { $activity = $this->services->activities->find($info->type->name); diff --git a/src/Internal/Transport/Router/InvokeQuery.php b/src/Internal/Transport/Router/InvokeQuery.php index 87a1fc8dc..17e117fb2 100644 --- a/src/Internal/Transport/Router/InvokeQuery.php +++ b/src/Internal/Transport/Router/InvokeQuery.php @@ -28,15 +28,8 @@ final class InvokeQuery extends WorkflowProcessAwareRoute */ private const ERROR_QUERY_NOT_FOUND = 'unknown queryType %s. KnownQueryTypes=[%s]'; - /** - * @var LoopInterface - */ private LoopInterface $loop; - /** - * @param RepositoryInterface $running - * @param LoopInterface $loop - */ #[Pure] public function __construct( RepositoryInterface $running, @@ -47,9 +40,6 @@ public function __construct( parent::__construct($running); } - /** - * {@inheritDoc} - */ public function handle(ServerRequestInterface $request, array $headers, Deferred $resolver): void { /** @var non-empty-string $name */ @@ -85,7 +75,6 @@ static function () use ($name, $request, $resolver, $handler, $context, $headers } /** - * @param WorkflowInstanceInterface $instance * @param non-empty-string $name * @return \Closure(QueryInput): mixed */ diff --git a/src/Internal/Transport/Router/InvokeSignal.php b/src/Internal/Transport/Router/InvokeSignal.php index 8a333a5e6..e0b598d16 100644 --- a/src/Internal/Transport/Router/InvokeSignal.php +++ b/src/Internal/Transport/Router/InvokeSignal.php @@ -17,9 +17,6 @@ final class InvokeSignal extends WorkflowProcessAwareRoute { - /** - * {@inheritDoc} - */ public function handle(ServerRequestInterface $request, array $headers, Deferred $resolver): void { $instance = $this->findInstanceOrFail($request->getID()); diff --git a/src/Internal/Transport/Router/InvokeUpdate.php b/src/Internal/Transport/Router/InvokeUpdate.php index b7282cd25..867747904 100644 --- a/src/Internal/Transport/Router/InvokeUpdate.php +++ b/src/Internal/Transport/Router/InvokeUpdate.php @@ -23,9 +23,6 @@ final class InvokeUpdate extends WorkflowProcessAwareRoute { private const ERROR_HANDLER_NOT_FOUND = 'unknown update method %s. KnownUpdateNames=[%s]'; - /** - * {@inheritDoc} - */ public function handle(ServerRequestInterface $request, array $headers, Deferred $resolver): void { $process = $this->findProcessOrFail($request->getID()); diff --git a/src/Internal/Transport/Router/StackTrace.php b/src/Internal/Transport/Router/StackTrace.php index b66f76e48..7c305c4aa 100644 --- a/src/Internal/Transport/Router/StackTrace.php +++ b/src/Internal/Transport/Router/StackTrace.php @@ -17,9 +17,6 @@ final class StackTrace extends WorkflowProcessAwareRoute { - /** - * {@inheritDoc} - */ public function handle(ServerRequestInterface $request, array $headers, Deferred $resolver): void { $process = $this->findProcessOrFail($request->getID()); diff --git a/src/Internal/Transport/RouterInterface.php b/src/Internal/Transport/RouterInterface.php index 1a732afe4..223f2fbf8 100644 --- a/src/Internal/Transport/RouterInterface.php +++ b/src/Internal/Transport/RouterInterface.php @@ -17,20 +17,9 @@ interface RouterInterface extends DispatcherInterface { - /** - * @param RouteInterface $route - * @param bool $overwrite - */ public function add(RouteInterface $route, bool $overwrite = false): void; - /** - * @param ServerRequestInterface $route - */ public function remove(ServerRequestInterface $route): void; - /** - * @param ServerRequestInterface $request - * @return RouteInterface|null - */ public function match(ServerRequestInterface $request): ?RouteInterface; } diff --git a/src/Internal/Transport/Server.php b/src/Internal/Transport/Server.php index b8a3e401a..9926f9fec 100644 --- a/src/Internal/Transport/Server.php +++ b/src/Internal/Transport/Server.php @@ -35,8 +35,6 @@ final class Server implements ServerInterface /** * @psalm-param OnMessageHandler $onMessage - * @param QueueInterface $queue - * @param callable $onMessage */ public function __construct(QueueInterface $queue, callable $onMessage) { @@ -45,9 +43,6 @@ public function __construct(QueueInterface $queue, callable $onMessage) $this->onMessage($onMessage); } - /** - * {@inheritDoc} - */ public function onMessage(callable $then): void { $this->onMessage = $then(...); @@ -55,7 +50,6 @@ public function onMessage(callable $then): void /** * @param RequestInterface $request - * @param array $headers */ public function dispatch(ServerRequestInterface $request, array $headers): void { diff --git a/src/Internal/Transport/ServerInterface.php b/src/Internal/Transport/ServerInterface.php index fce538c8c..0d1dad707 100644 --- a/src/Internal/Transport/ServerInterface.php +++ b/src/Internal/Transport/ServerInterface.php @@ -24,7 +24,6 @@ interface ServerInterface { /** * @psalm-param OnMessageHandler $then - * @param callable $then */ public function onMessage(callable $then): void; } diff --git a/src/Internal/Workflow/ActivityProxy.php b/src/Internal/Workflow/ActivityProxy.php index c529dfca4..e275bca6c 100644 --- a/src/Internal/Workflow/ActivityProxy.php +++ b/src/Internal/Workflow/ActivityProxy.php @@ -35,26 +35,14 @@ final class ActivityProxy extends Proxy */ private array $activities; - /** - * @var string - */ private string $class; - /** - * @var ActivityOptionsInterface - */ private ActivityOptionsInterface $options; - /** - * @var WorkflowContextInterface - */ private WorkflowContextInterface $ctx; /** - * @param string $class * @param array $activities - * @param ActivityOptionsInterface $options - * @param WorkflowContextInterface $ctx * @param Pipeline $callsInterceptor */ public function __construct( @@ -71,8 +59,6 @@ public function __construct( } /** - * @param string $method - * @param array $args * @return CompletableResultInterface */ public function __call(string $method, array $args = []): PromiseInterface @@ -119,10 +105,6 @@ public function __call(string $method, array $args = []): PromiseInterface ); } - /** - * @param string $name - * @return ActivityPrototype - */ private function findPrototypeByHandlerNameOrFail(string $name): ActivityPrototype { $prototype = $this->findPrototypeByHandlerName($this->activities, $name); diff --git a/src/Internal/Workflow/ActivityStub.php b/src/Internal/Workflow/ActivityStub.php index 09d3e5a17..2c462f5a6 100644 --- a/src/Internal/Workflow/ActivityStub.php +++ b/src/Internal/Workflow/ActivityStub.php @@ -34,8 +34,6 @@ final class ActivityStub implements ActivityStubInterface /** * @param MarshallerInterface $marshaller - * @param ActivityOptionsInterface $options - * @param HeaderInterface|array $header */ public function __construct( MarshallerInterface $marshaller, @@ -47,25 +45,16 @@ public function __construct( $this->header = \is_array($header) ? Header::fromValues($header) : $header; } - /** - * {@inheritDoc} - */ public function getOptions(): ActivityOptionsInterface { return $this->options; } - /** - * @return array - */ public function getOptionsArray(): array { return $this->marshaller->marshal($this->getOptions()); } - /** - * {@inheritDoc} - */ public function execute( string $name, array $args = [], @@ -79,10 +68,6 @@ public function execute( return EncodedValues::decodePromise($this->request($request), $returnType); } - /** - * @param RequestInterface $request - * @return PromiseInterface - */ protected function request(RequestInterface $request): PromiseInterface { /** @var Workflow\WorkflowContextInterface $context */ diff --git a/src/Internal/Workflow/ChildWorkflowProxy.php b/src/Internal/Workflow/ChildWorkflowProxy.php index 4410db93e..04ac4dc47 100644 --- a/src/Internal/Workflow/ChildWorkflowProxy.php +++ b/src/Internal/Workflow/ChildWorkflowProxy.php @@ -44,7 +44,6 @@ public function __construct( /** * @param non-empty-string $method - * @param array $args * @return CompletableResultInterface */ public function __call(string $method, array $args): PromiseInterface @@ -102,10 +101,6 @@ public function __call(string $method, array $args): PromiseInterface ); } - /** - * @param WorkflowPrototype $prototype - * @return Type|null - */ private function resolveReturnType(WorkflowPrototype $prototype): ?Type { if ($attribute = $prototype->getReturnType()) { diff --git a/src/Internal/Workflow/ChildWorkflowStub.php b/src/Internal/Workflow/ChildWorkflowStub.php index c8733bf4f..36514ec51 100644 --- a/src/Internal/Workflow/ChildWorkflowStub.php +++ b/src/Internal/Workflow/ChildWorkflowStub.php @@ -36,9 +36,6 @@ final class ChildWorkflowStub implements ChildWorkflowStubInterface /** * @param MarshallerInterface $marshaller - * @param string $workflow - * @param ChildWorkflowOptions $options - * @param HeaderInterface|array $header */ public function __construct( private readonly MarshallerInterface $marshaller, @@ -50,17 +47,11 @@ public function __construct( $this->header = \is_array($header) ? Header::fromValues($header) : $header; } - /** - * @return string - */ public function getChildWorkflowType(): string { return $this->workflow; } - /** - * @return PromiseInterface - */ public function getExecution(): PromiseInterface { return $this->execution->promise(); @@ -99,25 +90,16 @@ public function getResult($returnType = null): PromiseInterface return EncodedValues::decodePromise($this->result, $returnType); } - /** - * {@inheritDoc} - */ public function execute(array $args = [], $returnType = null): PromiseInterface { return $this->start(...$args)->then(fn() => $this->getResult($returnType)); } - /** - * @return ChildWorkflowOptions - */ public function getOptions(): ChildWorkflowOptions { return $this->options; } - /** - * {@inheritDoc} - */ public function signal(string $name, array $args = []): PromiseInterface { return $this->execution->promise()->then( @@ -136,10 +118,6 @@ function (WorkflowExecution $execution) use ($name, $args) { ); } - /** - * @param RequestInterface $request - * @return PromiseInterface - */ protected function request(RequestInterface $request): PromiseInterface { /** @var Workflow\WorkflowContextInterface $context */ @@ -148,9 +126,6 @@ protected function request(RequestInterface $request): PromiseInterface return $context->request($request); } - /** - * @return array - */ private function getOptionArray(): array { return $this->marshaller->marshal($this->getOptions()); diff --git a/src/Internal/Workflow/ContinueAsNewProxy.php b/src/Internal/Workflow/ContinueAsNewProxy.php index 3c3949936..3d02d353d 100644 --- a/src/Internal/Workflow/ContinueAsNewProxy.php +++ b/src/Internal/Workflow/ContinueAsNewProxy.php @@ -31,37 +31,16 @@ class ContinueAsNewProxy extends Proxy private const ERROR_ALREADY_CONTINUED = 'Workflow "%s" has already been called within this "continue as new" stub'; - /** - * @var string - */ private string $class; - /** - * @var WorkflowPrototype - */ private WorkflowPrototype $workflow; - /** - * @var ContinueAsNewOptions - */ private ContinueAsNewOptions $options; - /** - * @var WorkflowContextInterface - */ private WorkflowContextInterface $context; - /** - * @var bool - */ private bool $isContinued = false; - /** - * @param string $class - * @param WorkflowPrototype $workflow - * @param ContinueAsNewOptions $options - * @param WorkflowContextInterface $context - */ public function __construct( string $class, WorkflowPrototype $workflow, @@ -75,8 +54,6 @@ public function __construct( } /** - * @param string $method - * @param array $args * @return PromiseInterface */ public function __call(string $method, array $args) @@ -104,9 +81,6 @@ public function __call(string $method, array $args) return $this->context->continueAsNew($this->workflow->getID(), $args, $this->options); } - /** - * @return bool - */ private function isContinued(): bool { return $this->isContinued; diff --git a/src/Internal/Workflow/ExternalWorkflowProxy.php b/src/Internal/Workflow/ExternalWorkflowProxy.php index 91f511c8e..0c250af43 100644 --- a/src/Internal/Workflow/ExternalWorkflowProxy.php +++ b/src/Internal/Workflow/ExternalWorkflowProxy.php @@ -31,20 +31,12 @@ class ExternalWorkflowProxy extends Proxy */ private string $class; - /** - * @var WorkflowPrototype - */ private WorkflowPrototype $workflow; - /** - * @var ExternalWorkflowStubInterface - */ private ExternalWorkflowStubInterface $stub; /** * @param class-string $class - * @param WorkflowPrototype $workflow - * @param ExternalWorkflowStubInterface $stub */ public function __construct(string $class, WorkflowPrototype $workflow, ExternalWorkflowStubInterface $stub) { @@ -53,11 +45,6 @@ public function __construct(string $class, WorkflowPrototype $workflow, External $this->stub = $stub; } - /** - * @param string $method - * @param array $args - * @return PromiseInterface - */ public function __call(string $method, array $args): PromiseInterface { foreach ($this->workflow->getSignalHandlers() as $name => $definition) { diff --git a/src/Internal/Workflow/ExternalWorkflowStub.php b/src/Internal/Workflow/ExternalWorkflowStub.php index a8d3af5a3..9f047fb7f 100644 --- a/src/Internal/Workflow/ExternalWorkflowStub.php +++ b/src/Internal/Workflow/ExternalWorkflowStub.php @@ -27,7 +27,6 @@ final class ExternalWorkflowStub implements ExternalWorkflowStubInterface { /** - * @param WorkflowExecution $execution * @param Pipeline $callsInterceptor */ public function __construct( @@ -35,17 +34,11 @@ public function __construct( private Pipeline $callsInterceptor, ) {} - /** - * {@inheritDoc} - */ public function getExecution(): WorkflowExecution { return $this->execution; } - /** - * {@inheritDoc} - */ public function signal(string $name, array $args = []): PromiseInterface { return $this->callsInterceptor->with( @@ -71,9 +64,6 @@ public function signal(string $name, array $args = []): PromiseInterface )); } - /** - * {@inheritDoc} - */ public function cancel(): PromiseInterface { return $this->callsInterceptor->with( @@ -84,10 +74,6 @@ public function cancel(): PromiseInterface )(new CancelExternalWorkflowInput('', $this->execution->getID(), $this->execution->getRunID())); } - /** - * @param RequestInterface $request - * @return PromiseInterface - */ private function request(RequestInterface $request): PromiseInterface { // todo intercept diff --git a/src/Internal/Workflow/Input.php b/src/Internal/Workflow/Input.php index ee58a36dc..89e930f92 100644 --- a/src/Internal/Workflow/Input.php +++ b/src/Internal/Workflow/Input.php @@ -23,7 +23,6 @@ final class Input { /** - * @var WorkflowInfo * @psalm-readonly */ #[Marshal(name: 'info')] @@ -31,7 +30,6 @@ final class Input public WorkflowInfo $info; /** - * @var ValuesInterface * @psalm-readonly */ #[Immutable] @@ -43,10 +41,6 @@ final class Input #[Immutable] public Header $header; - /** - * @param WorkflowInfo|null $info - * @param ValuesInterface|null $args - */ public function __construct(WorkflowInfo $info = null, ValuesInterface $args = null, HeaderInterface $header = null) { $this->info = $info ?? new WorkflowInfo(); diff --git a/src/Internal/Workflow/Process/Scope.php b/src/Internal/Workflow/Process/Scope.php index f36f2aeff..f2518f417 100644 --- a/src/Internal/Workflow/Process/Scope.php +++ b/src/Internal/Workflow/Process/Scope.php @@ -39,28 +39,20 @@ */ class Scope implements CancellationScopeInterface, Destroyable { - /** - * @var ServiceContainer - */ protected ServiceContainer $services; /** * Workflow context. * - * @var WorkflowContext */ protected WorkflowContext $context; /** * Coroutine scope context. * - * @var ScopeContext */ protected ScopeContext $scopeContext; - /** - * @var Deferred - */ protected Deferred $deferred; /** @@ -174,7 +166,6 @@ function (\Throwable $error) use ($resolver): void { } /** - * @param callable $handler * @param non-empty-string $name */ public function startSignal(callable $handler, ValuesInterface $values, string $name): void @@ -218,9 +209,6 @@ public function onClose(callable $then): self return $this; } - /** - * @param \Throwable|null $reason - */ public function cancel(\Throwable $reason = null): void { if ($this->detached && !$reason instanceof DestructMemorizedInstanceException) { @@ -287,7 +275,6 @@ public function always(callable $onFulfilledOrRejected): PromiseInterface /** * Connects promise to scope context to be cancelled on promise cancel. * - * @param Deferred $deferred */ public function onAwait(Deferred $deferred): void { @@ -368,10 +355,6 @@ protected function callSignalOrUpdateHandler(callable $handler, ValuesInterface }, $values)->catch($this->onException(...)); } - /** - * @param RequestInterface $request - * @param PromiseInterface $promise - */ protected function onRequest(RequestInterface $request, PromiseInterface $promise): void { $this->onCancel[++$this->cancelID] = function (?\Throwable $reason = null) use ($request): void { @@ -402,17 +385,11 @@ protected function onRequest(RequestInterface $request, PromiseInterface $promis $promise->then($cleanup, $cleanup); } - /** - * @return void - */ protected function makeCurrent(): void { Workflow::setCurrentContext($this->scopeContext); } - /** - * @return void - */ protected function next(): void { $this->makeCurrent(); @@ -519,9 +496,6 @@ private function handleError(\Throwable $e): void $this->next(); } - /** - * @param \Throwable $e - */ private function onException(\Throwable $e): void { $this->deferred->reject($e); @@ -534,9 +508,6 @@ private function onException(\Throwable $e): void } } - /** - * @param mixed $result - */ private function onResult(mixed $result): void { $this->deferred->resolve($result); diff --git a/src/Internal/Workflow/ProcessCollection.php b/src/Internal/Workflow/ProcessCollection.php index 344ab782a..3727f0e90 100644 --- a/src/Internal/Workflow/ProcessCollection.php +++ b/src/Internal/Workflow/ProcessCollection.php @@ -22,9 +22,7 @@ class ProcessCollection extends ArrayRepository private const ERROR_PROCESS_NOT_FOUND = 'Process #%s not found.'; /** - * @param string $runId * @param non-empty-string|null $error Error message if the process was not found. - * @return Process */ public function pull(string $runId, ?string $error = null): Process { diff --git a/src/Internal/Workflow/Proxy.php b/src/Internal/Workflow/Proxy.php index fbdedae85..bb3aef8e8 100644 --- a/src/Internal/Workflow/Proxy.php +++ b/src/Internal/Workflow/Proxy.php @@ -15,17 +15,12 @@ abstract class Proxy { - /** - * @param string $method - * @param array $args - */ abstract public function __call(string $method, array $args); /** * @psalm-template T of Prototype * * @param array $prototypes - * @param string $name * @return T|null */ protected function findPrototypeByHandlerName(array $prototypes, string $name): ?Prototype diff --git a/src/Internal/Workflow/WorkflowContext.php b/src/Internal/Workflow/WorkflowContext.php index 2d3e0136a..da1ba74cf 100644 --- a/src/Internal/Workflow/WorkflowContext.php +++ b/src/Internal/Workflow/WorkflowContext.php @@ -102,49 +102,31 @@ public function __construct( ->getPipeline(WorkflowOutboundCallsInterceptor::class); } - /** - * @return WorkflowInstanceInterface - */ public function getWorkflowInstance(): WorkflowInstanceInterface { return $this->workflowInstance; } - /** - * {@inheritDoc} - */ public function now(): \DateTimeInterface { return $this->services->env->now(); } - /** - * @return string - */ public function getRunId(): string { return $this->input->info->execution->getRunID(); } - /** - * {@inheritDoc} - */ public function getInfo(): WorkflowInfo { return $this->input->info; } - /** - * @inheritDoc - */ public function getHeader(): HeaderInterface { return $this->input->header; } - /** - * {@inheritDoc} - */ public function getInput(): ValuesInterface { return $this->input->input; @@ -159,9 +141,6 @@ public function withInput(Input $input): static return $clone; } - /** - * @return ValuesInterface|null - */ public function getLastCompletionResultValues(): ?ValuesInterface { return $this->lastCompletionResult; @@ -182,17 +161,11 @@ public function getLastCompletionResult($type = null) return $this->lastCompletionResult->getValue(0, $type); } - /** - * @return ClientInterface - */ public function getClient(): ClientInterface { return $this->client; } - /** - * {@inheritDoc} - */ public function registerQuery(string $queryType, callable $handler): WorkflowContextInterface { $this->getWorkflowInstance()->addQueryHandler($queryType, $handler); @@ -200,9 +173,6 @@ public function registerQuery(string $queryType, callable $handler): WorkflowCon return $this; } - /** - * {@inheritDoc} - */ public function registerSignal(string $queryType, callable $handler): WorkflowContextInterface { $this->getWorkflowInstance()->addSignalHandler($queryType, $handler); @@ -210,9 +180,6 @@ public function registerSignal(string $queryType, callable $handler): WorkflowCo return $this; } - /** - * {@inheritDoc} - */ public function registerUpdate(string $name, callable $handler, ?callable $validator): static { $this->getWorkflowInstance()->addUpdateHandler($name, $handler); @@ -221,9 +188,6 @@ public function registerUpdate(string $name, callable $handler, ?callable $valid return $this; } - /** - * {@inheritDoc} - */ public function getVersion(string $changeId, int $minSupported, int $maxSupported): PromiseInterface { return $this->callsInterceptor->with( @@ -236,9 +200,6 @@ public function getVersion(string $changeId, int $minSupported, int $maxSupporte )(new GetVersionInput($changeId, $minSupported, $maxSupported)); } - /** - * {@inheritDoc} - */ public function sideEffect(callable $context): PromiseInterface { $value = null; @@ -270,17 +231,11 @@ public function sideEffect(callable $context): PromiseInterface return $last(); } - /** - * {@inheritDoc} - */ public function isReplaying(): bool { return $this->services->env->isReplaying(); } - /** - * {@inheritDoc} - */ public function complete(array $result = null, \Throwable $failure = null): PromiseInterface { if ($failure !== null) { @@ -300,9 +255,6 @@ function (CompleteInput $input): PromiseInterface { )(new CompleteInput($result, $failure)); } - /** - * {@inheritDoc} - */ public function panic(\Throwable $failure = null): PromiseInterface { return $this->callsInterceptor->with( @@ -312,9 +264,6 @@ public function panic(\Throwable $failure = null): PromiseInterface )(new PanicInput($failure)); } - /** - * {@inheritDoc} - */ public function continueAsNew( string $type, array $args = [], @@ -339,9 +288,6 @@ function (ContinueAsNewInput $input): PromiseInterface { )(new ContinueAsNewInput($type, $args, $options)); } - /** - * {@inheritDoc} - */ public function newContinueAsNewStub(string $class, ContinueAsNewOptions $options = null): object { $options ??= new ContinueAsNewOptions(); @@ -351,17 +297,11 @@ public function newContinueAsNewStub(string $class, ContinueAsNewOptions $option return new ContinueAsNewProxy($class, $workflow, $options, $this); } - /** - * @return bool - */ public function isContinuedAsNew(): bool { return $this->continueAsNew; } - /** - * {@inheritDoc} - */ public function executeChildWorkflow( string $type, array $args = [], @@ -377,9 +317,6 @@ public function executeChildWorkflow( )(new ExecuteChildWorkflowInput($type, $args, $options, $returnType)); } - /** - * {@inheritDoc} - */ public function newUntypedChildWorkflowStub( string $type, ChildWorkflowOptions $options = null, @@ -389,9 +326,6 @@ public function newUntypedChildWorkflowStub( return new ChildWorkflowStub($this->services->marshaller, $type, $options, $this->getHeader()); } - /** - * {@inheritDoc} - */ public function newChildWorkflowStub( string $class, ChildWorkflowOptions $options = null, @@ -408,9 +342,6 @@ public function newChildWorkflowStub( ); } - /** - * {@inheritDoc} - */ public function newExternalWorkflowStub(string $class, WorkflowExecution $execution): object { $workflow = $this->services->workflowsReader->fromClass($class); @@ -420,17 +351,11 @@ public function newExternalWorkflowStub(string $class, WorkflowExecution $execut return new ExternalWorkflowProxy($class, $workflow, $stub); } - /** - * {@inheritDoc} - */ public function newUntypedExternalWorkflowStub(WorkflowExecution $execution): ExternalWorkflowStubInterface { return new ExternalWorkflowStub($execution, $this->callsInterceptor); } - /** - * {@inheritDoc} - */ public function executeActivity( string $type, array $args = [], @@ -456,9 +381,6 @@ public function executeActivity( )(new ExecuteActivityInput($type, $args, $options, $returnType)); } - /** - * {@inheritDoc} - */ public function newUntypedActivityStub( ActivityOptionsInterface $options = null, ): ActivityStubInterface { @@ -467,9 +389,6 @@ public function newUntypedActivityStub( return new ActivityStub($this->services->marshaller, $options, $this->getHeader()); } - /** - * {@inheritDoc} - */ public function newActivityStub( string $class, ActivityOptionsInterface $options = null, @@ -489,9 +408,6 @@ public function newActivityStub( ); } - /** - * {@inheritDoc} - */ public function timer($interval): PromiseInterface { $dateInterval = DateInterval::parse($interval, DateInterval::FORMAT_SECONDS); @@ -503,9 +419,6 @@ public function timer($interval): PromiseInterface )(new TimerInput($dateInterval)); } - /** - * {@inheritDoc} - */ public function request(RequestInterface $request, bool $cancellable = true): PromiseInterface { $this->recordTrace(); @@ -520,25 +433,16 @@ function (RequestInterface $request): PromiseInterface { )($request); } - /** - * {@inheritDoc} - */ public function getStackTrace(): string { return StackRenderer::renderTrace($this->trace); } - /** - * {@inheritDoc} - */ public function allHandlersFinished(): bool { return !$this->handlers->hasRunningHandlers(); } - /** - * {@inheritDoc} - */ public function upsertSearchAttributes(array $searchAttributes): void { $this->callsInterceptor->with( @@ -549,9 +453,6 @@ public function upsertSearchAttributes(array $searchAttributes): void )(new UpsertSearchAttributesInput($searchAttributes)); } - /** - * {@inheritDoc} - */ public function await(...$conditions): PromiseInterface { return $this->callsInterceptor->with( @@ -561,9 +462,6 @@ public function await(...$conditions): PromiseInterface )(new AwaitInput($conditions)); } - /** - * {@inheritDoc} - */ public function awaitWithTimeout($interval, ...$conditions): PromiseInterface { $intervalObject = DateInterval::parse($interval, DateInterval::FORMAT_SECONDS); @@ -617,25 +515,16 @@ public function rejectConditionGroup(string $conditionGroupId): void unset($this->awaits[$conditionGroupId]); } - /** - * {@inheritDoc} - */ public function uuid(): PromiseInterface { return $this->sideEffect(static fn(): UuidInterface => \Ramsey\Uuid\Uuid::uuid4()); } - /** - * {@inheritDoc} - */ public function uuid4(): PromiseInterface { return $this->sideEffect(static fn(): UuidInterface => \Ramsey\Uuid\Uuid::uuid4()); } - /** - * {@inheritDoc} - */ public function uuid7(?\DateTimeInterface $dateTime = null): PromiseInterface { return $this->sideEffect(static fn(): UuidInterface => \Ramsey\Uuid\Uuid::uuid7($dateTime)); @@ -712,8 +601,6 @@ function ($reason) use ($conditionGroupId): void { /** * @param non-empty-string $conditionGroupId - * @param callable $condition - * @return PromiseInterface */ protected function addCondition(string $conditionGroupId, callable $condition): PromiseInterface { @@ -726,7 +613,6 @@ protected function addCondition(string $conditionGroupId, callable $condition): /** * Record last stack trace of the call. * - * @return void */ protected function recordTrace(): void { diff --git a/src/Promise.php b/src/Promise.php index 4ff55f80f..83aedbbd3 100644 --- a/src/Promise.php +++ b/src/Promise.php @@ -33,7 +33,6 @@ final class Promise * the resolution values of each item in `$promises`. * * @param iterable $promises - * @return PromiseInterface */ public static function all(iterable $promises): PromiseInterface { @@ -51,7 +50,6 @@ public static function all(iterable $promises): PromiseInterface * {@see LengthException}. * * @param iterable $promises - * @return PromiseInterface */ public static function any(iterable $promises): PromiseInterface { @@ -74,8 +72,6 @@ public static function any(iterable $promises): PromiseInterface * reject with a {@see LengthException}. * * @param iterable $promises - * @param int $count - * @return PromiseInterface */ public static function some(iterable $promises, int $count): PromiseInterface { @@ -159,8 +155,6 @@ static function (iterable $array) use ($count, $cancellationQueue, $resolve, $re * * @psalm-param PromiseMapCallback $map * @param iterable $promises - * @param callable $map - * @return PromiseInterface */ public static function map(iterable $promises, callable $map): PromiseInterface { @@ -213,7 +207,6 @@ static function (mixed $mapped) use ($i, &$values, &$toResolve, $resolve): void * @param iterable $promises * @param callable(mixed $current, mixed $carry, int $current, positive-int $items): mixed $reduce * @param mixed $initial - * @return PromiseInterface */ public static function reduce(iterable $promises, callable $reduce, $initial = null): PromiseInterface { @@ -280,8 +273,6 @@ static function (iterable $array) use ( * * If `$promiseOrValue` is a promise, it will be returned as is. * - * @param $promiseOrValue - * @return PromiseInterface */ public static function resolve($promiseOrValue = null): PromiseInterface { @@ -301,7 +292,6 @@ public static function resolve($promiseOrValue = null): PromiseInterface * throwing an exception. For example, it allows you to propagate a rejection with * the value of another promise. * - * @param $promiseOrValue * @return PromiseInterface */ public static function reject($promiseOrValue = null): PromiseInterface diff --git a/src/Worker/DispatcherInterface.php b/src/Worker/DispatcherInterface.php index 7ad225fe9..958cc9f70 100644 --- a/src/Worker/DispatcherInterface.php +++ b/src/Worker/DispatcherInterface.php @@ -16,10 +16,5 @@ interface DispatcherInterface { - /** - * @param ServerRequestInterface $request - * @param array $headers - * @return PromiseInterface - */ public function dispatch(ServerRequestInterface $request, array $headers): PromiseInterface; } diff --git a/src/Worker/Environment/EnvironmentInterface.php b/src/Worker/Environment/EnvironmentInterface.php index dcba1824f..1ece33a7a 100644 --- a/src/Worker/Environment/EnvironmentInterface.php +++ b/src/Worker/Environment/EnvironmentInterface.php @@ -13,13 +13,7 @@ interface EnvironmentInterface { - /** - * @return \DateTimeInterface - */ public function now(): \DateTimeInterface; - /** - * @return bool - */ public function isReplaying(): bool; } diff --git a/src/Worker/Transport/Codec/CodecInterface.php b/src/Worker/Transport/Codec/CodecInterface.php index d8cd18fc6..401b50b06 100644 --- a/src/Worker/Transport/Codec/CodecInterface.php +++ b/src/Worker/Transport/Codec/CodecInterface.php @@ -20,13 +20,11 @@ interface CodecInterface { /** * @param iterable $commands - * @return string * @throws ProtocolException */ public function encode(iterable $commands): string; /** - * @param string $batch * @return iterable * @throws ProtocolException */ diff --git a/src/Worker/Transport/Codec/JsonCodec.php b/src/Worker/Transport/Codec/JsonCodec.php index fc48ef298..730435e79 100644 --- a/src/Worker/Transport/Codec/JsonCodec.php +++ b/src/Worker/Transport/Codec/JsonCodec.php @@ -24,10 +24,6 @@ final class JsonCodec implements CodecInterface private Decoder $parser; private Encoder $serializer; - /** - * @param DataConverterInterface $dataConverter - * @param int $maxDepth - */ public function __construct(DataConverterInterface $dataConverter, int $maxDepth = 64) { $this->maxDepth = $maxDepth; @@ -36,9 +32,6 @@ public function __construct(DataConverterInterface $dataConverter, int $maxDepth $this->serializer = new Encoder($dataConverter); } - /** - * {@inheritDoc} - */ public function encode(iterable $commands): string { try { @@ -55,9 +48,6 @@ public function encode(iterable $commands): string } } - /** - * {@inheritDoc} - */ public function decode(string $batch, array $headers = []): iterable { static $tz = new \DateTimeZone('UTC'); diff --git a/src/Worker/Transport/Codec/JsonCodec/Encoder.php b/src/Worker/Transport/Codec/JsonCodec/Encoder.php index fd59fe386..aeb027254 100644 --- a/src/Worker/Transport/Codec/JsonCodec/Encoder.php +++ b/src/Worker/Transport/Codec/JsonCodec/Encoder.php @@ -25,9 +25,6 @@ class Encoder private DataConverterInterface $converter; - /** - * @param DataConverterInterface $dataConverter - */ public function __construct(DataConverterInterface $dataConverter) { $this->converter = $dataConverter; diff --git a/src/Worker/Transport/Codec/ProtoCodec.php b/src/Worker/Transport/Codec/ProtoCodec.php index 5a7ebffd9..2dfb2259d 100644 --- a/src/Worker/Transport/Codec/ProtoCodec.php +++ b/src/Worker/Transport/Codec/ProtoCodec.php @@ -25,28 +25,16 @@ */ final class ProtoCodec implements CodecInterface { - /** - * @var Decoder - */ private Decoder $parser; - /** - * @var Encoder - */ private Encoder $encoder; - /** - * @param DataConverterInterface $dataConverter - */ public function __construct(DataConverterInterface $dataConverter) { $this->parser = new Decoder($dataConverter); $this->encoder = new Encoder($dataConverter); } - /** - * {@inheritDoc} - */ public function encode(iterable $commands): string { try { @@ -66,9 +54,6 @@ public function encode(iterable $commands): string } } - /** - * {@inheritDoc} - */ public function decode(string $batch, array $headers = []): iterable { static $tz = new \DateTimeZone('UTC'); diff --git a/src/Worker/Transport/Command/Common/RequestTrait.php b/src/Worker/Transport/Command/Common/RequestTrait.php index 8a7752bcf..33815875c 100644 --- a/src/Worker/Transport/Command/Common/RequestTrait.php +++ b/src/Worker/Transport/Command/Common/RequestTrait.php @@ -25,9 +25,6 @@ public function getPayloads(): ValuesInterface return $this->payloads; } - /** - * @return Header - */ public function getHeader(): Header { return $this->header; diff --git a/src/Worker/Transport/Command/RequestInterface.php b/src/Worker/Transport/Command/RequestInterface.php index d7ef99601..d176a14a9 100644 --- a/src/Worker/Transport/Command/RequestInterface.php +++ b/src/Worker/Transport/Command/RequestInterface.php @@ -31,21 +31,14 @@ public function getName(): string; */ public function getOptions(): array; - /** - * @return ValuesInterface - */ public function getPayloads(): ValuesInterface; /** * Optional failure. * - * @return \Throwable|null */ public function getFailure(): ?\Throwable; - /** - * @return HeaderInterface - */ public function getHeader(): HeaderInterface; /** diff --git a/src/Worker/Transport/Command/SuccessResponseInterface.php b/src/Worker/Transport/Command/SuccessResponseInterface.php index 8bade9aa5..23197069a 100644 --- a/src/Worker/Transport/Command/SuccessResponseInterface.php +++ b/src/Worker/Transport/Command/SuccessResponseInterface.php @@ -15,8 +15,5 @@ interface SuccessResponseInterface extends CommandInterface { - /** - * @return ValuesInterface - */ public function getPayloads(): ValuesInterface; } diff --git a/src/Worker/Transport/CommandBatch.php b/src/Worker/Transport/CommandBatch.php index 0cf8e08e8..f2ca88561 100644 --- a/src/Worker/Transport/CommandBatch.php +++ b/src/Worker/Transport/CommandBatch.php @@ -19,10 +19,6 @@ final class CommandBatch public string $messages; public array $context; - /** - * @param string $messages - * @param array $context - */ public function __construct(string $messages, array $context) { $this->messages = $messages; diff --git a/src/Worker/Transport/Goridge.php b/src/Worker/Transport/Goridge.php index c188f298a..6df2d1c5f 100644 --- a/src/Worker/Transport/Goridge.php +++ b/src/Worker/Transport/Goridge.php @@ -24,18 +24,11 @@ final class Goridge implements RPCConnectionInterface { private RPCInterface $rpc; - /** - * @param RelayInterface $relay - */ public function __construct(RelayInterface $relay) { $this->rpc = new RPC($relay); } - /** - * @param EnvironmentInterface|null $env - * @return RPCConnectionInterface - */ public static function create(EnvironmentInterface $env = null): RPCConnectionInterface { $env ??= Environment::fromGlobals(); @@ -44,7 +37,6 @@ public static function create(EnvironmentInterface $env = null): RPCConnectionIn } /** - * @param string $method * @param mixed $payload * @return mixed * diff --git a/src/Worker/Transport/HostConnectionInterface.php b/src/Worker/Transport/HostConnectionInterface.php index 73b08e3df..afb58b889 100644 --- a/src/Worker/Transport/HostConnectionInterface.php +++ b/src/Worker/Transport/HostConnectionInterface.php @@ -19,19 +19,16 @@ interface HostConnectionInterface { /** - * @return CommandBatch|null * @throws TransportException */ public function waitBatch(): ?CommandBatch; /** - * @param string $frame * @throws TransportException */ public function send(string $frame): void; /** - * @param \Throwable $error * @throws TransportException */ public function error(\Throwable $error): void; diff --git a/src/Worker/Transport/RPCConnectionInterface.php b/src/Worker/Transport/RPCConnectionInterface.php index 59dfbdb4a..560cca1d9 100644 --- a/src/Worker/Transport/RPCConnectionInterface.php +++ b/src/Worker/Transport/RPCConnectionInterface.php @@ -16,8 +16,6 @@ interface RPCConnectionInterface { /** - * @param string $method - * @param $payload * @return mixed * * @throws TransportException diff --git a/src/Worker/Transport/RoadRunner.php b/src/Worker/Transport/RoadRunner.php index 8d57d8e28..f422fcd18 100644 --- a/src/Worker/Transport/RoadRunner.php +++ b/src/Worker/Transport/RoadRunner.php @@ -39,19 +39,12 @@ final class RoadRunner implements HostConnectionInterface private RoadRunnerWorker $worker; private CodecInterface $codec; - /** - * @param RoadRunnerWorker $worker - */ public function __construct(RoadRunnerWorker $worker) { $this->worker = $worker; $this->codec = new JsonCodec(); } - /** - * @param EnvironmentInterface|null $env - * @return HostConnectionInterface - */ public static function create( EnvironmentInterface $env = null, RoadRunnerVersionChecker $versionChecker = null, @@ -64,9 +57,6 @@ public static function create( return new self(new Worker(Relay::create($env->getRelayAddress()))); } - /** - * {@inheritDoc} - */ public function waitBatch(): ?CommandBatch { /** @var Payload $payload */ @@ -82,9 +72,6 @@ public function waitBatch(): ?CommandBatch ); } - /** - * {@inheritDoc} - */ public function send(string $frame, array $headers = []): void { $json = $this->encodeHeaders($headers); @@ -96,9 +83,6 @@ public function send(string $frame, array $headers = []): void } } - /** - * {@inheritDoc} - */ public function error(\Throwable $error): void { try { diff --git a/src/Worker/Worker.php b/src/Worker/Worker.php index ea3697e03..7800f9ace 100644 --- a/src/Worker/Worker.php +++ b/src/Worker/Worker.php @@ -29,37 +29,16 @@ class Worker implements WorkerInterface, EventListenerInterface, DispatcherInter { use EventEmitterTrait; - /** - * @var string - */ private string $name; - /** - * @var WorkerOptions - */ private WorkerOptions $options; - /** - * @var RouterInterface - */ private RouterInterface $router; - /** - * @var ServiceContainer - */ private ServiceContainer $services; - /** - * @var RPCConnectionInterface - */ private RPCConnectionInterface $rpc; - /** - * @param string $taskQueue - * @param WorkerOptions $options - * @param ServiceContainer $serviceContainer - * @param RPCConnectionInterface $rpc - */ public function __construct( string $taskQueue, WorkerOptions $options, @@ -74,33 +53,21 @@ public function __construct( $this->router = $this->createRouter(); } - /** - * @return WorkerOptions - */ public function getOptions(): WorkerOptions { return $this->options; } - /** - * {@inheritDoc} - */ public function dispatch(ServerRequestInterface $request, array $headers): PromiseInterface { return $this->router->dispatch($request, $headers); } - /** - * {@inheritDoc} - */ public function getID(): string { return $this->name; } - /** - * {@inheritDoc} - */ public function registerWorkflowTypes(string ...$class): WorkerInterface { foreach ($class as $workflow) { @@ -111,17 +78,11 @@ public function registerWorkflowTypes(string ...$class): WorkerInterface return $this; } - /** - * {@inheritDoc} - */ public function getWorkflows(): RepositoryInterface { return $this->services->workflows; } - /** - * {@inheritDoc} - */ public function registerActivityImplementations(object ...$activity): WorkerInterface { foreach ($activity as $act) { @@ -150,17 +111,11 @@ public function registerActivityFinalizer(\Closure $finalizer): WorkerInterface return $this; } - /** - * {@inheritDoc} - */ public function getActivities(): RepositoryInterface { return $this->services->activities; } - /** - * @return RouterInterface - */ protected function createRouter(): RouterInterface { $router = new Router(); diff --git a/src/Worker/WorkerFactoryInterface.php b/src/Worker/WorkerFactoryInterface.php index 370fd48c4..6e7cb4a68 100644 --- a/src/Worker/WorkerFactoryInterface.php +++ b/src/Worker/WorkerFactoryInterface.php @@ -33,9 +33,6 @@ interface WorkerFactoryInterface /** * Create a new Temporal Worker with the name of the task queue and register in worker. * - * @param string $taskQueue - * @param WorkerOptions|null $options - * @return WorkerInterface */ public function newWorker( string $taskQueue = self::DEFAULT_TASK_QUEUE, diff --git a/src/Worker/WorkerInterface.php b/src/Worker/WorkerInterface.php index 626be561c..90140f60e 100644 --- a/src/Worker/WorkerInterface.php +++ b/src/Worker/WorkerInterface.php @@ -24,7 +24,6 @@ interface WorkerInterface extends Identifiable /** * Returns processing options associated with specific worker task queue. * - * @return WorkerOptions */ public function getOptions(): WorkerOptions; @@ -57,7 +56,6 @@ public function getWorkflows(): iterable; * @see WorkerInterface::registerActivity * @deprecated use {@see registerActivity()} instead. * - * @param object ...$activity * @return $this */ public function registerActivityImplementations(object ...$activity): self; diff --git a/src/Worker/WorkerOptions.php b/src/Worker/WorkerOptions.php index 7ce72b555..72cac3b84 100644 --- a/src/Worker/WorkerOptions.php +++ b/src/Worker/WorkerOptions.php @@ -623,7 +623,6 @@ public function withEnableSessionWorker(bool $enable = true): self * For now, if user doesn't specify one, a new uuid will be used as the * resourceID. * - * @param string|null $identifier */ #[Pure] public function withSessionResourceId(?string $identifier): self diff --git a/src/WorkerFactory.php b/src/WorkerFactory.php index e6550f88f..ea064a387 100644 --- a/src/WorkerFactory.php +++ b/src/WorkerFactory.php @@ -99,19 +99,10 @@ class WorkerFactory implements WorkerFactoryInterface, LoopInterface */ private const HEADER_TASK_QUEUE = 'taskQueue'; - /** - * @var DataConverterInterface - */ protected DataConverterInterface $converter; - /** - * @var ReaderInterface - */ protected ReaderInterface $reader; - /** - * @var RouterInterface - */ protected RouterInterface $router; /** @@ -119,29 +110,14 @@ class WorkerFactory implements WorkerFactoryInterface, LoopInterface */ protected RepositoryInterface $queues; - /** - * @var CodecInterface - */ protected CodecInterface $codec; - /** - * @var ClientInterface - */ protected ClientInterface $client; - /** - * @var ServerInterface - */ protected ServerInterface $server; - /** - * @var QueueInterface - */ protected QueueInterface $responses; - /** - * @var RPCConnectionInterface - */ protected RPCConnectionInterface $rpc; /** @@ -149,15 +125,8 @@ class WorkerFactory implements WorkerFactoryInterface, LoopInterface */ protected MarshallerInterface $marshaller; - /** - * @var EnvironmentInterface - */ protected EnvironmentInterface $env; - /** - * @param DataConverterInterface $dataConverter - * @param RPCConnectionInterface $rpc - */ public function __construct( DataConverterInterface $dataConverter, RPCConnectionInterface $rpc, @@ -168,12 +137,6 @@ public function __construct( $this->boot(); } - /** - * @param DataConverterInterface|null $converter - * @param RPCConnectionInterface|null $rpc - * - * @return WorkerFactoryInterface - */ public static function create( DataConverterInterface $converter = null, RPCConnectionInterface $rpc = null, @@ -184,9 +147,6 @@ public static function create( ); } - /** - * {@inheritDoc} - */ public function newWorker( string $taskQueue = self::DEFAULT_TASK_QUEUE, WorkerOptions $options = null, @@ -208,33 +168,21 @@ public function newWorker( return $worker; } - /** - * @return ReaderInterface - */ public function getReader(): ReaderInterface { return $this->reader; } - /** - * @return ClientInterface - */ public function getClient(): ClientInterface { return $this->client; } - /** - * @return QueueInterface - */ public function getQueue(): QueueInterface { return $this->responses; } - /** - * @return DataConverterInterface - */ public function getDataConverter(): DataConverterInterface { return $this->converter; @@ -248,17 +196,11 @@ public function getMarshaller(): MarshallerInterface return $this->marshaller; } - /** - * @return EnvironmentInterface - */ public function getEnvironment(): EnvironmentInterface { return $this->env; } - /** - * {@inheritDoc} - */ public function run(HostConnectionInterface $host = null): int { $host ??= RoadRunner::create(); @@ -275,9 +217,6 @@ public function run(HostConnectionInterface $host = null): int return 0; } - /** - * @return void - */ public function tick(): void { $this->emit(LoopInterface::ON_SIGNAL); @@ -287,9 +226,6 @@ public function tick(): void $this->emit(LoopInterface::ON_FINALLY); } - /** - * @return ReaderInterface - */ protected function createReader(): ReaderInterface { if (\interface_exists(Reader::class)) { @@ -307,9 +243,6 @@ protected function createTaskQueue(): RepositoryInterface return new ArrayRepository(); } - /** - * @return RouterInterface - */ protected function createRouter(): RouterInterface { $router = new Router(); @@ -318,33 +251,23 @@ protected function createRouter(): RouterInterface return $router; } - /** - * @return QueueInterface - */ protected function createQueue(): QueueInterface { return new ArrayQueue(); } - /** - * @return ClientInterface - */ #[Pure] protected function createClient(): ClientInterface { return new Client($this->responses); } - /** - * @return ServerInterface - */ protected function createServer(): ServerInterface { return new Server($this->responses, $this->onRequest(...)); } /** - * @param ReaderInterface $reader * @return MarshallerInterface */ protected function createMarshaller(ReaderInterface $reader): MarshallerInterface @@ -352,9 +275,6 @@ protected function createMarshaller(ReaderInterface $reader): MarshallerInterfac return new Marshaller(new AttributeMapperFactory($reader)); } - /** - * @return void - */ private function boot(): void { $this->reader = $this->createReader(); @@ -367,9 +287,6 @@ private function boot(): void $this->env = new Environment(); } - /** - * @return CodecInterface - */ private function createCodec(): CodecInterface { switch ($_SERVER['RR_CODEC'] ?? null) { @@ -381,11 +298,6 @@ private function createCodec(): CodecInterface } } - /** - * @param string $messages - * @param array $headers - * @return string - */ private function dispatch(string $messages, array $headers): string { $commands = $this->codec->decode($messages, $headers); @@ -407,11 +319,6 @@ private function dispatch(string $messages, array $headers): string return $this->codec->encode($this->responses); } - /** - * @param ServerRequestInterface $request - * @param array $headers - * @return PromiseInterface - */ private function onRequest(ServerRequestInterface $request, array $headers): PromiseInterface { if (!isset($headers[self::HEADER_TASK_QUEUE])) { @@ -425,10 +332,6 @@ private function onRequest(ServerRequestInterface $request, array $headers): Pro return $queue->dispatch($request, $headers); } - /** - * @param string $taskQueueName - * @return WorkerInterface - */ private function findTaskQueueOrFail(string $taskQueueName): WorkerInterface { $queue = $this->queues->find($taskQueueName); @@ -440,10 +343,6 @@ private function findTaskQueueOrFail(string $taskQueueName): WorkerInterface return $queue; } - /** - * @param array $headers - * @return string - */ private function findTaskQueueNameOrFail(array $headers): string { $taskQueue = $headers[self::HEADER_TASK_QUEUE]; diff --git a/src/Workflow.php b/src/Workflow.php index 55426a2d0..8c2b7c829 100644 --- a/src/Workflow.php +++ b/src/Workflow.php @@ -70,7 +70,6 @@ final class Workflow extends Facade * * And each other like this. * - * @return \DateTimeInterface * @throws OutOfContextException in the absence of the workflow execution context. */ public static function now(): \DateTimeInterface @@ -85,7 +84,6 @@ public static function now(): \DateTimeInterface * * 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. */ public static function isReplaying(): bool @@ -96,7 +94,6 @@ public static function isReplaying(): bool /** * Returns information about current workflow execution. * - * @return WorkflowInfo * @throws OutOfContextException in the absence of the workflow execution context. */ public static function getInfo(): WorkflowInfo @@ -140,7 +137,6 @@ public static function getUpdateContext(): ?UpdateContext * $second = $arguments->getValue(1, Type::TYPE_STRING); * ``` * - * @return ValuesInterface * @throws OutOfContextException in the absence of the workflow execution context. */ public static function getInput(): ValuesInterface @@ -182,8 +178,6 @@ public static function getInput(): ValuesInterface * You can see more information about the capabilities of the child * asynchronous task in {@see CancellationScopeInterface} interface. * - * @param callable $task - * @return CancellationScopeInterface * @throws OutOfContextException in the absence of the workflow execution context. */ public static function async(callable $task): CancellationScopeInterface @@ -232,8 +226,6 @@ public static function async(callable $task): CancellationScopeInterface * * Use asyncDetached to handle cleanup and compensation logic. * - * @param callable $task - * @return CancellationScopeInterface * @throws OutOfContextException in the absence of the workflow execution context. */ public static function asyncDetached(callable $task): CancellationScopeInterface @@ -281,7 +273,6 @@ public static function asyncDetached(callable $task): CancellationScopeInterface * ``` * * @param callable|PromiseInterface ...$conditions - * @return PromiseInterface */ public static function await(...$conditions): PromiseInterface { @@ -343,8 +334,6 @@ public static function getLastCompletionResult($type = null) * to call such query handlers as in the case of ordinary query methods. * * @param string|class-string $queryType - * @param callable $handler - * @return ScopedContextInterface * @throws OutOfContextException in the absence of the workflow execution context. */ public static function registerQuery(string $queryType, callable $handler): ScopedContextInterface @@ -365,8 +354,6 @@ public static function registerQuery(string $queryType, callable $handler): Scop * to call such signal handlers as in the case of ordinary signal methods. * * @param non-empty-string $queryType - * @param callable $handler - * @return ScopedContextInterface * @throws OutOfContextException in the absence of the workflow execution context. */ public static function registerSignal(string $queryType, callable $handler): ScopedContextInterface @@ -430,9 +417,6 @@ public static function registerUpdate( * } * ``` * - * @param string $changeId - * @param int $minSupported - * @param int $maxSupported * @return PromiseInterface * @throws OutOfContextException in the absence of the workflow execution context. */ @@ -518,10 +502,6 @@ public static function timer($interval): PromiseInterface * } * ``` * - * @param string $type - * @param array $args - * @param ContinueAsNewOptions|null $options - * @return PromiseInterface * @throws OutOfContextException in the absence of the workflow execution context. */ public static function continueAsNew( @@ -565,7 +545,6 @@ public static function continueAsNew( * @psalm-template T of object * * @param class-string $class - * @param ContinueAsNewOptions|null $options * @return T * @throws OutOfContextException in the absence of the workflow execution context. */ @@ -617,12 +596,8 @@ public static function newContinueAsNewStub(string $class, ContinueAsNewOptions * } * ``` * - * @param string $type - * @param array $args - * @param ChildWorkflowOptions|null $options * @param Type|string|\ReflectionType|\ReflectionClass|null $returnType * - * @return PromiseInterface * @throws OutOfContextException in the absence of the workflow execution context. */ public static function executeChildWorkflow( @@ -670,7 +645,6 @@ public static function executeChildWorkflow( * @psalm-template T of object * * @param class-string $class - * @param ChildWorkflowOptions|null $options * * @return T * @throws OutOfContextException in the absence of the workflow execution context. @@ -722,10 +696,6 @@ public static function newChildWorkflowStub( * } * ``` * - * @param string $name - * @param ChildWorkflowOptions|null $options - * - * @return ChildWorkflowStubInterface * @throws OutOfContextException in the absence of the workflow execution context. */ public static function newUntypedChildWorkflowStub( @@ -755,7 +725,6 @@ public static function newUntypedChildWorkflowStub( * @psalm-template T of object * * @param class-string $class - * @param WorkflowExecution $execution * @return T * @throws OutOfContextException in the absence of the workflow execution context. */ @@ -784,8 +753,6 @@ public static function newExternalWorkflowStub(string $class, WorkflowExecution * } * ``` * - * @param WorkflowExecution $execution - * @return ExternalWorkflowStubInterface * @throws OutOfContextException in the absence of the workflow execution context. */ public static function newUntypedExternalWorkflowStub(WorkflowExecution $execution): ExternalWorkflowStubInterface @@ -823,10 +790,7 @@ public static function newUntypedExternalWorkflowStub(WorkflowExecution $executi * } * ``` * - * @param string $type - * @param array $args * @param ActivityOptions|null $options - * @param Type|string|null|\ReflectionClass|\ReflectionType $returnType * @return PromiseInterface * @throws OutOfContextException in the absence of the workflow execution context. */ @@ -868,7 +832,6 @@ public static function executeActivity( * @psalm-template T of object * * @param class-string $class - * @param ActivityOptionsInterface|null $options * * @return T * @throws OutOfContextException in the absence of the workflow execution context. @@ -899,9 +862,6 @@ public static function newActivityStub( * } * ``` * - * @param ActivityOptionsInterface|null $options - * - * @return ActivityStubInterface * @throws OutOfContextException in the absence of the workflow execution context. */ public static function newUntypedActivityStub( @@ -913,7 +873,6 @@ public static function newUntypedActivityStub( /** * Returns a complete trace of the last calls (for debugging). * - * @return string * @throws OutOfContextException in the absence of the workflow execution context. */ public static function getStackTrace(): string diff --git a/src/Workflow/ActivityStubInterface.php b/src/Workflow/ActivityStubInterface.php index 26ea7c2ae..7ec4bb41a 100644 --- a/src/Workflow/ActivityStubInterface.php +++ b/src/Workflow/ActivityStubInterface.php @@ -18,9 +18,6 @@ interface ActivityStubInterface { - /** - * @return ActivityOptionsInterface - */ public function getOptions(): ActivityOptionsInterface; /** @@ -28,8 +25,6 @@ public function getOptions(): ActivityOptionsInterface; * * @param string $name name of an activity type to execute. * @param array $args arguments of the activity. - * @param Type|string|null|\ReflectionClass|\ReflectionType $returnType - * @param bool $isLocalActivity * @return CompletableResultInterface Promise to the activity result. */ public function execute( diff --git a/src/Workflow/CancellationScopeInterface.php b/src/Workflow/CancellationScopeInterface.php index adf756580..b35bd1800 100644 --- a/src/Workflow/CancellationScopeInterface.php +++ b/src/Workflow/CancellationScopeInterface.php @@ -22,21 +22,18 @@ interface CancellationScopeInterface extends PromiseInterface /** * Detached scopes can continue working even if parent scope was cancelled. * - * @return bool */ public function isDetached(): bool; /** * Returns true if cancel request was sent to scope. * - * @return bool */ public function isCancelled(): bool; /** * Triggered when cancel request sent to scope. * - * @param callable $then * @return $this */ public function onCancel(callable $then): self; @@ -48,7 +45,6 @@ public function onCancel(callable $then): self; * Once a promise is settled (either fulfilled or rejected), calling `cancel()` on * a promise has no effect. * - * @return void */ public function cancel(): void; } diff --git a/src/Workflow/ChildWorkflowOptions.php b/src/Workflow/ChildWorkflowOptions.php index 50d27494e..679fd288d 100644 --- a/src/Workflow/ChildWorkflowOptions.php +++ b/src/Workflow/ChildWorkflowOptions.php @@ -179,8 +179,6 @@ public function __construct() } /** - * @param MethodRetry|null $retry - * @param CronSchedule|null $cron * @return $this */ public function mergeWith(?MethodRetry $retry = null, ?CronSchedule $cron = null): self @@ -201,7 +199,6 @@ public function mergeWith(?MethodRetry $retry = null, ?CronSchedule $cron = null /** * Specify namespace in which workflow should be started. * - * @param string $namespace * @return $this */ #[Pure] @@ -220,7 +217,6 @@ public function withNamespace(string $namespace): self * deduplication will happen based on the generated id. So prefer assigning * business meaningful ids if possible. * - * @param string $workflowId * @return $this */ #[Pure] @@ -237,7 +233,6 @@ public function withWorkflowId(string $workflowId): 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. * - * @param string $taskQueue * @return $this */ #[Pure] @@ -366,7 +361,6 @@ public function withWorkflowIdReusePolicy(IdReusePolicy|int $policy): self * RetryOptions that define how child workflow is retried in case of * failure. Default is null which is no reties. * - * @param RetryOptions|null $options * @return $this */ #[Pure] @@ -384,7 +378,6 @@ public function withRetryOptions(?RetryOptions $options): self * * @see CronSchedule::$interval for more info about cron format. * - * @param string|null $expression * @return $this */ #[Pure] @@ -400,7 +393,6 @@ public function withCronSchedule(?string $expression): self /** * Specifies additional non-indexed information in result of list workflow. * - * @param array|null $memo * @return $this */ public function withMemo(?array $memo): self @@ -415,7 +407,6 @@ public function withMemo(?array $memo): self /** * Specifies additional indexed information in result of list workflow. * - * @param array|null $searchAttributes * @return $this */ public function withSearchAttributes(?array $searchAttributes): self diff --git a/src/Workflow/ChildWorkflowStubInterface.php b/src/Workflow/ChildWorkflowStubInterface.php index 14186d9d4..e857cccc5 100644 --- a/src/Workflow/ChildWorkflowStubInterface.php +++ b/src/Workflow/ChildWorkflowStubInterface.php @@ -18,23 +18,15 @@ interface ChildWorkflowStubInterface { /** - * @return PromiseInterface * @throws \LogicException */ public function getExecution(): PromiseInterface; - /** - * @return string - */ public function getChildWorkflowType(): string; - /** - * @return ChildWorkflowOptions - */ public function getOptions(): ChildWorkflowOptions; /** - * @param array $args * @param Type|string|\ReflectionType|\ReflectionClass|null $returnType * * @return CompletableResultInterface @@ -52,7 +44,6 @@ public function getResult($returnType = null): PromiseInterface; /** * @param non-empty-string $name - * @param array $args * * @return CompletableResultInterface * @throws \LogicException diff --git a/src/Workflow/ContinueAsNewOptions.php b/src/Workflow/ContinueAsNewOptions.php index 159156723..3c2a9735d 100644 --- a/src/Workflow/ContinueAsNewOptions.php +++ b/src/Workflow/ContinueAsNewOptions.php @@ -79,7 +79,6 @@ public static function new(): self * * @psalm-suppress ImpureMethodCall * - * @param string $taskQueue * @return $this */ #[Pure] diff --git a/src/Workflow/ExternalWorkflowStubInterface.php b/src/Workflow/ExternalWorkflowStubInterface.php index ab22cd7c3..ad0d28345 100644 --- a/src/Workflow/ExternalWorkflowStubInterface.php +++ b/src/Workflow/ExternalWorkflowStubInterface.php @@ -15,22 +15,13 @@ interface ExternalWorkflowStubInterface { - /** - * @return WorkflowExecution - */ public function getExecution(): WorkflowExecution; /** - * @param string $name - * @param array $args * - * @return PromiseInterface * @throws \LogicException */ public function signal(string $name, array $args = []): PromiseInterface; - /** - * @return PromiseInterface - */ public function cancel(): PromiseInterface; } diff --git a/src/Workflow/ProcessInterface.php b/src/Workflow/ProcessInterface.php index e35d2787b..0d6d1cba0 100644 --- a/src/Workflow/ProcessInterface.php +++ b/src/Workflow/ProcessInterface.php @@ -19,8 +19,5 @@ */ interface ProcessInterface extends CancellationScopeInterface, Identifiable { - /** - * @return WorkflowContextInterface - */ public function getContext(): WorkflowContextInterface; } diff --git a/src/Workflow/Saga.php b/src/Workflow/Saga.php index 736b4d1ac..6853e3ab4 100644 --- a/src/Workflow/Saga.php +++ b/src/Workflow/Saga.php @@ -26,7 +26,6 @@ final class Saga * false, then the compensation operations will be run the reverse order as they are added. * * @param bool $parallelCompensation default is false. - * @return self */ public function setParallelCompensation(bool $parallelCompensation): self { @@ -43,7 +42,6 @@ public function setParallelCompensation(bool $parallelCompensation): self * @param bool $continueWithError whether to proceed with the next compensation operation if the * previous throws exception. This only applies to sequential compensation. Default is * false. - * @return self */ public function setContinueWithError(bool $continueWithError): self { @@ -51,9 +49,6 @@ public function setContinueWithError(bool $continueWithError): self return $this; } - /** - * @param callable $handler - */ public function addCompensation(callable $handler): void { $this->compensate[] = $handler; diff --git a/src/Workflow/WorkflowContextInterface.php b/src/Workflow/WorkflowContextInterface.php index 90e5debf7..747fc4dbb 100644 --- a/src/Workflow/WorkflowContextInterface.php +++ b/src/Workflow/WorkflowContextInterface.php @@ -32,7 +32,6 @@ interface WorkflowContextInterface extends EnvironmentInterface * * @see Workflow::getInfo() * - * @return WorkflowInfo */ public function getInfo(): WorkflowInfo; @@ -41,7 +40,6 @@ public function getInfo(): WorkflowInfo; * * @see Workflow::getInput() * - * @return ValuesInterface */ public function getInput(): ValuesInterface; @@ -61,8 +59,6 @@ public function getLastCompletionResult($type = null); * * @see Workflow::registerQuery() * - * @param string $queryType - * @param callable $handler * @return $this */ public function registerQuery(string $queryType, callable $handler): self; @@ -72,8 +68,6 @@ public function registerQuery(string $queryType, callable $handler): self; * * @see Workflow::registerSignal() * - * @param string $queryType - * @param callable $handler * @return $this */ public function registerSignal(string $queryType, callable $handler): self; @@ -92,9 +86,6 @@ public function registerUpdate(string $name, callable $handler, ?callable $valid * * @internal This is an internal method * - * @param RequestInterface $request - * @param bool $cancellable - * @return PromiseInterface */ public function request(RequestInterface $request, bool $cancellable = true): PromiseInterface; @@ -103,10 +94,6 @@ public function request(RequestInterface $request, bool $cancellable = true): Pr * * @see Workflow::getVersion() * - * @param string $changeId - * @param int $minSupported - * @param int $maxSupported - * @return PromiseInterface */ public function getVersion(string $changeId, int $minSupported, int $maxSupported): PromiseInterface; @@ -124,17 +111,12 @@ public function sideEffect(callable $context): PromiseInterface; /** * @internal This is an internal method * - * @param array|null $result - * @param \Throwable|null $failure - * @return PromiseInterface */ public function complete(array $result = null, \Throwable $failure = null): PromiseInterface; /** * @internal This is an internal method * - * @param \Throwable|null $failure - * @return PromiseInterface */ public function panic(\Throwable $failure = null): PromiseInterface; @@ -144,7 +126,6 @@ public function panic(\Throwable $failure = null): PromiseInterface; * @see Workflow::timer() * * @param DateIntervalValue $interval - * @return PromiseInterface * @see DateInterval */ public function timer($interval): PromiseInterface; @@ -154,10 +135,6 @@ public function timer($interval): PromiseInterface; * * @see Workflow::continueAsNew() * - * @param string $type - * @param array $args - * @param ContinueAsNewOptions|null $options - * @return PromiseInterface */ public function continueAsNew( string $type, @@ -172,7 +149,6 @@ public function continueAsNew( * * @psalm-template T of object * @param class-string $class - * @param ContinueAsNewOptions|null $options * @return T */ public function newContinueAsNewStub(string $class, ContinueAsNewOptions $options = null): object; @@ -182,12 +158,8 @@ public function newContinueAsNewStub(string $class, ContinueAsNewOptions $option * * @see Workflow::executeChildWorkflow() * - * @param string $type - * @param array $args - * @param ChildWorkflowOptions|null $options * @param Type|string|\ReflectionType|\ReflectionClass|null $returnType * - * @return PromiseInterface */ public function executeChildWorkflow( string $type, @@ -203,7 +175,6 @@ public function executeChildWorkflow( * * @psalm-template T of object * @param class-string $class - * @param ChildWorkflowOptions|null $options * * @return T */ @@ -217,10 +188,7 @@ public function newChildWorkflowStub( * * @see Workflow::newUntypedChildWorkflowStub() * - * @param string $type - * @param ChildWorkflowOptions|null $options * - * @return ChildWorkflowStubInterface */ public function newUntypedChildWorkflowStub( string $type, @@ -235,7 +203,6 @@ public function newUntypedChildWorkflowStub( * * @psalm-template T of object * @param class-string $class - * @param WorkflowExecution $execution * @return T */ public function newExternalWorkflowStub(string $class, WorkflowExecution $execution): object; @@ -246,8 +213,6 @@ public function newExternalWorkflowStub(string $class, WorkflowExecution $execut * * @see Workflow::newUntypedExternalWorkflowStub() * - * @param WorkflowExecution $execution - * @return ExternalWorkflowStubInterface */ public function newUntypedExternalWorkflowStub(WorkflowExecution $execution): ExternalWorkflowStubInterface; @@ -256,10 +221,7 @@ public function newUntypedExternalWorkflowStub(WorkflowExecution $execution): Ex * * @see Workflow::executeActivity() * - * @param string $type - * @param array $args * @param ActivityOptions|null $options - * @param Type|string|null|\ReflectionClass|\ReflectionType $returnType * * @return PromiseInterface */ @@ -279,7 +241,6 @@ public function executeActivity( * * @psalm-template T of object * @param class-string $class - * @param ActivityOptionsInterface|null $options * * @return T */ @@ -294,9 +255,7 @@ public function newActivityStub( * * @see Workflow::newUntypedActivityStub() * - * @param ActivityOptionsInterface|null $options * - * @return ActivityStubInterface */ public function newUntypedActivityStub( ActivityOptionsInterface $options = null, @@ -308,7 +267,6 @@ public function newUntypedActivityStub( * @see Workflow::await() * * @param callable|PromiseInterface ...$conditions - * @return PromiseInterface */ public function await(...$conditions): PromiseInterface; @@ -331,7 +289,6 @@ public function awaitWithTimeout($interval, ...$conditions): PromiseInterface; * * @see Workflow::getStackTrace() * - * @return string */ public function getStackTrace(): string; diff --git a/src/Workflow/WorkflowExecution.php b/src/Workflow/WorkflowExecution.php index 6703c216e..db8561068 100644 --- a/src/Workflow/WorkflowExecution.php +++ b/src/Workflow/WorkflowExecution.php @@ -24,7 +24,6 @@ class WorkflowExecution /** * @psalm-readonly * @psalm-allow-private-mutation - * @var string */ #[Marshal(name: 'ID')] #[Marshal(name: 'workflow_id')] @@ -33,41 +32,27 @@ class WorkflowExecution /** * @psalm-readonly * @psalm-allow-private-mutation - * @var string|null */ #[Marshal(name: 'RunID')] #[Marshal(name: 'run_id')] private ?string $runId; - /** - * @param string|null $id - * @param string|null $runId - */ public function __construct(string $id = null, ?string $runId = null) { $this->id = $id ?? Uuid::nil(); $this->runId = $runId; } - /** - * @return string - */ public function getID(): string { return $this->id; } - /** - * @return string|null - */ public function getRunID(): ?string { return $this->runId; } - /** - * @return \Temporal\Api\Common\V1\WorkflowExecution - */ public function toProtoWorkflowExecution(): \Temporal\Api\Common\V1\WorkflowExecution { $e = new \Temporal\Api\Common\V1\WorkflowExecution(); diff --git a/src/Workflow/WorkflowInfo.php b/src/Workflow/WorkflowInfo.php index b7d77c051..202df533b 100644 --- a/src/Workflow/WorkflowInfo.php +++ b/src/Workflow/WorkflowInfo.php @@ -26,15 +26,9 @@ #[Immutable] final class WorkflowInfo { - /** - * @var WorkflowExecution - */ #[Marshal(name: 'WorkflowExecution', type: ObjectType::class, of: WorkflowExecution::class)] public WorkflowExecution $execution; - /** - * @var WorkflowType - */ #[Marshal(name: 'WorkflowType', type: ObjectType::class, of: WorkflowType::class)] public WorkflowType $type; @@ -44,27 +38,15 @@ final class WorkflowInfo #[Marshal(name: 'TaskQueueName')] public string $taskQueue = WorkerFactoryInterface::DEFAULT_TASK_QUEUE; - /** - * @var \DateInterval - */ #[Marshal(name: 'WorkflowExecutionTimeout', type: DateIntervalType::class)] public \DateInterval $executionTimeout; - /** - * @var \DateInterval - */ #[Marshal(name: 'WorkflowRunTimeout', type: DateIntervalType::class)] public \DateInterval $runTimeout; - /** - * @var \DateInterval - */ #[Marshal(name: 'WorkflowTaskTimeout', type: DateIntervalType::class)] public \DateInterval $taskTimeout; - /** - * @var string - */ #[Marshal(name: 'Namespace')] public string $namespace = ClientOptions::DEFAULT_NAMESPACE; @@ -112,44 +94,25 @@ final class WorkflowInfo /** * @see CronSchedule::$interval for more info about cron format. * - * @var string|null */ #[Marshal(name: 'CronSchedule', type: NullableType::class, of: CronType::class)] public ?string $cronSchedule = null; - /** - * @var string|null - */ #[Marshal(name: 'ContinuedExecutionRunID')] public ?string $continuedExecutionRunId = null; - /** - * @var string|null - */ #[Marshal(name: 'ParentWorkflowNamespace')] public ?string $parentNamespace = null; - /** - * @var WorkflowExecution|null - */ #[Marshal(name: 'ParentWorkflowExecution', type: NullableType::class, of: WorkflowExecution::class)] public ?WorkflowExecution $parentExecution = null; - /** - * @var array|null - */ #[Marshal(name: 'SearchAttributes', type: NullableType::class, of: ArrayType::class)] public ?array $searchAttributes = null; - /** - * @var array|null - */ #[Marshal(name: 'Memo', type: NullableType::class, of: ArrayType::class)] public ?array $memo = null; - /** - * @var string - */ #[Marshal(name: 'BinaryChecksum')] public string $binaryChecksum = ''; diff --git a/src/Workflow/WorkflowMethod.php b/src/Workflow/WorkflowMethod.php index 205cc787e..aff8c1795 100644 --- a/src/Workflow/WorkflowMethod.php +++ b/src/Workflow/WorkflowMethod.php @@ -33,9 +33,6 @@ final class WorkflowMethod #[Immutable] public ?string $name = null; - /** - * @param string|null $name - */ public function __construct(string $name = null) { $this->name = $name; diff --git a/src/Workflow/WorkflowRunInterface.php b/src/Workflow/WorkflowRunInterface.php index 610f1becb..307ecf184 100644 --- a/src/Workflow/WorkflowRunInterface.php +++ b/src/Workflow/WorkflowRunInterface.php @@ -23,7 +23,6 @@ interface WorkflowRunInterface /** * Returns attached workflow execution. * - * @return WorkflowExecution */ public function getExecution(): WorkflowExecution; @@ -42,7 +41,6 @@ public function getExecution(): WorkflowExecution; * * @param string|\ReflectionClass|\ReflectionType|Type|null $type * @param int|null $timeout Timeout in seconds. Infinite by the default. - * @return mixed * @throws WorkflowFailedException * * @see DateInterval diff --git a/src/Workflow/WorkflowStub.php b/src/Workflow/WorkflowStub.php index 588271210..7a9019cb4 100644 --- a/src/Workflow/WorkflowStub.php +++ b/src/Workflow/WorkflowStub.php @@ -23,9 +23,6 @@ class WorkflowStub /** * Get untyped workflow stub using provided workflow proxy or workflow stub instance. * - * @param object $workflow - * @return WorkflowStubInterface - * * @psalm-assert WorkflowStubInterface|WorkflowProxy $workflow */ public static function fromWorkflow(object $workflow): WorkflowStubInterface diff --git a/src/Workflow/WorkflowType.php b/src/Workflow/WorkflowType.php index 7ee751910..f19b9e921 100644 --- a/src/Workflow/WorkflowType.php +++ b/src/Workflow/WorkflowType.php @@ -21,7 +21,6 @@ class WorkflowType /** * @psalm-allow-private-mutation * @psalm-readonly - * @var string */ #[Marshal(name: 'Name')] #[Marshal(name: 'name')] diff --git a/testing/src/WorkerFactory.php b/testing/src/WorkerFactory.php index 1b04eaa7c..97eb0f713 100644 --- a/testing/src/WorkerFactory.php +++ b/testing/src/WorkerFactory.php @@ -45,9 +45,6 @@ public static function create( ); } - /** - * {@inheritDoc} - */ public function newWorker( string $taskQueue = self::DEFAULT_TASK_QUEUE, WorkerOptions $options = null, From ed75242bb41f3b72ebedef72e3e50675432490e9 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Tue, 29 Oct 2024 02:05:52 +0400 Subject: [PATCH 02/21] Add architecture tests --- .github/workflows/static-analysis.yml | 40 ++++++++++++++++++++++++++- composer.json | 2 ++ phpunit.xml.dist | 3 ++ tests/Arch/ArchTest.php | 40 +++++++++++++++++++++++++++ 4 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 tests/Arch/ArchTest.php diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 3c5ae10cc..37db3ee61 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -42,5 +42,43 @@ jobs: - name: Install Composer Dependencies run: composer install --prefer-dist --no-interaction - - name: Run Tests + - name: 🔍 Run Tests run: vendor/bin/psalm + + arch: + name: Architecture tests + runs-on: ${{ matrix.os }} + continue-on-error: true + strategy: + fail-fast: false + matrix: + php: [8.3] + os: [ubuntu-latest] + steps: + - name: Set up PHP ${{ matrix.php }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom + + - name: Check Out Code + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Get Composer Cache Directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache Dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: php-${{ matrix.php }}-${{ runner.os }}-composer- + + - name: Install Composer Dependencies + run: composer install --prefer-dist --no-interaction + + - name: 🔍 Run Tests + run: composer test:arch diff --git a/composer.json b/composer.json index 17a550a75..ab4c7342a 100644 --- a/composer.json +++ b/composer.json @@ -62,6 +62,7 @@ "spiral/code-style": "^2.1.2", "spiral/core": "^3.13", "symfony/var-dumper": "^6.0 || ^7.0", + "ta-tikoma/phpunit-architecture-test": "^0.8.4", "vimeo/psalm": "^4.30 || ^5.4" }, "autoload-dev": { @@ -87,6 +88,7 @@ "psalm:baseline": "psalm --set-baseline=psalm-baseline.xml", "test:unit": "phpunit --testsuite=Unit --color=always --testdox", "test:func": "phpunit --testsuite=Functional --color=always --testdox", + "test:arch": "phpunit --testsuite=Arch --color=always --testdox", "test:accept": "phpunit --testsuite=Acceptance --color=always --testdox" }, "extra": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 6d0db0da9..c2b9b8b09 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -14,6 +14,9 @@ tests/Acceptance/Harness + + tests/Arch + tests/Unit diff --git a/tests/Arch/ArchTest.php b/tests/Arch/ArchTest.php new file mode 100644 index 000000000..df03f1cec --- /dev/null +++ b/tests/Arch/ArchTest.php @@ -0,0 +1,40 @@ +layer(); + + foreach ($layer as $object) { + foreach ($object->uses as $use) { + foreach ($functions as $function) { + $function === $use and throw new \Exception( + \sprintf( + 'Function `%s()` is used in %s.', + $function, + $object->name, + ), + ); + } + } + } + + $this->assertTrue(true); + } +} From 38a2eb30a771df0aeccd7451a432d82044a34e29 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Tue, 29 Oct 2024 02:08:12 +0400 Subject: [PATCH 03/21] Remove forgotten `tr()` --- composer.json | 2 +- src/Client/Update/UpdateHandle.php | 1 - tests/Arch/ArchTest.php | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index ab4c7342a..dc65d5079 100644 --- a/composer.json +++ b/composer.json @@ -59,7 +59,7 @@ "jetbrains/phpstorm-attributes": "dev-master@dev", "laminas/laminas-code": "^4.0", "phpunit/phpunit": "^10.5", - "spiral/code-style": "^2.1.2", + "spiral/code-style": "~2.1.2", "spiral/core": "^3.13", "symfony/var-dumper": "^6.0 || ^7.0", "ta-tikoma/phpunit-architecture-test": "^0.8.4", diff --git a/src/Client/Update/UpdateHandle.php b/src/Client/Update/UpdateHandle.php index 4183e5314..801658f5c 100644 --- a/src/Client/Update/UpdateHandle.php +++ b/src/Client/Update/UpdateHandle.php @@ -139,7 +139,6 @@ private function fetchResult(int|float|null $timeout = null): void $failure = $result->getFailure(); \assert($failure !== null); $e = FailureConverter::mapFailureToException($failure, $this->converter); - tr($e); $this->result = new WorkflowUpdateException( $e->getMessage(), diff --git a/tests/Arch/ArchTest.php b/tests/Arch/ArchTest.php index df03f1cec..112b3ba26 100644 --- a/tests/Arch/ArchTest.php +++ b/tests/Arch/ArchTest.php @@ -16,7 +16,7 @@ final class ArchTest extends TestCase use ArchitectureAsserts; - public function testDontForgetDebugFunctions(): void + public function testForgottenDebugFunctions(): void { $functions = ['dump', 'trap', 'tr', 'td', 'var_dump']; $layer = $this->layer(); From ca4f27d3dd9b34fd6785d24057431a26ef6596ce Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 28 Oct 2024 22:16:51 +0000 Subject: [PATCH 04/21] style(php-cs-fixer): fix coding standards --- src/Exception/Client/WorkflowException.php | 1 - src/Exception/Client/WorkflowQueryRejectedException.php | 1 - src/Exception/WorkflowExecutionFailedException.php | 2 -- src/Internal/Client/WorkflowStub.php | 1 + src/Internal/Declaration/Prototype/ActivityPrototype.php | 2 -- src/Internal/Declaration/Prototype/Prototype.php | 2 -- src/Internal/Declaration/Prototype/WorkflowPrototype.php | 2 -- src/Internal/Marshaller/Mapper/AttributeMapper.php | 2 -- src/Internal/Marshaller/Marshaller.php | 1 - src/Internal/Transport/CompletableResult.php | 4 ---- src/Internal/Transport/Router/GetWorkerInfo.php | 1 - src/Internal/Workflow/ActivityProxy.php | 2 -- src/Internal/Workflow/ContinueAsNewProxy.php | 4 ---- src/Internal/Workflow/ExternalWorkflowProxy.php | 1 - src/Promise.php | 2 ++ src/Worker/Transport/Codec/ProtoCodec.php | 1 - src/Worker/Transport/RPCConnectionInterface.php | 3 ++- src/Worker/Worker.php | 4 ---- src/WorkerFactory.php | 6 ------ 19 files changed, 5 insertions(+), 37 deletions(-) diff --git a/src/Exception/Client/WorkflowException.php b/src/Exception/Client/WorkflowException.php index e11e63bcb..1b7850e4c 100644 --- a/src/Exception/Client/WorkflowException.php +++ b/src/Exception/Client/WorkflowException.php @@ -17,7 +17,6 @@ class WorkflowException extends TemporalException { private WorkflowExecution $execution; - private ?string $type; public function __construct( diff --git a/src/Exception/Client/WorkflowQueryRejectedException.php b/src/Exception/Client/WorkflowQueryRejectedException.php index 8fade37aa..efc59c9c3 100644 --- a/src/Exception/Client/WorkflowQueryRejectedException.php +++ b/src/Exception/Client/WorkflowQueryRejectedException.php @@ -16,7 +16,6 @@ class WorkflowQueryRejectedException extends WorkflowQueryException { private int $queryRejectCondition; - private int $workflowExecutionStatus; public function __construct( diff --git a/src/Exception/WorkflowExecutionFailedException.php b/src/Exception/WorkflowExecutionFailedException.php index ad2865e70..73675d32c 100644 --- a/src/Exception/WorkflowExecutionFailedException.php +++ b/src/Exception/WorkflowExecutionFailedException.php @@ -16,9 +16,7 @@ class WorkflowExecutionFailedException extends TemporalException { private Failure $failure; - private int $lastWorkflowTaskCompletedEventId; - private int $retryState; /** diff --git a/src/Internal/Client/WorkflowStub.php b/src/Internal/Client/WorkflowStub.php index 588d93908..405462265 100644 --- a/src/Internal/Client/WorkflowStub.php +++ b/src/Internal/Client/WorkflowStub.php @@ -455,6 +455,7 @@ static function (TerminateInput $input) use ($serviceClient, $clientOptions, $de /** * * + * @param null|mixed $type * @throws \Throwable */ public function getResult($type = null, int $timeout = null): mixed diff --git a/src/Internal/Declaration/Prototype/ActivityPrototype.php b/src/Internal/Declaration/Prototype/ActivityPrototype.php index 7e5041091..066cbebfb 100644 --- a/src/Internal/Declaration/Prototype/ActivityPrototype.php +++ b/src/Internal/Declaration/Prototype/ActivityPrototype.php @@ -19,9 +19,7 @@ final class ActivityPrototype extends Prototype { private ?MethodRetry $methodRetry = null; - private ?ActivityInstance $instance = null; - private ?\Closure $factory = null; private bool $isLocalActivity; diff --git a/src/Internal/Declaration/Prototype/Prototype.php b/src/Internal/Declaration/Prototype/Prototype.php index c15709945..8c026a11d 100644 --- a/src/Internal/Declaration/Prototype/Prototype.php +++ b/src/Internal/Declaration/Prototype/Prototype.php @@ -16,9 +16,7 @@ abstract class Prototype implements PrototypeInterface { protected string $name; - protected ?\ReflectionMethod $handler; - private \ReflectionClass $class; public function __construct(string $name, ?\ReflectionMethod $handler, \ReflectionClass $class) diff --git a/src/Internal/Declaration/Prototype/WorkflowPrototype.php b/src/Internal/Declaration/Prototype/WorkflowPrototype.php index 554d21f6a..020363596 100644 --- a/src/Internal/Declaration/Prototype/WorkflowPrototype.php +++ b/src/Internal/Declaration/Prototype/WorkflowPrototype.php @@ -38,9 +38,7 @@ final class WorkflowPrototype extends Prototype private array $updateValidators = []; private ?CronSchedule $cronSchedule = null; - private ?MethodRetry $methodRetry = null; - private ?ReturnType $returnType = null; public function getCronSchedule(): ?CronSchedule diff --git a/src/Internal/Marshaller/Mapper/AttributeMapper.php b/src/Internal/Marshaller/Mapper/AttributeMapper.php index 02d165033..7606f0cf2 100644 --- a/src/Internal/Marshaller/Mapper/AttributeMapper.php +++ b/src/Internal/Marshaller/Mapper/AttributeMapper.php @@ -26,7 +26,6 @@ class AttributeMapper implements MapperInterface { private \ReflectionClass $class; - private ReaderInterface $reader; /** @@ -40,7 +39,6 @@ class AttributeMapper implements MapperInterface private array $setters = []; private Scope $scope; - private TypeFactoryInterface $factory; public function __construct(\ReflectionClass $class, TypeFactoryInterface $factory, ReaderInterface $reader) diff --git a/src/Internal/Marshaller/Marshaller.php b/src/Internal/Marshaller/Marshaller.php index 6fc67804b..25d520d64 100644 --- a/src/Internal/Marshaller/Marshaller.php +++ b/src/Internal/Marshaller/Marshaller.php @@ -27,7 +27,6 @@ class Marshaller implements MarshallerInterface private array $mappers = []; private TypeFactory $type; - private MapperFactoryInterface $mapper; /** diff --git a/src/Internal/Transport/CompletableResult.php b/src/Internal/Transport/CompletableResult.php index e260b83bb..b57a0dbbb 100644 --- a/src/Internal/Transport/CompletableResult.php +++ b/src/Internal/Transport/CompletableResult.php @@ -31,13 +31,9 @@ class CompletableResult implements CompletableResultInterface private $value; private WorkflowContextInterface $context; - private LoopInterface $loop; - private PromiseInterface $promise; - private Deferred $deferred; - private string $layer; /** diff --git a/src/Internal/Transport/Router/GetWorkerInfo.php b/src/Internal/Transport/Router/GetWorkerInfo.php index ca26fbcc7..8c1e86f85 100644 --- a/src/Internal/Transport/Router/GetWorkerInfo.php +++ b/src/Internal/Transport/Router/GetWorkerInfo.php @@ -24,7 +24,6 @@ final class GetWorkerInfo extends Route { private RepositoryInterface $queues; - private MarshallerInterface $marshaller; public function __construct(RepositoryInterface $queues, MarshallerInterface $marshaller) diff --git a/src/Internal/Workflow/ActivityProxy.php b/src/Internal/Workflow/ActivityProxy.php index e275bca6c..22528988d 100644 --- a/src/Internal/Workflow/ActivityProxy.php +++ b/src/Internal/Workflow/ActivityProxy.php @@ -36,9 +36,7 @@ final class ActivityProxy extends Proxy private array $activities; private string $class; - private ActivityOptionsInterface $options; - private WorkflowContextInterface $ctx; /** diff --git a/src/Internal/Workflow/ContinueAsNewProxy.php b/src/Internal/Workflow/ContinueAsNewProxy.php index 3d02d353d..3f8c23f67 100644 --- a/src/Internal/Workflow/ContinueAsNewProxy.php +++ b/src/Internal/Workflow/ContinueAsNewProxy.php @@ -32,13 +32,9 @@ class ContinueAsNewProxy extends Proxy 'Workflow "%s" has already been called within this "continue as new" stub'; private string $class; - private WorkflowPrototype $workflow; - private ContinueAsNewOptions $options; - private WorkflowContextInterface $context; - private bool $isContinued = false; public function __construct( diff --git a/src/Internal/Workflow/ExternalWorkflowProxy.php b/src/Internal/Workflow/ExternalWorkflowProxy.php index 0c250af43..916e3391e 100644 --- a/src/Internal/Workflow/ExternalWorkflowProxy.php +++ b/src/Internal/Workflow/ExternalWorkflowProxy.php @@ -32,7 +32,6 @@ class ExternalWorkflowProxy extends Proxy private string $class; private WorkflowPrototype $workflow; - private ExternalWorkflowStubInterface $stub; /** diff --git a/src/Promise.php b/src/Promise.php index 83aedbbd3..151303696 100644 --- a/src/Promise.php +++ b/src/Promise.php @@ -273,6 +273,7 @@ static function (iterable $array) use ( * * If `$promiseOrValue` is a promise, it will be returned as is. * + * @param null|mixed $promiseOrValue */ public static function resolve($promiseOrValue = null): PromiseInterface { @@ -292,6 +293,7 @@ public static function resolve($promiseOrValue = null): PromiseInterface * throwing an exception. For example, it allows you to propagate a rejection with * the value of another promise. * + * @param null|mixed $promiseOrValue * @return PromiseInterface */ public static function reject($promiseOrValue = null): PromiseInterface diff --git a/src/Worker/Transport/Codec/ProtoCodec.php b/src/Worker/Transport/Codec/ProtoCodec.php index 2dfb2259d..007da6b78 100644 --- a/src/Worker/Transport/Codec/ProtoCodec.php +++ b/src/Worker/Transport/Codec/ProtoCodec.php @@ -26,7 +26,6 @@ final class ProtoCodec implements CodecInterface { private Decoder $parser; - private Encoder $encoder; public function __construct(DataConverterInterface $dataConverter) diff --git a/src/Worker/Transport/RPCConnectionInterface.php b/src/Worker/Transport/RPCConnectionInterface.php index 560cca1d9..f058c465b 100644 --- a/src/Worker/Transport/RPCConnectionInterface.php +++ b/src/Worker/Transport/RPCConnectionInterface.php @@ -16,8 +16,9 @@ interface RPCConnectionInterface { /** - * @return mixed * + * @param mixed $payload + * @return mixed * @throws TransportException */ public function call(string $method, $payload); diff --git a/src/Worker/Worker.php b/src/Worker/Worker.php index 7800f9ace..32f736ff4 100644 --- a/src/Worker/Worker.php +++ b/src/Worker/Worker.php @@ -30,13 +30,9 @@ class Worker implements WorkerInterface, EventListenerInterface, DispatcherInter use EventEmitterTrait; private string $name; - private WorkerOptions $options; - private RouterInterface $router; - private ServiceContainer $services; - private RPCConnectionInterface $rpc; public function __construct( diff --git a/src/WorkerFactory.php b/src/WorkerFactory.php index ea064a387..b5cbd3a06 100644 --- a/src/WorkerFactory.php +++ b/src/WorkerFactory.php @@ -100,9 +100,7 @@ class WorkerFactory implements WorkerFactoryInterface, LoopInterface private const HEADER_TASK_QUEUE = 'taskQueue'; protected DataConverterInterface $converter; - protected ReaderInterface $reader; - protected RouterInterface $router; /** @@ -111,13 +109,9 @@ class WorkerFactory implements WorkerFactoryInterface, LoopInterface protected RepositoryInterface $queues; protected CodecInterface $codec; - protected ClientInterface $client; - protected ServerInterface $server; - protected QueueInterface $responses; - protected RPCConnectionInterface $rpc; /** From 3af5daf8447b1c1167756de1d84d98a7082ca328 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Tue, 5 Nov 2024 15:43:29 +0400 Subject: [PATCH 05/21] Resolve all the deprecations in tests --- phpunit.xml.dist | 6 ++++++ tests/Unit/Router/InvokeActivityTestCase.php | 1 + tests/Unit/Router/StartWorkflowTestCase.php | 2 ++ 3 files changed, 9 insertions(+) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index c2b9b8b09..d9c16f1b2 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -9,6 +9,12 @@ stopOnFailure="false" stopOnError="false" stderr="true" + displayDetailsOnIncompleteTests="true" + displayDetailsOnSkippedTests="true" + displayDetailsOnTestsThatTriggerDeprecations="true" + displayDetailsOnTestsThatTriggerErrors="true" + displayDetailsOnTestsThatTriggerNotices="true" + displayDetailsOnTestsThatTriggerWarnings="true" > diff --git a/tests/Unit/Router/InvokeActivityTestCase.php b/tests/Unit/Router/InvokeActivityTestCase.php index 8bd1b8c58..972c9f66f 100644 --- a/tests/Unit/Router/InvokeActivityTestCase.php +++ b/tests/Unit/Router/InvokeActivityTestCase.php @@ -32,6 +32,7 @@ final class InvokeActivityTestCase extends AbstractUnit { private ServiceContainer $services; private InvokeActivity $router; + private ActivityContext $activityContext; protected function setUp(): void { diff --git a/tests/Unit/Router/StartWorkflowTestCase.php b/tests/Unit/Router/StartWorkflowTestCase.php index df068592f..e5e47c93a 100644 --- a/tests/Unit/Router/StartWorkflowTestCase.php +++ b/tests/Unit/Router/StartWorkflowTestCase.php @@ -37,6 +37,8 @@ final class StartWorkflowTestCase extends AbstractUnit { private ServiceContainer $services; private StartWorkflow $router; + private WorkflowContext $workflowContext; + private MarshallerInterface $marshaller; protected function setUp(): void { From 76129b1a27c705f78a8a255c089e5e3a4d7248a1 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Tue, 5 Nov 2024 15:44:46 +0400 Subject: [PATCH 06/21] Fix deprecation on Service Client exception parsing --- src/Exception/Client/ServiceClientException.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Exception/Client/ServiceClientException.php b/src/Exception/Client/ServiceClientException.php index 9bad38e4a..e8c7eb9ae 100644 --- a/src/Exception/Client/ServiceClientException.php +++ b/src/Exception/Client/ServiceClientException.php @@ -31,7 +31,11 @@ public function __construct(\stdClass $status, \Throwable $previous = null) $this->status->mergeFromString($status->metadata['grpc-status-details-bin'][0]); } - parent::__construct($status->details . " (code: $status->code)", $status->code, $previous); + parent::__construct(\sprintf( + "%s (code: %d)", + isset($status->details) ? (string) $status->details : '', + $status->code, + ), $status->code, $previous); } public function getStatus(): Status From 6fc1cb93c72aff8c405f7ff6fe3b628a81d67ff1 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Tue, 5 Nov 2024 15:45:43 +0400 Subject: [PATCH 07/21] Deprecate `Schedule\Spec\ScheduleSpec::$excludeCalendarList` and stop hydrating it in the related protobuf message --- src/Client/Schedule/Spec/ScheduleSpec.php | 2 ++ src/Internal/Mapper/ScheduleMapper.php | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Client/Schedule/Spec/ScheduleSpec.php b/src/Client/Schedule/Spec/ScheduleSpec.php index d1a688836..7f6268183 100644 --- a/src/Client/Schedule/Spec/ScheduleSpec.php +++ b/src/Client/Schedule/Spec/ScheduleSpec.php @@ -76,6 +76,8 @@ final class ScheduleSpec * Any timestamps matching any of exclude* will be skipped. * * @var list + * + * @deprecated */ #[MarshalArray(name: 'exclude_calendar', of: CalendarSpec::class)] public readonly array $excludeCalendarList; diff --git a/src/Internal/Mapper/ScheduleMapper.php b/src/Internal/Mapper/ScheduleMapper.php index bddb2317d..3a5fdd483 100644 --- a/src/Internal/Mapper/ScheduleMapper.php +++ b/src/Internal/Mapper/ScheduleMapper.php @@ -92,10 +92,7 @@ private function prepareSpec(array $result): ScheduleSpec $result['calendar'] ?? [], ); - $result['exclude_calendar'] = \array_map( - static fn(array $item): CalendarSpec => new CalendarSpec($item), - $result['exclude_calendar'] ?? [], - ); + unset($result['exclude_calendar']); $result['interval'] = \array_map( static fn(array $item): IntervalSpec => new IntervalSpec($item), From 8da10b01addb04a989fb0803a85558ba4e341e0c Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Tue, 5 Nov 2024 15:57:45 +0400 Subject: [PATCH 08/21] Update psalm baseline --- psalm-baseline.xml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index b0bb1673b..2c82fdfb9 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -109,6 +109,12 @@ + + + excludeCalendarList]]> + excludeCalendarList]]> + + getSuccess()]]> @@ -508,7 +514,6 @@ - @@ -1218,10 +1223,6 @@ - - - - @@ -1367,11 +1368,6 @@ - - - - - getRelayAddress()]]> From 9d7225ca58ed84bb62fc308325ff7680c8ce4136 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Tue, 5 Nov 2024 16:12:20 +0400 Subject: [PATCH 09/21] Deprecate `ScheduleSpec::withExcludeCalendarList()` and `ScheduleSpec::withAddedExcludeCalendar()` methods --- src/Client/Schedule/Spec/ScheduleSpec.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Client/Schedule/Spec/ScheduleSpec.php b/src/Client/Schedule/Spec/ScheduleSpec.php index 7f6268183..6b51b0d94 100644 --- a/src/Client/Schedule/Spec/ScheduleSpec.php +++ b/src/Client/Schedule/Spec/ScheduleSpec.php @@ -246,24 +246,25 @@ public function withAddedInterval(mixed $interval): self } /** - * Returns a new instance with the replaced exclude calendar list. + * Does nothing. + * + * @deprecated This method is deprecated and will be removed in the next major release. */ public function withExcludeCalendarList(CalendarSpec ...$calendar): self { - /** @see self::$excludeCalendarList */ - return $this->with('excludeCalendarList', $calendar); + @\trigger_error('ScheduleSpec::withExcludeCalendarList() is deprecated', E_USER_DEPRECATED); + return $this; } /** - * Any timestamps matching any of exclude* will be skipped. + * Does nothing. + * + * @deprecated This method is deprecated and will be removed in the next major release. */ public function withAddedExcludeCalendar(CalendarSpec $calendar): self { - $value = $this->excludeCalendarList; - $value[] = $calendar; - - /** @see self::$excludeCalendarList */ - return $this->with('excludeCalendarList', $value); + @\trigger_error('ScheduleSpec::withAddedExcludeCalendar() is deprecated', E_USER_DEPRECATED); + return $this; } /** From 3a564a93716f8156826e62cfe346be7540668de5 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Tue, 5 Nov 2024 16:14:37 +0400 Subject: [PATCH 10/21] CI: run windows tests with protobuf ext only --- .github/workflows/run-test-suite.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/run-test-suite.yml b/.github/workflows/run-test-suite.yml index 2162c7a41..3abf00c31 100644 --- a/.github/workflows/run-test-suite.yml +++ b/.github/workflows/run-test-suite.yml @@ -48,17 +48,14 @@ jobs: fail-fast: ${{ inputs.fail-fast }} matrix: php: [ 8.1, 8.2, 8.3 ] - os: [ ubuntu-latest, windows-latest ] + os: [ ubuntu-latest ] extensions-suffix: [ '', ', protobuf' ] dependencies: [ lowest , highest ] timeout-minutes: [ '${{ inputs.test-timeout }}' ] - exclude: - - os: windows-latest - php: 8.2 + include: - os: windows-latest extensions-suffix: ', protobuf' - - os: windows-latest - php: 8.3 + php: 8.1 steps: - name: Set Git To Use LF run: | From ca4a595098a159eb53807865cce24319a246f28b Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Tue, 5 Nov 2024 16:17:42 +0400 Subject: [PATCH 11/21] Update psalm baseline --- psalm-baseline.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 2c82fdfb9..b45183d02 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -112,7 +112,6 @@ excludeCalendarList]]> - excludeCalendarList]]> From 9397729e9c7416663310fb6aef721e41b30410eb Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Thu, 7 Nov 2024 16:59:10 +0400 Subject: [PATCH 12/21] Revert some changes in ScheduleSpec and its mapper --- psalm-baseline.xml | 1 + src/Client/Schedule/Spec/ScheduleSpec.php | 14 ++++++++++---- src/Internal/Mapper/ScheduleMapper.php | 5 ++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index b45183d02..2c82fdfb9 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -112,6 +112,7 @@ excludeCalendarList]]> + excludeCalendarList]]> diff --git a/src/Client/Schedule/Spec/ScheduleSpec.php b/src/Client/Schedule/Spec/ScheduleSpec.php index 6b51b0d94..5e6c74047 100644 --- a/src/Client/Schedule/Spec/ScheduleSpec.php +++ b/src/Client/Schedule/Spec/ScheduleSpec.php @@ -246,25 +246,31 @@ public function withAddedInterval(mixed $interval): self } /** - * Does nothing. + * Returns a new instance with the replaced exclude calendar list. * * @deprecated This method is deprecated and will be removed in the next major release. */ public function withExcludeCalendarList(CalendarSpec ...$calendar): self { @\trigger_error('ScheduleSpec::withExcludeCalendarList() is deprecated', E_USER_DEPRECATED); - return $this; + + /** @see self::$excludeCalendarList */ + return $this->with('excludeCalendarList', $calendar); } /** - * Does nothing. + * Any timestamps matching any of exclude* will be skipped. * * @deprecated This method is deprecated and will be removed in the next major release. */ public function withAddedExcludeCalendar(CalendarSpec $calendar): self { @\trigger_error('ScheduleSpec::withAddedExcludeCalendar() is deprecated', E_USER_DEPRECATED); - return $this; + $value = $this->excludeCalendarList; + $value[] = $calendar; + + /** @see self::$excludeCalendarList */ + return $this->with('excludeCalendarList', $value); } /** diff --git a/src/Internal/Mapper/ScheduleMapper.php b/src/Internal/Mapper/ScheduleMapper.php index 3a5fdd483..bddb2317d 100644 --- a/src/Internal/Mapper/ScheduleMapper.php +++ b/src/Internal/Mapper/ScheduleMapper.php @@ -92,7 +92,10 @@ private function prepareSpec(array $result): ScheduleSpec $result['calendar'] ?? [], ); - unset($result['exclude_calendar']); + $result['exclude_calendar'] = \array_map( + static fn(array $item): CalendarSpec => new CalendarSpec($item), + $result['exclude_calendar'] ?? [], + ); $result['interval'] = \array_map( static fn(array $item): IntervalSpec => new IntervalSpec($item), From ee90e67b3c761dbbc98fa6152f665961613baebc Mon Sep 17 00:00:00 2001 From: Aleksei Gagarin Date: Thu, 7 Nov 2024 21:25:11 +0400 Subject: [PATCH 13/21] Fix intervals between retries in Client API calls (#525) --- src/Client/GRPC/BaseClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client/GRPC/BaseClient.php b/src/Client/GRPC/BaseClient.php index 78cc3ef40..7b96da827 100644 --- a/src/Client/GRPC/BaseClient.php +++ b/src/Client/GRPC/BaseClient.php @@ -328,7 +328,7 @@ private function call(string $method, object $arg, ContextInterface $ctx): objec ? $congestionInitialIntervalMs : $initialIntervalMs; - $wait = $throttler->calculateSleepTime(failureCount: $attempt, initialInterval: $baseInterval); + $wait = $throttler->calculateSleepTime(failureCount: $attempt, initialInterval: $baseInterval) * 1000; // wait till the next call $this->usleep($wait); From 0dba1250937b881df57e4ee8efb79ad09e8e9483 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Mon, 9 Dec 2024 14:10:16 +0400 Subject: [PATCH 14/21] Fix PHP8.4 nullable types deprecations --- src/Activity/ActivityMethod.php | 2 +- src/Activity/ActivityOptions.php | 2 +- src/Activity/ActivityOptionsInterface.php | 2 +- src/Activity/LocalActivityOptions.php | 2 +- src/Client/GRPC/BaseClient.php | 8 +- src/Client/GRPC/ServiceClient.php | 124 +++++++++--------- src/Client/ScheduleClient.php | 8 +- src/Client/WorkflowClient.php | 16 +-- src/Client/WorkflowClientInterface.php | 4 +- src/Client/WorkflowOptions.php | 2 +- src/Common/RetryOptions.php | 2 +- src/DataConverter/EncodedValues.php | 4 +- src/DataConverter/JsonConverter.php | 2 +- src/DataConverter/Type.php | 2 +- .../Client/ActivityCompletionException.php | 2 +- .../Client/ServiceClientException.php | 2 +- src/Exception/Client/WorkflowException.php | 8 +- ...rkflowExecutionAlreadyStartedException.php | 4 +- .../Client/WorkflowFailedException.php | 2 +- .../Client/WorkflowQueryRejectedException.php | 2 +- src/Exception/Failure/ActivityFailure.php | 2 +- src/Exception/Failure/ApplicationFailure.php | 4 +- src/Exception/Failure/CanceledFailure.php | 2 +- .../Failure/ChildWorkflowFailure.php | 2 +- src/Exception/Failure/ServerFailure.php | 2 +- src/Exception/Failure/TemporalFailure.php | 2 +- src/Exception/Failure/TerminatedFailure.php | 2 +- src/Exception/Failure/TimeoutFailure.php | 2 +- .../ActivityInbound/ActivityInput.php | 4 +- .../WorkflowClient/CancelInput.php | 2 +- .../WorkflowClient/DescribeInput.php | 4 +- .../WorkflowClient/GetResultInput.php | 6 +- src/Interceptor/WorkflowClient/QueryInput.php | 6 +- .../WorkflowClient/SignalInput.php | 4 +- .../WorkflowClient/SignalWithStartInput.php | 6 +- src/Interceptor/WorkflowClient/StartInput.php | 6 +- .../WorkflowClient/TerminateInput.php | 4 +- .../WorkflowInbound/QueryInput.php | 2 +- .../WorkflowInbound/SignalInput.php | 6 +- .../WorkflowInbound/UpdateInput.php | 6 +- .../WorkflowInbound/WorkflowInput.php | 6 +- src/Internal/Activity/ActivityContext.php | 2 +- src/Internal/Client/WorkflowRun.php | 2 +- src/Internal/Client/WorkflowStub.php | 6 +- src/Internal/Marshaller/Meta/MarshalArray.php | 2 +- .../Marshaller/Meta/MarshalAssocArray.php | 2 +- .../Marshaller/Meta/MarshalDateTime.php | 2 +- .../Marshaller/Meta/MarshalNullable.php | 2 +- src/Internal/Marshaller/Meta/MarshalOneOf.php | 2 +- src/Internal/Marshaller/Type/ArrayType.php | 2 +- .../Marshaller/Type/AssocArrayType.php | 2 +- src/Internal/Marshaller/Type/EnumType.php | 2 +- src/Internal/Marshaller/Type/NullableType.php | 2 +- src/Internal/Marshaller/Type/ObjectType.php | 2 +- src/Internal/Support/DateInterval.php | 2 +- src/Internal/Support/Diff.php | 4 +- .../Transport/Request/CompleteWorkflow.php | 2 +- src/Internal/Transport/Request/Panic.php | 2 +- .../Request/SignalExternalWorkflow.php | 2 +- src/Internal/Workflow/ActivityStub.php | 2 +- src/Internal/Workflow/Input.php | 2 +- src/Internal/Workflow/Process/Scope.php | 14 +- src/Internal/Workflow/WorkflowContext.php | 22 ++-- .../ActivityInvocationResult.php | 2 +- .../InMemoryActivityInvocationCache.php | 2 +- .../RoadRunnerActivityInvocationCache.php | 4 +- .../Transport/Command/Client/Request.php | 2 +- src/Worker/Transport/Goridge.php | 2 +- src/Worker/Transport/RoadRunner.php | 6 +- src/Worker/Worker.php | 2 +- src/Worker/WorkerFactoryInterface.php | 2 +- src/Worker/WorkerInterface.php | 2 +- src/WorkerFactory.php | 12 +- src/Workflow.php | 18 +-- src/Workflow/ActivityStubInterface.php | 2 +- src/Workflow/WorkflowContextInterface.php | 22 ++-- src/Workflow/WorkflowExecution.php | 2 +- src/Workflow/WorkflowMethod.php | 2 +- src/Workflow/WorkflowRunInterface.php | 2 +- testing/src/ActivityMocker.php | 2 +- testing/src/Environment.php | 4 +- testing/src/WorkerFactory.php | 6 +- testing/src/WorkerMock.php | 2 +- 83 files changed, 230 insertions(+), 230 deletions(-) diff --git a/src/Activity/ActivityMethod.php b/src/Activity/ActivityMethod.php index e78823366..4942402b1 100644 --- a/src/Activity/ActivityMethod.php +++ b/src/Activity/ActivityMethod.php @@ -33,7 +33,7 @@ final class ActivityMethod #[Immutable] public ?string $name = null; - public function __construct(string $name = null) + public function __construct(?string $name = null) { $this->name = $name; } diff --git a/src/Activity/ActivityOptions.php b/src/Activity/ActivityOptions.php index a6efee905..4c08cad42 100644 --- a/src/Activity/ActivityOptions.php +++ b/src/Activity/ActivityOptions.php @@ -125,7 +125,7 @@ public function __construct() /** * @return $this */ - public function mergeWith(MethodRetry $retry = null): self + public function mergeWith(?MethodRetry $retry = null): self { $self = clone $this; diff --git a/src/Activity/ActivityOptionsInterface.php b/src/Activity/ActivityOptionsInterface.php index 895c6eaf0..c3caf5f20 100644 --- a/src/Activity/ActivityOptionsInterface.php +++ b/src/Activity/ActivityOptionsInterface.php @@ -11,5 +11,5 @@ */ interface ActivityOptionsInterface { - public function mergeWith(MethodRetry $retry = null): self; + public function mergeWith(?MethodRetry $retry = null): self; } diff --git a/src/Activity/LocalActivityOptions.php b/src/Activity/LocalActivityOptions.php index 441e5f32b..4099b1bd2 100644 --- a/src/Activity/LocalActivityOptions.php +++ b/src/Activity/LocalActivityOptions.php @@ -81,7 +81,7 @@ public function __construct() /** * @return $this */ - public function mergeWith(MethodRetry $retry = null): self + public function mergeWith(?MethodRetry $retry = null): self { $self = clone $this; diff --git a/src/Client/GRPC/BaseClient.php b/src/Client/GRPC/BaseClient.php index 7b96da827..1ecb88039 100644 --- a/src/Client/GRPC/BaseClient.php +++ b/src/Client/GRPC/BaseClient.php @@ -91,10 +91,10 @@ public static function create(string $address): static */ public static function createSSL( string $address, - string $crt = null, - string $clientKey = null, - string $clientPem = null, - string $overrideServerName = null, + ?string $crt = null, + ?string $clientKey = null, + ?string $clientPem = null, + ?string $overrideServerName = null, ): static { if (!\extension_loaded('grpc')) { throw new \RuntimeException('The gRPC extension is required to use Temporal Client.'); diff --git a/src/Client/GRPC/ServiceClient.php b/src/Client/GRPC/ServiceClient.php index bdeedc2ca..8e67be3a9 100644 --- a/src/Client/GRPC/ServiceClient.php +++ b/src/Client/GRPC/ServiceClient.php @@ -29,7 +29,7 @@ class ServiceClient extends BaseClient * * @throws ServiceClientException */ - public function RegisterNamespace(V1\RegisterNamespaceRequest $arg, ContextInterface $ctx = null): V1\RegisterNamespaceResponse + public function RegisterNamespace(V1\RegisterNamespaceRequest $arg, ?ContextInterface $ctx = null): V1\RegisterNamespaceResponse { return $this->invoke("RegisterNamespace", $arg, $ctx); } @@ -40,7 +40,7 @@ public function RegisterNamespace(V1\RegisterNamespaceRequest $arg, ContextInter * * @throws ServiceClientException */ - public function DescribeNamespace(V1\DescribeNamespaceRequest $arg, ContextInterface $ctx = null): V1\DescribeNamespaceResponse + public function DescribeNamespace(V1\DescribeNamespaceRequest $arg, ?ContextInterface $ctx = null): V1\DescribeNamespaceResponse { return $this->invoke("DescribeNamespace", $arg, $ctx); } @@ -50,7 +50,7 @@ public function DescribeNamespace(V1\DescribeNamespaceRequest $arg, ContextInter * * @throws ServiceClientException */ - public function ListNamespaces(V1\ListNamespacesRequest $arg, ContextInterface $ctx = null): V1\ListNamespacesResponse + public function ListNamespaces(V1\ListNamespacesRequest $arg, ?ContextInterface $ctx = null): V1\ListNamespacesResponse { return $this->invoke("ListNamespaces", $arg, $ctx); } @@ -62,7 +62,7 @@ public function ListNamespaces(V1\ListNamespacesRequest $arg, ContextInterface $ * * @throws ServiceClientException */ - public function UpdateNamespace(V1\UpdateNamespaceRequest $arg, ContextInterface $ctx = null): V1\UpdateNamespaceResponse + public function UpdateNamespace(V1\UpdateNamespaceRequest $arg, ?ContextInterface $ctx = null): V1\UpdateNamespaceResponse { return $this->invoke("UpdateNamespace", $arg, $ctx); } @@ -81,7 +81,7 @@ public function UpdateNamespace(V1\UpdateNamespaceRequest $arg, ContextInterface * * @throws ServiceClientException */ - public function DeprecateNamespace(V1\DeprecateNamespaceRequest $arg, ContextInterface $ctx = null): V1\DeprecateNamespaceResponse + public function DeprecateNamespace(V1\DeprecateNamespaceRequest $arg, ?ContextInterface $ctx = null): V1\DeprecateNamespaceResponse { return $this->invoke("DeprecateNamespace", $arg, $ctx); } @@ -97,7 +97,7 @@ public function DeprecateNamespace(V1\DeprecateNamespaceRequest $arg, ContextInt * * @throws ServiceClientException */ - public function StartWorkflowExecution(V1\StartWorkflowExecutionRequest $arg, ContextInterface $ctx = null): V1\StartWorkflowExecutionResponse + public function StartWorkflowExecution(V1\StartWorkflowExecutionRequest $arg, ?ContextInterface $ctx = null): V1\StartWorkflowExecutionResponse { return $this->invoke("StartWorkflowExecution", $arg, $ctx); } @@ -109,7 +109,7 @@ public function StartWorkflowExecution(V1\StartWorkflowExecutionRequest $arg, Co * * @throws ServiceClientException */ - public function GetWorkflowExecutionHistory(V1\GetWorkflowExecutionHistoryRequest $arg, ContextInterface $ctx = null): V1\GetWorkflowExecutionHistoryResponse + public function GetWorkflowExecutionHistory(V1\GetWorkflowExecutionHistoryRequest $arg, ?ContextInterface $ctx = null): V1\GetWorkflowExecutionHistoryResponse { return $this->invoke("GetWorkflowExecutionHistory", $arg, $ctx); } @@ -123,7 +123,7 @@ public function GetWorkflowExecutionHistory(V1\GetWorkflowExecutionHistoryReques * * @throws ServiceClientException */ - public function GetWorkflowExecutionHistoryReverse(V1\GetWorkflowExecutionHistoryReverseRequest $arg, ContextInterface $ctx = null): V1\GetWorkflowExecutionHistoryReverseResponse + public function GetWorkflowExecutionHistoryReverse(V1\GetWorkflowExecutionHistoryReverseRequest $arg, ?ContextInterface $ctx = null): V1\GetWorkflowExecutionHistoryReverseResponse { return $this->invoke("GetWorkflowExecutionHistoryReverse", $arg, $ctx); } @@ -144,7 +144,7 @@ public function GetWorkflowExecutionHistoryReverse(V1\GetWorkflowExecutionHistor * * @throws ServiceClientException */ - public function PollWorkflowTaskQueue(V1\PollWorkflowTaskQueueRequest $arg, ContextInterface $ctx = null): V1\PollWorkflowTaskQueueResponse + public function PollWorkflowTaskQueue(V1\PollWorkflowTaskQueueRequest $arg, ?ContextInterface $ctx = null): V1\PollWorkflowTaskQueueResponse { return $this->invoke("PollWorkflowTaskQueue", $arg, $ctx); } @@ -165,7 +165,7 @@ public function PollWorkflowTaskQueue(V1\PollWorkflowTaskQueueRequest $arg, Cont * * @throws ServiceClientException */ - public function RespondWorkflowTaskCompleted(V1\RespondWorkflowTaskCompletedRequest $arg, ContextInterface $ctx = null): V1\RespondWorkflowTaskCompletedResponse + public function RespondWorkflowTaskCompleted(V1\RespondWorkflowTaskCompletedRequest $arg, ?ContextInterface $ctx = null): V1\RespondWorkflowTaskCompletedResponse { return $this->invoke("RespondWorkflowTaskCompleted", $arg, $ctx); } @@ -190,7 +190,7 @@ public function RespondWorkflowTaskCompleted(V1\RespondWorkflowTaskCompletedRequ * * @throws ServiceClientException */ - public function RespondWorkflowTaskFailed(V1\RespondWorkflowTaskFailedRequest $arg, ContextInterface $ctx = null): V1\RespondWorkflowTaskFailedResponse + public function RespondWorkflowTaskFailed(V1\RespondWorkflowTaskFailedRequest $arg, ?ContextInterface $ctx = null): V1\RespondWorkflowTaskFailedResponse { return $this->invoke("RespondWorkflowTaskFailed", $arg, $ctx); } @@ -221,7 +221,7 @@ public function RespondWorkflowTaskFailed(V1\RespondWorkflowTaskFailedRequest $a * * @throws ServiceClientException */ - public function PollActivityTaskQueue(V1\PollActivityTaskQueueRequest $arg, ContextInterface $ctx = null): V1\PollActivityTaskQueueResponse + public function PollActivityTaskQueue(V1\PollActivityTaskQueueRequest $arg, ?ContextInterface $ctx = null): V1\PollActivityTaskQueueResponse { return $this->invoke("PollActivityTaskQueue", $arg, $ctx); } @@ -241,7 +241,7 @@ public function PollActivityTaskQueue(V1\PollActivityTaskQueueRequest $arg, Cont * * @throws ServiceClientException */ - public function RecordActivityTaskHeartbeat(V1\RecordActivityTaskHeartbeatRequest $arg, ContextInterface $ctx = null): V1\RecordActivityTaskHeartbeatResponse + public function RecordActivityTaskHeartbeat(V1\RecordActivityTaskHeartbeatRequest $arg, ?ContextInterface $ctx = null): V1\RecordActivityTaskHeartbeatResponse { return $this->invoke("RecordActivityTaskHeartbeat", $arg, $ctx); } @@ -256,7 +256,7 @@ public function RecordActivityTaskHeartbeat(V1\RecordActivityTaskHeartbeatReques * * @throws ServiceClientException */ - public function RecordActivityTaskHeartbeatById(V1\RecordActivityTaskHeartbeatByIdRequest $arg, ContextInterface $ctx = null): V1\RecordActivityTaskHeartbeatByIdResponse + public function RecordActivityTaskHeartbeatById(V1\RecordActivityTaskHeartbeatByIdRequest $arg, ?ContextInterface $ctx = null): V1\RecordActivityTaskHeartbeatByIdResponse { return $this->invoke("RecordActivityTaskHeartbeatById", $arg, $ctx); } @@ -275,7 +275,7 @@ public function RecordActivityTaskHeartbeatById(V1\RecordActivityTaskHeartbeatBy * * @throws ServiceClientException */ - public function RespondActivityTaskCompleted(V1\RespondActivityTaskCompletedRequest $arg, ContextInterface $ctx = null): V1\RespondActivityTaskCompletedResponse + public function RespondActivityTaskCompleted(V1\RespondActivityTaskCompletedRequest $arg, ?ContextInterface $ctx = null): V1\RespondActivityTaskCompletedResponse { return $this->invoke("RespondActivityTaskCompleted", $arg, $ctx); } @@ -290,7 +290,7 @@ public function RespondActivityTaskCompleted(V1\RespondActivityTaskCompletedRequ * * @throws ServiceClientException */ - public function RespondActivityTaskCompletedById(V1\RespondActivityTaskCompletedByIdRequest $arg, ContextInterface $ctx = null): V1\RespondActivityTaskCompletedByIdResponse + public function RespondActivityTaskCompletedById(V1\RespondActivityTaskCompletedByIdRequest $arg, ?ContextInterface $ctx = null): V1\RespondActivityTaskCompletedByIdResponse { return $this->invoke("RespondActivityTaskCompletedById", $arg, $ctx); } @@ -308,7 +308,7 @@ public function RespondActivityTaskCompletedById(V1\RespondActivityTaskCompleted * * @throws ServiceClientException */ - public function RespondActivityTaskFailed(V1\RespondActivityTaskFailedRequest $arg, ContextInterface $ctx = null): V1\RespondActivityTaskFailedResponse + public function RespondActivityTaskFailed(V1\RespondActivityTaskFailedRequest $arg, ?ContextInterface $ctx = null): V1\RespondActivityTaskFailedResponse { return $this->invoke("RespondActivityTaskFailed", $arg, $ctx); } @@ -323,7 +323,7 @@ public function RespondActivityTaskFailed(V1\RespondActivityTaskFailedRequest $a * * @throws ServiceClientException */ - public function RespondActivityTaskFailedById(V1\RespondActivityTaskFailedByIdRequest $arg, ContextInterface $ctx = null): V1\RespondActivityTaskFailedByIdResponse + public function RespondActivityTaskFailedById(V1\RespondActivityTaskFailedByIdRequest $arg, ?ContextInterface $ctx = null): V1\RespondActivityTaskFailedByIdResponse { return $this->invoke("RespondActivityTaskFailedById", $arg, $ctx); } @@ -341,7 +341,7 @@ public function RespondActivityTaskFailedById(V1\RespondActivityTaskFailedByIdRe * * @throws ServiceClientException */ - public function RespondActivityTaskCanceled(V1\RespondActivityTaskCanceledRequest $arg, ContextInterface $ctx = null): V1\RespondActivityTaskCanceledResponse + public function RespondActivityTaskCanceled(V1\RespondActivityTaskCanceledRequest $arg, ?ContextInterface $ctx = null): V1\RespondActivityTaskCanceledResponse { return $this->invoke("RespondActivityTaskCanceled", $arg, $ctx); } @@ -356,7 +356,7 @@ public function RespondActivityTaskCanceled(V1\RespondActivityTaskCanceledReques * * @throws ServiceClientException */ - public function RespondActivityTaskCanceledById(V1\RespondActivityTaskCanceledByIdRequest $arg, ContextInterface $ctx = null): V1\RespondActivityTaskCanceledByIdResponse + public function RespondActivityTaskCanceledById(V1\RespondActivityTaskCanceledByIdRequest $arg, ?ContextInterface $ctx = null): V1\RespondActivityTaskCanceledByIdResponse { return $this->invoke("RespondActivityTaskCanceledById", $arg, $ctx); } @@ -375,7 +375,7 @@ public function RespondActivityTaskCanceledById(V1\RespondActivityTaskCanceledBy * * @throws ServiceClientException */ - public function RequestCancelWorkflowExecution(V1\RequestCancelWorkflowExecutionRequest $arg, ContextInterface $ctx = null): V1\RequestCancelWorkflowExecutionResponse + public function RequestCancelWorkflowExecution(V1\RequestCancelWorkflowExecutionRequest $arg, ?ContextInterface $ctx = null): V1\RequestCancelWorkflowExecutionResponse { return $this->invoke("RequestCancelWorkflowExecution", $arg, $ctx); } @@ -390,7 +390,7 @@ public function RequestCancelWorkflowExecution(V1\RequestCancelWorkflowExecution * * @throws ServiceClientException */ - public function SignalWorkflowExecution(V1\SignalWorkflowExecutionRequest $arg, ContextInterface $ctx = null): V1\SignalWorkflowExecutionResponse + public function SignalWorkflowExecution(V1\SignalWorkflowExecutionRequest $arg, ?ContextInterface $ctx = null): V1\SignalWorkflowExecutionResponse { return $this->invoke("SignalWorkflowExecution", $arg, $ctx); } @@ -414,7 +414,7 @@ public function SignalWorkflowExecution(V1\SignalWorkflowExecutionRequest $arg, * * @throws ServiceClientException */ - public function SignalWithStartWorkflowExecution(V1\SignalWithStartWorkflowExecutionRequest $arg, ContextInterface $ctx = null): V1\SignalWithStartWorkflowExecutionResponse + public function SignalWithStartWorkflowExecution(V1\SignalWithStartWorkflowExecutionRequest $arg, ?ContextInterface $ctx = null): V1\SignalWithStartWorkflowExecutionResponse { return $this->invoke("SignalWithStartWorkflowExecution", $arg, $ctx); } @@ -429,7 +429,7 @@ public function SignalWithStartWorkflowExecution(V1\SignalWithStartWorkflowExecu * * @throws ServiceClientException */ - public function ResetWorkflowExecution(V1\ResetWorkflowExecutionRequest $arg, ContextInterface $ctx = null): V1\ResetWorkflowExecutionResponse + public function ResetWorkflowExecution(V1\ResetWorkflowExecutionRequest $arg, ?ContextInterface $ctx = null): V1\ResetWorkflowExecutionResponse { return $this->invoke("ResetWorkflowExecution", $arg, $ctx); } @@ -443,7 +443,7 @@ public function ResetWorkflowExecution(V1\ResetWorkflowExecutionRequest $arg, Co * * @throws ServiceClientException */ - public function TerminateWorkflowExecution(V1\TerminateWorkflowExecutionRequest $arg, ContextInterface $ctx = null): V1\TerminateWorkflowExecutionResponse + public function TerminateWorkflowExecution(V1\TerminateWorkflowExecutionRequest $arg, ?ContextInterface $ctx = null): V1\TerminateWorkflowExecutionResponse { return $this->invoke("TerminateWorkflowExecution", $arg, $ctx); } @@ -462,7 +462,7 @@ public function TerminateWorkflowExecution(V1\TerminateWorkflowExecutionRequest * * @throws ServiceClientException */ - public function DeleteWorkflowExecution(V1\DeleteWorkflowExecutionRequest $arg, ContextInterface $ctx = null): V1\DeleteWorkflowExecutionResponse + public function DeleteWorkflowExecution(V1\DeleteWorkflowExecutionRequest $arg, ?ContextInterface $ctx = null): V1\DeleteWorkflowExecutionResponse { return $this->invoke("DeleteWorkflowExecution", $arg, $ctx); } @@ -476,7 +476,7 @@ public function DeleteWorkflowExecution(V1\DeleteWorkflowExecutionRequest $arg, * * @throws ServiceClientException */ - public function ListOpenWorkflowExecutions(V1\ListOpenWorkflowExecutionsRequest $arg, ContextInterface $ctx = null): V1\ListOpenWorkflowExecutionsResponse + public function ListOpenWorkflowExecutions(V1\ListOpenWorkflowExecutionsRequest $arg, ?ContextInterface $ctx = null): V1\ListOpenWorkflowExecutionsResponse { return $this->invoke("ListOpenWorkflowExecutions", $arg, $ctx); } @@ -490,7 +490,7 @@ public function ListOpenWorkflowExecutions(V1\ListOpenWorkflowExecutionsRequest * * @throws ServiceClientException */ - public function ListClosedWorkflowExecutions(V1\ListClosedWorkflowExecutionsRequest $arg, ContextInterface $ctx = null): V1\ListClosedWorkflowExecutionsResponse + public function ListClosedWorkflowExecutions(V1\ListClosedWorkflowExecutionsRequest $arg, ?ContextInterface $ctx = null): V1\ListClosedWorkflowExecutionsResponse { return $this->invoke("ListClosedWorkflowExecutions", $arg, $ctx); } @@ -501,7 +501,7 @@ public function ListClosedWorkflowExecutions(V1\ListClosedWorkflowExecutionsRequ * * @throws ServiceClientException */ - public function ListWorkflowExecutions(V1\ListWorkflowExecutionsRequest $arg, ContextInterface $ctx = null): V1\ListWorkflowExecutionsResponse + public function ListWorkflowExecutions(V1\ListWorkflowExecutionsRequest $arg, ?ContextInterface $ctx = null): V1\ListWorkflowExecutionsResponse { return $this->invoke("ListWorkflowExecutions", $arg, $ctx); } @@ -512,7 +512,7 @@ public function ListWorkflowExecutions(V1\ListWorkflowExecutionsRequest $arg, Co * * @throws ServiceClientException */ - public function ListArchivedWorkflowExecutions(V1\ListArchivedWorkflowExecutionsRequest $arg, ContextInterface $ctx = null): V1\ListArchivedWorkflowExecutionsResponse + public function ListArchivedWorkflowExecutions(V1\ListArchivedWorkflowExecutionsRequest $arg, ?ContextInterface $ctx = null): V1\ListArchivedWorkflowExecutionsResponse { return $this->invoke("ListArchivedWorkflowExecutions", $arg, $ctx); } @@ -526,7 +526,7 @@ public function ListArchivedWorkflowExecutions(V1\ListArchivedWorkflowExecutions * * @throws ServiceClientException */ - public function ScanWorkflowExecutions(V1\ScanWorkflowExecutionsRequest $arg, ContextInterface $ctx = null): V1\ScanWorkflowExecutionsResponse + public function ScanWorkflowExecutions(V1\ScanWorkflowExecutionsRequest $arg, ?ContextInterface $ctx = null): V1\ScanWorkflowExecutionsResponse { return $this->invoke("ScanWorkflowExecutions", $arg, $ctx); } @@ -537,7 +537,7 @@ public function ScanWorkflowExecutions(V1\ScanWorkflowExecutionsRequest $arg, Co * * @throws ServiceClientException */ - public function CountWorkflowExecutions(V1\CountWorkflowExecutionsRequest $arg, ContextInterface $ctx = null): V1\CountWorkflowExecutionsResponse + public function CountWorkflowExecutions(V1\CountWorkflowExecutionsRequest $arg, ?ContextInterface $ctx = null): V1\CountWorkflowExecutionsResponse { return $this->invoke("CountWorkflowExecutions", $arg, $ctx); } @@ -552,7 +552,7 @@ public function CountWorkflowExecutions(V1\CountWorkflowExecutionsRequest $arg, * * @throws ServiceClientException */ - public function GetSearchAttributes(V1\GetSearchAttributesRequest $arg, ContextInterface $ctx = null): V1\GetSearchAttributesResponse + public function GetSearchAttributes(V1\GetSearchAttributesRequest $arg, ?ContextInterface $ctx = null): V1\GetSearchAttributesResponse { return $this->invoke("GetSearchAttributes", $arg, $ctx); } @@ -571,7 +571,7 @@ public function GetSearchAttributes(V1\GetSearchAttributesRequest $arg, ContextI * * @throws ServiceClientException */ - public function RespondQueryTaskCompleted(V1\RespondQueryTaskCompletedRequest $arg, ContextInterface $ctx = null): V1\RespondQueryTaskCompletedResponse + public function RespondQueryTaskCompleted(V1\RespondQueryTaskCompletedRequest $arg, ?ContextInterface $ctx = null): V1\RespondQueryTaskCompletedResponse { return $this->invoke("RespondQueryTaskCompleted", $arg, $ctx); } @@ -592,7 +592,7 @@ public function RespondQueryTaskCompleted(V1\RespondQueryTaskCompletedRequest $a * * @throws ServiceClientException */ - public function ResetStickyTaskQueue(V1\ResetStickyTaskQueueRequest $arg, ContextInterface $ctx = null): V1\ResetStickyTaskQueueResponse + public function ResetStickyTaskQueue(V1\ResetStickyTaskQueueRequest $arg, ?ContextInterface $ctx = null): V1\ResetStickyTaskQueueResponse { return $this->invoke("ResetStickyTaskQueue", $arg, $ctx); } @@ -602,7 +602,7 @@ public function ResetStickyTaskQueue(V1\ResetStickyTaskQueueRequest $arg, Contex * * @throws ServiceClientException */ - public function QueryWorkflow(V1\QueryWorkflowRequest $arg, ContextInterface $ctx = null): V1\QueryWorkflowResponse + public function QueryWorkflow(V1\QueryWorkflowRequest $arg, ?ContextInterface $ctx = null): V1\QueryWorkflowResponse { return $this->invoke("QueryWorkflow", $arg, $ctx); } @@ -613,7 +613,7 @@ public function QueryWorkflow(V1\QueryWorkflowRequest $arg, ContextInterface $ct * * @throws ServiceClientException */ - public function DescribeWorkflowExecution(V1\DescribeWorkflowExecutionRequest $arg, ContextInterface $ctx = null): V1\DescribeWorkflowExecutionResponse + public function DescribeWorkflowExecution(V1\DescribeWorkflowExecutionRequest $arg, ?ContextInterface $ctx = null): V1\DescribeWorkflowExecutionResponse { return $this->invoke("DescribeWorkflowExecution", $arg, $ctx); } @@ -627,7 +627,7 @@ public function DescribeWorkflowExecution(V1\DescribeWorkflowExecutionRequest $a * * @throws ServiceClientException */ - public function DescribeTaskQueue(V1\DescribeTaskQueueRequest $arg, ContextInterface $ctx = null): V1\DescribeTaskQueueResponse + public function DescribeTaskQueue(V1\DescribeTaskQueueRequest $arg, ?ContextInterface $ctx = null): V1\DescribeTaskQueueResponse { return $this->invoke("DescribeTaskQueue", $arg, $ctx); } @@ -637,7 +637,7 @@ public function DescribeTaskQueue(V1\DescribeTaskQueueRequest $arg, ContextInter * * @throws ServiceClientException */ - public function GetClusterInfo(V1\GetClusterInfoRequest $arg, ContextInterface $ctx = null): V1\GetClusterInfoResponse + public function GetClusterInfo(V1\GetClusterInfoRequest $arg, ?ContextInterface $ctx = null): V1\GetClusterInfoResponse { return $this->invoke("GetClusterInfo", $arg, $ctx); } @@ -647,7 +647,7 @@ public function GetClusterInfo(V1\GetClusterInfoRequest $arg, ContextInterface $ * * @throws ServiceClientException */ - public function GetSystemInfo(V1\GetSystemInfoRequest $arg, ContextInterface $ctx = null): V1\GetSystemInfoResponse + public function GetSystemInfo(V1\GetSystemInfoRequest $arg, ?ContextInterface $ctx = null): V1\GetSystemInfoResponse { return $this->invoke("GetSystemInfo", $arg, $ctx); } @@ -658,7 +658,7 @@ public function GetSystemInfo(V1\GetSystemInfoRequest $arg, ContextInterface $ct * * @throws ServiceClientException */ - public function ListTaskQueuePartitions(V1\ListTaskQueuePartitionsRequest $arg, ContextInterface $ctx = null): V1\ListTaskQueuePartitionsResponse + public function ListTaskQueuePartitions(V1\ListTaskQueuePartitionsRequest $arg, ?ContextInterface $ctx = null): V1\ListTaskQueuePartitionsResponse { return $this->invoke("ListTaskQueuePartitions", $arg, $ctx); } @@ -668,7 +668,7 @@ public function ListTaskQueuePartitions(V1\ListTaskQueuePartitionsRequest $arg, * * @throws ServiceClientException */ - public function CreateSchedule(V1\CreateScheduleRequest $arg, ContextInterface $ctx = null): V1\CreateScheduleResponse + public function CreateSchedule(V1\CreateScheduleRequest $arg, ?ContextInterface $ctx = null): V1\CreateScheduleResponse { return $this->invoke("CreateSchedule", $arg, $ctx); } @@ -678,7 +678,7 @@ public function CreateSchedule(V1\CreateScheduleRequest $arg, ContextInterface $ * * @throws ServiceClientException */ - public function DescribeSchedule(V1\DescribeScheduleRequest $arg, ContextInterface $ctx = null): V1\DescribeScheduleResponse + public function DescribeSchedule(V1\DescribeScheduleRequest $arg, ?ContextInterface $ctx = null): V1\DescribeScheduleResponse { return $this->invoke("DescribeSchedule", $arg, $ctx); } @@ -688,7 +688,7 @@ public function DescribeSchedule(V1\DescribeScheduleRequest $arg, ContextInterfa * * @throws ServiceClientException */ - public function UpdateSchedule(V1\UpdateScheduleRequest $arg, ContextInterface $ctx = null): V1\UpdateScheduleResponse + public function UpdateSchedule(V1\UpdateScheduleRequest $arg, ?ContextInterface $ctx = null): V1\UpdateScheduleResponse { return $this->invoke("UpdateSchedule", $arg, $ctx); } @@ -698,7 +698,7 @@ public function UpdateSchedule(V1\UpdateScheduleRequest $arg, ContextInterface $ * * @throws ServiceClientException */ - public function PatchSchedule(V1\PatchScheduleRequest $arg, ContextInterface $ctx = null): V1\PatchScheduleResponse + public function PatchSchedule(V1\PatchScheduleRequest $arg, ?ContextInterface $ctx = null): V1\PatchScheduleResponse { return $this->invoke("PatchSchedule", $arg, $ctx); } @@ -708,7 +708,7 @@ public function PatchSchedule(V1\PatchScheduleRequest $arg, ContextInterface $ct * * @throws ServiceClientException */ - public function ListScheduleMatchingTimes(V1\ListScheduleMatchingTimesRequest $arg, ContextInterface $ctx = null): V1\ListScheduleMatchingTimesResponse + public function ListScheduleMatchingTimes(V1\ListScheduleMatchingTimesRequest $arg, ?ContextInterface $ctx = null): V1\ListScheduleMatchingTimesResponse { return $this->invoke("ListScheduleMatchingTimes", $arg, $ctx); } @@ -718,7 +718,7 @@ public function ListScheduleMatchingTimes(V1\ListScheduleMatchingTimesRequest $a * * @throws ServiceClientException */ - public function DeleteSchedule(V1\DeleteScheduleRequest $arg, ContextInterface $ctx = null): V1\DeleteScheduleResponse + public function DeleteSchedule(V1\DeleteScheduleRequest $arg, ?ContextInterface $ctx = null): V1\DeleteScheduleResponse { return $this->invoke("DeleteSchedule", $arg, $ctx); } @@ -728,7 +728,7 @@ public function DeleteSchedule(V1\DeleteScheduleRequest $arg, ContextInterface $ * * @throws ServiceClientException */ - public function ListSchedules(V1\ListSchedulesRequest $arg, ContextInterface $ctx = null): V1\ListSchedulesResponse + public function ListSchedules(V1\ListSchedulesRequest $arg, ?ContextInterface $ctx = null): V1\ListSchedulesResponse { return $this->invoke("ListSchedules", $arg, $ctx); } @@ -760,7 +760,7 @@ public function ListSchedules(V1\ListSchedulesRequest $arg, ContextInterface $ct * * @throws ServiceClientException */ - public function UpdateWorkerBuildIdCompatibility(V1\UpdateWorkerBuildIdCompatibilityRequest $arg, ContextInterface $ctx = null): V1\UpdateWorkerBuildIdCompatibilityResponse + public function UpdateWorkerBuildIdCompatibility(V1\UpdateWorkerBuildIdCompatibilityRequest $arg, ?ContextInterface $ctx = null): V1\UpdateWorkerBuildIdCompatibilityResponse { return $this->invoke("UpdateWorkerBuildIdCompatibility", $arg, $ctx); } @@ -771,7 +771,7 @@ public function UpdateWorkerBuildIdCompatibility(V1\UpdateWorkerBuildIdCompatibi * * @throws ServiceClientException */ - public function GetWorkerBuildIdCompatibility(V1\GetWorkerBuildIdCompatibilityRequest $arg, ContextInterface $ctx = null): V1\GetWorkerBuildIdCompatibilityResponse + public function GetWorkerBuildIdCompatibility(V1\GetWorkerBuildIdCompatibilityRequest $arg, ?ContextInterface $ctx = null): V1\GetWorkerBuildIdCompatibilityResponse { return $this->invoke("GetWorkerBuildIdCompatibility", $arg, $ctx); } @@ -786,7 +786,7 @@ public function GetWorkerBuildIdCompatibility(V1\GetWorkerBuildIdCompatibilityRe * * @throws ServiceClientException */ - public function UpdateWorkerVersioningRules(V1\UpdateWorkerVersioningRulesRequest $arg, ContextInterface $ctx = null): V1\UpdateWorkerVersioningRulesResponse + public function UpdateWorkerVersioningRules(V1\UpdateWorkerVersioningRulesRequest $arg, ?ContextInterface $ctx = null): V1\UpdateWorkerVersioningRulesResponse { return $this->invoke("UpdateWorkerVersioningRules", $arg, $ctx); } @@ -798,7 +798,7 @@ public function UpdateWorkerVersioningRules(V1\UpdateWorkerVersioningRulesReques * * @throws ServiceClientException */ - public function GetWorkerVersioningRules(V1\GetWorkerVersioningRulesRequest $arg, ContextInterface $ctx = null): V1\GetWorkerVersioningRulesResponse + public function GetWorkerVersioningRules(V1\GetWorkerVersioningRulesRequest $arg, ?ContextInterface $ctx = null): V1\GetWorkerVersioningRulesResponse { return $this->invoke("GetWorkerVersioningRules", $arg, $ctx); } @@ -828,7 +828,7 @@ public function GetWorkerVersioningRules(V1\GetWorkerVersioningRulesRequest $arg * * @throws ServiceClientException */ - public function GetWorkerTaskReachability(V1\GetWorkerTaskReachabilityRequest $arg, ContextInterface $ctx = null): V1\GetWorkerTaskReachabilityResponse + public function GetWorkerTaskReachability(V1\GetWorkerTaskReachabilityRequest $arg, ?ContextInterface $ctx = null): V1\GetWorkerTaskReachabilityResponse { return $this->invoke("GetWorkerTaskReachability", $arg, $ctx); } @@ -838,7 +838,7 @@ public function GetWorkerTaskReachability(V1\GetWorkerTaskReachabilityRequest $a * * @throws ServiceClientException */ - public function UpdateWorkflowExecution(V1\UpdateWorkflowExecutionRequest $arg, ContextInterface $ctx = null): V1\UpdateWorkflowExecutionResponse + public function UpdateWorkflowExecution(V1\UpdateWorkflowExecutionRequest $arg, ?ContextInterface $ctx = null): V1\UpdateWorkflowExecutionResponse { return $this->invoke("UpdateWorkflowExecution", $arg, $ctx); } @@ -855,7 +855,7 @@ public function UpdateWorkflowExecution(V1\UpdateWorkflowExecutionRequest $arg, * * @throws ServiceClientException */ - public function PollWorkflowExecutionUpdate(V1\PollWorkflowExecutionUpdateRequest $arg, ContextInterface $ctx = null): V1\PollWorkflowExecutionUpdateResponse + public function PollWorkflowExecutionUpdate(V1\PollWorkflowExecutionUpdateRequest $arg, ?ContextInterface $ctx = null): V1\PollWorkflowExecutionUpdateResponse { return $this->invoke("PollWorkflowExecutionUpdate", $arg, $ctx); } @@ -865,7 +865,7 @@ public function PollWorkflowExecutionUpdate(V1\PollWorkflowExecutionUpdateReques * * @throws ServiceClientException */ - public function StartBatchOperation(V1\StartBatchOperationRequest $arg, ContextInterface $ctx = null): V1\StartBatchOperationResponse + public function StartBatchOperation(V1\StartBatchOperationRequest $arg, ?ContextInterface $ctx = null): V1\StartBatchOperationResponse { return $this->invoke("StartBatchOperation", $arg, $ctx); } @@ -875,7 +875,7 @@ public function StartBatchOperation(V1\StartBatchOperationRequest $arg, ContextI * * @throws ServiceClientException */ - public function StopBatchOperation(V1\StopBatchOperationRequest $arg, ContextInterface $ctx = null): V1\StopBatchOperationResponse + public function StopBatchOperation(V1\StopBatchOperationRequest $arg, ?ContextInterface $ctx = null): V1\StopBatchOperationResponse { return $this->invoke("StopBatchOperation", $arg, $ctx); } @@ -885,7 +885,7 @@ public function StopBatchOperation(V1\StopBatchOperationRequest $arg, ContextInt * * @throws ServiceClientException */ - public function DescribeBatchOperation(V1\DescribeBatchOperationRequest $arg, ContextInterface $ctx = null): V1\DescribeBatchOperationResponse + public function DescribeBatchOperation(V1\DescribeBatchOperationRequest $arg, ?ContextInterface $ctx = null): V1\DescribeBatchOperationResponse { return $this->invoke("DescribeBatchOperation", $arg, $ctx); } @@ -895,7 +895,7 @@ public function DescribeBatchOperation(V1\DescribeBatchOperationRequest $arg, Co * * @throws ServiceClientException */ - public function ListBatchOperations(V1\ListBatchOperationsRequest $arg, ContextInterface $ctx = null): V1\ListBatchOperationsResponse + public function ListBatchOperations(V1\ListBatchOperationsRequest $arg, ?ContextInterface $ctx = null): V1\ListBatchOperationsResponse { return $this->invoke("ListBatchOperations", $arg, $ctx); } @@ -907,7 +907,7 @@ public function ListBatchOperations(V1\ListBatchOperationsRequest $arg, ContextI * * @throws ServiceClientException */ - public function PollNexusTaskQueue(V1\PollNexusTaskQueueRequest $arg, ContextInterface $ctx = null): V1\PollNexusTaskQueueResponse + public function PollNexusTaskQueue(V1\PollNexusTaskQueueRequest $arg, ?ContextInterface $ctx = null): V1\PollNexusTaskQueueResponse { return $this->invoke("PollNexusTaskQueue", $arg, $ctx); } @@ -920,7 +920,7 @@ public function PollNexusTaskQueue(V1\PollNexusTaskQueueRequest $arg, ContextInt * * @throws ServiceClientException */ - public function RespondNexusTaskCompleted(V1\RespondNexusTaskCompletedRequest $arg, ContextInterface $ctx = null): V1\RespondNexusTaskCompletedResponse + public function RespondNexusTaskCompleted(V1\RespondNexusTaskCompletedRequest $arg, ?ContextInterface $ctx = null): V1\RespondNexusTaskCompletedResponse { return $this->invoke("RespondNexusTaskCompleted", $arg, $ctx); } @@ -933,7 +933,7 @@ public function RespondNexusTaskCompleted(V1\RespondNexusTaskCompletedRequest $a * * @throws ServiceClientException */ - public function RespondNexusTaskFailed(V1\RespondNexusTaskFailedRequest $arg, ContextInterface $ctx = null): V1\RespondNexusTaskFailedResponse + public function RespondNexusTaskFailed(V1\RespondNexusTaskFailedRequest $arg, ?ContextInterface $ctx = null): V1\RespondNexusTaskFailedResponse { return $this->invoke("RespondNexusTaskFailed", $arg, $ctx); } diff --git a/src/Client/ScheduleClient.php b/src/Client/ScheduleClient.php index 9a486a439..923809774 100644 --- a/src/Client/ScheduleClient.php +++ b/src/Client/ScheduleClient.php @@ -48,8 +48,8 @@ final class ScheduleClient implements ScheduleClientInterface public function __construct( ServiceClientInterface $serviceClient, - ClientOptions $options = null, - DataConverterInterface $converter = null, + ?ClientOptions $options = null, + ?DataConverterInterface $converter = null, ) { $this->client = $serviceClient; $this->clientOptions = $options ?? new ClientOptions(); @@ -62,8 +62,8 @@ public function __construct( public static function create( ServiceClientInterface $serviceClient, - ClientOptions $options = null, - DataConverterInterface $converter = null, + ?ClientOptions $options = null, + ?DataConverterInterface $converter = null, ): ScheduleClientInterface { return new self($serviceClient, $options, $converter); } diff --git a/src/Client/WorkflowClient.php b/src/Client/WorkflowClient.php index 7eb2d7206..dd9c3dce2 100644 --- a/src/Client/WorkflowClient.php +++ b/src/Client/WorkflowClient.php @@ -66,9 +66,9 @@ class WorkflowClient implements WorkflowClientInterface public function __construct( ServiceClientInterface $serviceClient, - ClientOptions $options = null, - DataConverterInterface $converter = null, - PipelineProvider $interceptorProvider = null, + ?ClientOptions $options = null, + ?DataConverterInterface $converter = null, + ?PipelineProvider $interceptorProvider = null, ) { $this->client = $serviceClient; $this->interceptorPipeline = ($interceptorProvider ?? new SimplePipelineProvider()) @@ -83,9 +83,9 @@ public function __construct( */ public static function create( ServiceClientInterface $serviceClient, - ClientOptions $options = null, - DataConverterInterface $converter = null, - PipelineProvider $interceptorProvider = null, + ?ClientOptions $options = null, + ?DataConverterInterface $converter = null, + ?PipelineProvider $interceptorProvider = null, ): self { return new self($serviceClient, $options, $converter, $interceptorProvider); } @@ -207,7 +207,7 @@ public function startWithSignal( public function newWorkflowStub( string $class, - WorkflowOptions $options = null, + ?WorkflowOptions $options = null, ): object { $workflow = $this->reader->fromClass($class); @@ -220,7 +220,7 @@ public function newWorkflowStub( public function newUntypedWorkflowStub( string $workflowType, - WorkflowOptions $options = null, + ?WorkflowOptions $options = null, ): WorkflowStubInterface { $options ??= new WorkflowOptions(); diff --git a/src/Client/WorkflowClientInterface.php b/src/Client/WorkflowClientInterface.php index bcb7de0c4..1156eb175 100644 --- a/src/Client/WorkflowClientInterface.php +++ b/src/Client/WorkflowClientInterface.php @@ -62,7 +62,7 @@ public function startWithSignal( */ public function newWorkflowStub( string $class, - WorkflowOptions $options = null, + ?WorkflowOptions $options = null, ): object; /** @@ -78,7 +78,7 @@ public function newWorkflowStub( */ public function newUntypedWorkflowStub( string $workflowType, - WorkflowOptions $options = null, + ?WorkflowOptions $options = null, ): WorkflowStubInterface; /** diff --git a/src/Client/WorkflowOptions.php b/src/Client/WorkflowOptions.php index f25e325e7..49c08a255 100644 --- a/src/Client/WorkflowOptions.php +++ b/src/Client/WorkflowOptions.php @@ -166,7 +166,7 @@ public function __construct() * * @return self return a new {@see self} instance with merged options */ - public function mergeWith(MethodRetry $retry = null, CronSchedule $cron = null): self + public function mergeWith(?MethodRetry $retry = null, ?CronSchedule $cron = null): self { $self = clone $this; diff --git a/src/Common/RetryOptions.php b/src/Common/RetryOptions.php index bffacb4a6..9a9c5baed 100644 --- a/src/Common/RetryOptions.php +++ b/src/Common/RetryOptions.php @@ -106,7 +106,7 @@ class RetryOptions extends Options #[Marshal(name: 'non_retryable_error_types')] public array $nonRetryableExceptions = self::DEFAULT_NON_RETRYABLE_EXCEPTIONS; - public function mergeWith(MethodRetry $retry = null): self + public function mergeWith(?MethodRetry $retry = null): self { $self = clone $this; diff --git a/src/DataConverter/EncodedValues.php b/src/DataConverter/EncodedValues.php index 5122431a3..bb0ed99f9 100644 --- a/src/DataConverter/EncodedValues.php +++ b/src/DataConverter/EncodedValues.php @@ -62,7 +62,7 @@ public static function sliceValues( DataConverterInterface $converter, ValuesInterface $values, int $offset, - int $length = null, + ?int $length = null, ): ValuesInterface { $payloads = $values->toPayloads(); $newPayloads = new Payloads(); @@ -90,7 +90,7 @@ static function (mixed $value) use ($type) { ); } - public static function fromValues(array $values, DataConverterInterface $dataConverter = null): static + public static function fromValues(array $values, ?DataConverterInterface $dataConverter = null): static { $ev = new static(); $ev->values = \array_values($values); diff --git a/src/DataConverter/JsonConverter.php b/src/DataConverter/JsonConverter.php index d9fe7fb78..8f422e4de 100644 --- a/src/DataConverter/JsonConverter.php +++ b/src/DataConverter/JsonConverter.php @@ -36,7 +36,7 @@ class JsonConverter extends Converter private MarshallerInterface $marshaller; - public function __construct(MarshallerInterface $marshaller = null) + public function __construct(?MarshallerInterface $marshaller = null) { $this->marshaller = $marshaller ?? self::createDefaultMarshaller(); } diff --git a/src/DataConverter/Type.php b/src/DataConverter/Type.php index 540edecee..70af788ee 100644 --- a/src/DataConverter/Type.php +++ b/src/DataConverter/Type.php @@ -37,7 +37,7 @@ final class Type */ public function __construct( private readonly string $name = Type::TYPE_ANY, - bool $allowsNull = null, + ?bool $allowsNull = null, private readonly bool $isArrayOf = false, ) { $this->allowsNull = $allowsNull ?? ( diff --git a/src/Exception/Client/ActivityCompletionException.php b/src/Exception/Client/ActivityCompletionException.php index a474047df..daeed894c 100644 --- a/src/Exception/Client/ActivityCompletionException.php +++ b/src/Exception/Client/ActivityCompletionException.php @@ -47,7 +47,7 @@ public static function fromPreviousWithActivityId(string $activityId, \Throwable /** * @return static */ - public static function fromActivityInfo(ActivityInfo $info, \Throwable $e = null): self + public static function fromActivityInfo(ActivityInfo $info, ?\Throwable $e = null): self { $e = new static( self::buildMessage( diff --git a/src/Exception/Client/ServiceClientException.php b/src/Exception/Client/ServiceClientException.php index e8c7eb9ae..e5506ca8c 100644 --- a/src/Exception/Client/ServiceClientException.php +++ b/src/Exception/Client/ServiceClientException.php @@ -23,7 +23,7 @@ class ServiceClientException extends \RuntimeException /** * @throws \Exception */ - public function __construct(\stdClass $status, \Throwable $previous = null) + public function __construct(\stdClass $status, ?\Throwable $previous = null) { $this->status = new Status(); diff --git a/src/Exception/Client/WorkflowException.php b/src/Exception/Client/WorkflowException.php index 1b7850e4c..9b6bb869c 100644 --- a/src/Exception/Client/WorkflowException.php +++ b/src/Exception/Client/WorkflowException.php @@ -22,8 +22,8 @@ class WorkflowException extends TemporalException public function __construct( ?string $message, WorkflowExecution $execution, - string $workflowType = null, - \Throwable $previous = null, + ?string $workflowType = null, + ?\Throwable $previous = null, ) { parent::__construct( self::buildMessage( @@ -42,8 +42,8 @@ public function __construct( public static function withoutMessage( WorkflowExecution $execution, - string $workflowType = null, - \Throwable $previous = null, + ?string $workflowType = null, + ?\Throwable $previous = null, ): WorkflowException { return new static(null, $execution, $workflowType, $previous); } diff --git a/src/Exception/Client/WorkflowExecutionAlreadyStartedException.php b/src/Exception/Client/WorkflowExecutionAlreadyStartedException.php index c9ecfc32f..28c31e801 100644 --- a/src/Exception/Client/WorkflowExecutionAlreadyStartedException.php +++ b/src/Exception/Client/WorkflowExecutionAlreadyStartedException.php @@ -17,8 +17,8 @@ class WorkflowExecutionAlreadyStartedException extends WorkflowException { public function __construct( WorkflowExecution $execution, - string $type = null, - \Throwable $previous = null, + ?string $type = null, + ?\Throwable $previous = null, ) { parent::__construct(null, $execution, $type, $previous); } diff --git a/src/Exception/Client/WorkflowFailedException.php b/src/Exception/Client/WorkflowFailedException.php index 5e698050c..1307131d5 100644 --- a/src/Exception/Client/WorkflowFailedException.php +++ b/src/Exception/Client/WorkflowFailedException.php @@ -25,7 +25,7 @@ public function __construct( ?string $type, int $lastWorkflowTaskCompletedEventId, int $retryState, - \Throwable $previous = null, + ?\Throwable $previous = null, ) { parent::__construct(null, $execution, $type, $previous); diff --git a/src/Exception/Client/WorkflowQueryRejectedException.php b/src/Exception/Client/WorkflowQueryRejectedException.php index efc59c9c3..538644e13 100644 --- a/src/Exception/Client/WorkflowQueryRejectedException.php +++ b/src/Exception/Client/WorkflowQueryRejectedException.php @@ -23,7 +23,7 @@ public function __construct( string $type, int $queryRejectCondition, int $workflowExecutionStatus, - \Throwable $previous = null, + ?\Throwable $previous = null, ) { parent::__construct(null, $execution, $type, $previous); $this->queryRejectCondition = $queryRejectCondition; diff --git a/src/Exception/Failure/ActivityFailure.php b/src/Exception/Failure/ActivityFailure.php index 8574d66e9..04adac67d 100644 --- a/src/Exception/Failure/ActivityFailure.php +++ b/src/Exception/Failure/ActivityFailure.php @@ -27,7 +27,7 @@ public function __construct( string $activityId, int $retryState, string $identity, - \Throwable $previous = null, + ?\Throwable $previous = null, ) { parent::__construct( self::buildMessage( diff --git a/src/Exception/Failure/ApplicationFailure.php b/src/Exception/Failure/ApplicationFailure.php index 677413709..3aceb7cd9 100644 --- a/src/Exception/Failure/ApplicationFailure.php +++ b/src/Exception/Failure/ApplicationFailure.php @@ -54,8 +54,8 @@ public function __construct( string $message, string $type, bool $nonRetryable, - ValuesInterface $details = null, - \Throwable $previous = null, + ?ValuesInterface $details = null, + ?\Throwable $previous = null, private ?\DateInterval $nextRetryDelay = null, ) { parent::__construct( diff --git a/src/Exception/Failure/CanceledFailure.php b/src/Exception/Failure/CanceledFailure.php index c18a2563e..6a983d940 100644 --- a/src/Exception/Failure/CanceledFailure.php +++ b/src/Exception/Failure/CanceledFailure.php @@ -19,7 +19,7 @@ class CanceledFailure extends TemporalFailure { private ValuesInterface $details; - public function __construct(string $message, ValuesInterface $details = null, \Throwable $previous = null) + public function __construct(string $message, ?ValuesInterface $details = null, ?\Throwable $previous = null) { parent::__construct($message, '', $previous); $this->details = $details ?? EncodedValues::empty(); diff --git a/src/Exception/Failure/ChildWorkflowFailure.php b/src/Exception/Failure/ChildWorkflowFailure.php index eccb17e93..f01ebd5e0 100644 --- a/src/Exception/Failure/ChildWorkflowFailure.php +++ b/src/Exception/Failure/ChildWorkflowFailure.php @@ -29,7 +29,7 @@ public function __construct( WorkflowExecution $execution, string $namespace, int $retryState, - \Throwable $previous = null, + ?\Throwable $previous = null, ) { parent::__construct( self::buildMessage( diff --git a/src/Exception/Failure/ServerFailure.php b/src/Exception/Failure/ServerFailure.php index 2fadd0ab4..b61a66ae6 100644 --- a/src/Exception/Failure/ServerFailure.php +++ b/src/Exception/Failure/ServerFailure.php @@ -15,7 +15,7 @@ class ServerFailure extends TemporalFailure { private bool $nonRetryable; - public function __construct(string $message, bool $nonRetryable, \Throwable $previous = null) + public function __construct(string $message, bool $nonRetryable, ?\Throwable $previous = null) { parent::__construct( $message, diff --git a/src/Exception/Failure/TemporalFailure.php b/src/Exception/Failure/TemporalFailure.php index 677edb0a6..f10c87f63 100644 --- a/src/Exception/Failure/TemporalFailure.php +++ b/src/Exception/Failure/TemporalFailure.php @@ -35,7 +35,7 @@ class TemporalFailure extends TemporalException implements \Stringable private string $originalMessage; private ?string $originalStackTrace = null; - public function __construct(string $message, string $originalMessage = null, \Throwable $previous = null) + public function __construct(string $message, ?string $originalMessage = null, ?\Throwable $previous = null) { parent::__construct($message, 0, $previous); diff --git a/src/Exception/Failure/TerminatedFailure.php b/src/Exception/Failure/TerminatedFailure.php index 4d5e101ec..396f65ea3 100644 --- a/src/Exception/Failure/TerminatedFailure.php +++ b/src/Exception/Failure/TerminatedFailure.php @@ -13,7 +13,7 @@ class TerminatedFailure extends TemporalFailure { - public function __construct(string $message, \Throwable $previous = null) + public function __construct(string $message, ?\Throwable $previous = null) { parent::__construct($message, $message, $previous); } diff --git a/src/Exception/Failure/TimeoutFailure.php b/src/Exception/Failure/TimeoutFailure.php index c2f53e8ca..13d24fddc 100644 --- a/src/Exception/Failure/TimeoutFailure.php +++ b/src/Exception/Failure/TimeoutFailure.php @@ -23,7 +23,7 @@ public function __construct( string $message, ValuesInterface $lastHeartbeatDetails, int $timeoutWorkflowType, - \Throwable $previous = null, + ?\Throwable $previous = null, ) { parent::__construct( self::buildMessage(\compact('message', 'timeoutWorkflowType') + ['type' => 'TimeoutFailure']), diff --git a/src/Interceptor/ActivityInbound/ActivityInput.php b/src/Interceptor/ActivityInbound/ActivityInput.php index 0ce1a2b49..2289bdeb1 100644 --- a/src/Interceptor/ActivityInbound/ActivityInput.php +++ b/src/Interceptor/ActivityInbound/ActivityInput.php @@ -29,8 +29,8 @@ public function __construct( ) {} public function with( - ValuesInterface $arguments = null, - HeaderInterface $header = null, + ?ValuesInterface $arguments = null, + ?HeaderInterface $header = null, ): self { return new self( $arguments ?? $this->arguments, diff --git a/src/Interceptor/WorkflowClient/CancelInput.php b/src/Interceptor/WorkflowClient/CancelInput.php index 1146b74bd..4e37ea0d4 100644 --- a/src/Interceptor/WorkflowClient/CancelInput.php +++ b/src/Interceptor/WorkflowClient/CancelInput.php @@ -27,7 +27,7 @@ public function __construct( ) {} public function with( - WorkflowExecution $workflowExecution = null, + ?WorkflowExecution $workflowExecution = null, ): self { return new self( $workflowExecution ?? $this->workflowExecution, diff --git a/src/Interceptor/WorkflowClient/DescribeInput.php b/src/Interceptor/WorkflowClient/DescribeInput.php index da23ec188..e616d6c84 100644 --- a/src/Interceptor/WorkflowClient/DescribeInput.php +++ b/src/Interceptor/WorkflowClient/DescribeInput.php @@ -28,8 +28,8 @@ public function __construct( ) {} public function with( - WorkflowExecution $workflowExecution = null, - string $namespace = null, + ?WorkflowExecution $workflowExecution = null, + ?string $namespace = null, ): self { return new self( $workflowExecution ?? $this->workflowExecution, diff --git a/src/Interceptor/WorkflowClient/GetResultInput.php b/src/Interceptor/WorkflowClient/GetResultInput.php index d89851f2b..03febaf63 100644 --- a/src/Interceptor/WorkflowClient/GetResultInput.php +++ b/src/Interceptor/WorkflowClient/GetResultInput.php @@ -30,9 +30,9 @@ public function __construct( ) {} public function with( - WorkflowExecution $workflowExecution = null, - string $workflowType = null, - int $timeout = null, + ?WorkflowExecution $workflowExecution = null, + ?string $workflowType = null, + ?int $timeout = null, ): self { return new self( $workflowExecution ?? $this->workflowExecution, diff --git a/src/Interceptor/WorkflowClient/QueryInput.php b/src/Interceptor/WorkflowClient/QueryInput.php index 279556212..6a28df073 100644 --- a/src/Interceptor/WorkflowClient/QueryInput.php +++ b/src/Interceptor/WorkflowClient/QueryInput.php @@ -31,9 +31,9 @@ public function __construct( ) {} public function with( - WorkflowExecution $workflowExecution = null, - string $queryType = null, - ValuesInterface $arguments = null, + ?WorkflowExecution $workflowExecution = null, + ?string $queryType = null, + ?ValuesInterface $arguments = null, ): self { return new self( $workflowExecution ?? $this->workflowExecution, diff --git a/src/Interceptor/WorkflowClient/SignalInput.php b/src/Interceptor/WorkflowClient/SignalInput.php index 8b74d1c4a..97b1533e1 100644 --- a/src/Interceptor/WorkflowClient/SignalInput.php +++ b/src/Interceptor/WorkflowClient/SignalInput.php @@ -31,8 +31,8 @@ public function __construct( ) {} public function with( - string $signalName = null, - ValuesInterface $arguments = null, + ?string $signalName = null, + ?ValuesInterface $arguments = null, ): self { return new self( $this->workflowExecution, diff --git a/src/Interceptor/WorkflowClient/SignalWithStartInput.php b/src/Interceptor/WorkflowClient/SignalWithStartInput.php index f6a58792f..bbdd9c994 100644 --- a/src/Interceptor/WorkflowClient/SignalWithStartInput.php +++ b/src/Interceptor/WorkflowClient/SignalWithStartInput.php @@ -29,9 +29,9 @@ public function __construct( ) {} public function with( - StartInput $workflowStartInput = null, - string $signalName = null, - ValuesInterface $signalArguments = null, + ?StartInput $workflowStartInput = null, + ?string $signalName = null, + ?ValuesInterface $signalArguments = null, ): self { return new self( $workflowStartInput ?? $this->workflowStartInput, diff --git a/src/Interceptor/WorkflowClient/StartInput.php b/src/Interceptor/WorkflowClient/StartInput.php index 070386c35..5c7cc03d0 100644 --- a/src/Interceptor/WorkflowClient/StartInput.php +++ b/src/Interceptor/WorkflowClient/StartInput.php @@ -33,9 +33,9 @@ public function __construct( ) {} public function with( - HeaderInterface $header = null, - ValuesInterface $arguments = null, - WorkflowOptions $options = null, + ?HeaderInterface $header = null, + ?ValuesInterface $arguments = null, + ?WorkflowOptions $options = null, ): self { return new self( $this->workflowId, diff --git a/src/Interceptor/WorkflowClient/TerminateInput.php b/src/Interceptor/WorkflowClient/TerminateInput.php index 1491d02ff..85f284f7d 100644 --- a/src/Interceptor/WorkflowClient/TerminateInput.php +++ b/src/Interceptor/WorkflowClient/TerminateInput.php @@ -28,8 +28,8 @@ public function __construct( ) {} public function with( - WorkflowExecution $workflowExecution = null, - string $reason = null, + ?WorkflowExecution $workflowExecution = null, + ?string $reason = null, ): self { return new self( $workflowExecution ?? $this->workflowExecution, diff --git a/src/Interceptor/WorkflowInbound/QueryInput.php b/src/Interceptor/WorkflowInbound/QueryInput.php index adb882a91..ef00264f2 100644 --- a/src/Interceptor/WorkflowInbound/QueryInput.php +++ b/src/Interceptor/WorkflowInbound/QueryInput.php @@ -28,7 +28,7 @@ public function __construct( ) {} public function with( - ValuesInterface $arguments = null, + ?ValuesInterface $arguments = null, ): self { return new self( $this->queryName, diff --git a/src/Interceptor/WorkflowInbound/SignalInput.php b/src/Interceptor/WorkflowInbound/SignalInput.php index 5dc9b4da4..ceacaac15 100644 --- a/src/Interceptor/WorkflowInbound/SignalInput.php +++ b/src/Interceptor/WorkflowInbound/SignalInput.php @@ -34,9 +34,9 @@ public function __construct( ) {} public function with( - WorkflowInfo $info = null, - ValuesInterface $arguments = null, - HeaderInterface $header = null, + ?WorkflowInfo $info = null, + ?ValuesInterface $arguments = null, + ?HeaderInterface $header = null, ): self { return new self( $this->signalName, diff --git a/src/Interceptor/WorkflowInbound/UpdateInput.php b/src/Interceptor/WorkflowInbound/UpdateInput.php index c033d1923..62b47603a 100644 --- a/src/Interceptor/WorkflowInbound/UpdateInput.php +++ b/src/Interceptor/WorkflowInbound/UpdateInput.php @@ -35,9 +35,9 @@ public function __construct( ) {} public function with( - WorkflowInfo $info = null, - ValuesInterface $arguments = null, - HeaderInterface $header = null, + ?WorkflowInfo $info = null, + ?ValuesInterface $arguments = null, + ?HeaderInterface $header = null, ): self { return new self( $this->updateName, diff --git a/src/Interceptor/WorkflowInbound/WorkflowInput.php b/src/Interceptor/WorkflowInbound/WorkflowInput.php index 0485c5c1f..00febc9e3 100644 --- a/src/Interceptor/WorkflowInbound/WorkflowInput.php +++ b/src/Interceptor/WorkflowInbound/WorkflowInput.php @@ -31,9 +31,9 @@ public function __construct( ) {} public function with( - WorkflowInfo $info = null, - ValuesInterface $arguments = null, - HeaderInterface $header = null, + ?WorkflowInfo $info = null, + ?ValuesInterface $arguments = null, + ?HeaderInterface $header = null, ): self { return new self( $info ?? $this->info, diff --git a/src/Internal/Activity/ActivityContext.php b/src/Internal/Activity/ActivityContext.php index 4905be808..e46a82b5a 100644 --- a/src/Internal/Activity/ActivityContext.php +++ b/src/Internal/Activity/ActivityContext.php @@ -42,7 +42,7 @@ public function __construct( DataConverterInterface $converter, ValuesInterface $input, HeaderInterface $header, - ValuesInterface $lastHeartbeatDetails = null, + ?ValuesInterface $lastHeartbeatDetails = null, ) { $this->info = new ActivityInfo(); $this->rpc = $rpc; diff --git a/src/Internal/Client/WorkflowRun.php b/src/Internal/Client/WorkflowRun.php index 384795eb2..76a2bb3d9 100644 --- a/src/Internal/Client/WorkflowRun.php +++ b/src/Internal/Client/WorkflowRun.php @@ -32,7 +32,7 @@ public function getExecution(): WorkflowExecution return $this->stub->getExecution(); } - public function getResult($type = null, int $timeout = null): mixed + public function getResult($type = null, ?int $timeout = null): mixed { return $this->stub->getResult($type ?? $this->returnType, $timeout); } diff --git a/src/Internal/Client/WorkflowStub.php b/src/Internal/Client/WorkflowStub.php index 405462265..ec41ef15b 100644 --- a/src/Internal/Client/WorkflowStub.php +++ b/src/Internal/Client/WorkflowStub.php @@ -458,7 +458,7 @@ static function (TerminateInput $input) use ($serviceClient, $clientOptions, $de * @param null|mixed $type * @throws \Throwable */ - public function getResult($type = null, int $timeout = null): mixed + public function getResult($type = null, ?int $timeout = null): mixed { /** @var ValuesInterface|null $result */ $result = $this->interceptors->with( @@ -528,7 +528,7 @@ private function assertStarted(string $method): void /** * @throws \ErrorException */ - private function fetchResult(int $timeout = null): ?EncodedValues + private function fetchResult(?int $timeout = null): ?EncodedValues { $this->assertStarted(__FUNCTION__); @@ -606,7 +606,7 @@ private function fetchResult(int $timeout = null): ?EncodedValues /** * @throws \ErrorException */ - private function getCloseEvent(int $timeout = null): HistoryEvent + private function getCloseEvent(?int $timeout = null): HistoryEvent { $historyRequest = new GetWorkflowExecutionHistoryRequest(); $historyRequest diff --git a/src/Internal/Marshaller/Meta/MarshalArray.php b/src/Internal/Marshaller/Meta/MarshalArray.php index 61905ae37..75d1527a8 100644 --- a/src/Internal/Marshaller/Meta/MarshalArray.php +++ b/src/Internal/Marshaller/Meta/MarshalArray.php @@ -28,7 +28,7 @@ final class MarshalArray extends Marshal { public function __construct( - string $name = null, + ?string $name = null, Marshal|string|null $of = null, bool $nullable = true, ) { diff --git a/src/Internal/Marshaller/Meta/MarshalAssocArray.php b/src/Internal/Marshaller/Meta/MarshalAssocArray.php index 61feb6a1e..1c6325841 100644 --- a/src/Internal/Marshaller/Meta/MarshalAssocArray.php +++ b/src/Internal/Marshaller/Meta/MarshalAssocArray.php @@ -27,7 +27,7 @@ final class MarshalAssocArray extends Marshal { public function __construct( - string $name = null, + ?string $name = null, Marshal|string|null $of = null, bool $nullable = true, ) { diff --git a/src/Internal/Marshaller/Meta/MarshalDateTime.php b/src/Internal/Marshaller/Meta/MarshalDateTime.php index b9214e773..1dfe67241 100644 --- a/src/Internal/Marshaller/Meta/MarshalDateTime.php +++ b/src/Internal/Marshaller/Meta/MarshalDateTime.php @@ -26,7 +26,7 @@ final class MarshalDateTime extends Marshal * @param non-empty-string $to Datetime format or {@see Timestamp} class name. */ public function __construct( - string $name = null, + ?string $name = null, ?string $of = null, private string $to = \DateTimeInterface::RFC3339, bool $nullable = true, diff --git a/src/Internal/Marshaller/Meta/MarshalNullable.php b/src/Internal/Marshaller/Meta/MarshalNullable.php index a3fc66bad..d390737a5 100644 --- a/src/Internal/Marshaller/Meta/MarshalNullable.php +++ b/src/Internal/Marshaller/Meta/MarshalNullable.php @@ -25,7 +25,7 @@ final class MarshalNullable extends Marshal * @param non-empty-string|null $name */ public function __construct( - string $name = null, + ?string $name = null, string|MarshallingRule|null $rule = null, ) { parent::__construct($name, NullableType::class, $rule); diff --git a/src/Internal/Marshaller/Meta/MarshalOneOf.php b/src/Internal/Marshaller/Meta/MarshalOneOf.php index 0c75583df..d914721a7 100644 --- a/src/Internal/Marshaller/Meta/MarshalOneOf.php +++ b/src/Internal/Marshaller/Meta/MarshalOneOf.php @@ -24,7 +24,7 @@ final class MarshalOneOf extends Marshal */ public function __construct( private array $cases, - string $name = null, + ?string $name = null, ?string $of = null, bool $nullable = true, ) { diff --git a/src/Internal/Marshaller/Type/ArrayType.php b/src/Internal/Marshaller/Type/ArrayType.php index a5824a997..43c2a6d1c 100644 --- a/src/Internal/Marshaller/Type/ArrayType.php +++ b/src/Internal/Marshaller/Type/ArrayType.php @@ -30,7 +30,7 @@ class ArrayType extends Type implements DetectableTypeInterface, RuleFactoryInte * * @throws \ReflectionException */ - public function __construct(MarshallerInterface $marshaller, MarshallingRule|string $typeOrClass = null) + public function __construct(MarshallerInterface $marshaller, MarshallingRule|string|null $typeOrClass = null) { if ($typeOrClass !== null) { $this->type = $this->ofType($marshaller, $typeOrClass); diff --git a/src/Internal/Marshaller/Type/AssocArrayType.php b/src/Internal/Marshaller/Type/AssocArrayType.php index 3c770a960..10ed8a3cc 100644 --- a/src/Internal/Marshaller/Type/AssocArrayType.php +++ b/src/Internal/Marshaller/Type/AssocArrayType.php @@ -32,7 +32,7 @@ class AssocArrayType extends Type * * @throws \ReflectionException */ - public function __construct(MarshallerInterface $marshaller, MarshallingRule|string $typeOrClass = null) + public function __construct(MarshallerInterface $marshaller, MarshallingRule|string|null $typeOrClass = null) { if ($typeOrClass !== null) { $this->type = $this->ofType($marshaller, $typeOrClass); diff --git a/src/Internal/Marshaller/Type/EnumType.php b/src/Internal/Marshaller/Type/EnumType.php index 694141f68..372e22665 100644 --- a/src/Internal/Marshaller/Type/EnumType.php +++ b/src/Internal/Marshaller/Type/EnumType.php @@ -25,7 +25,7 @@ class EnumType extends Type implements RuleFactoryInterface /** @var class-string<\UnitEnum> */ private string $classFQCN; - public function __construct(MarshallerInterface $marshaller, string $class = null) + public function __construct(MarshallerInterface $marshaller, ?string $class = null) { if ($class === null) { throw new \RuntimeException('Enum is required'); diff --git a/src/Internal/Marshaller/Type/NullableType.php b/src/Internal/Marshaller/Type/NullableType.php index 0e40efb73..854301023 100644 --- a/src/Internal/Marshaller/Type/NullableType.php +++ b/src/Internal/Marshaller/Type/NullableType.php @@ -25,7 +25,7 @@ class NullableType extends Type * * @throws \ReflectionException */ - public function __construct(MarshallerInterface $marshaller, MarshallingRule|string $typeOrClass = null) + public function __construct(MarshallerInterface $marshaller, MarshallingRule|string|null $typeOrClass = null) { if ($typeOrClass !== null) { $this->type = $this->ofType($marshaller, $typeOrClass); diff --git a/src/Internal/Marshaller/Type/ObjectType.php b/src/Internal/Marshaller/Type/ObjectType.php index c7f327922..25140b5b6 100644 --- a/src/Internal/Marshaller/Type/ObjectType.php +++ b/src/Internal/Marshaller/Type/ObjectType.php @@ -29,7 +29,7 @@ class ObjectType extends Type implements DetectableTypeInterface, RuleFactoryInt * @param class-string|null $class * @throws \ReflectionException */ - public function __construct(MarshallerInterface $marshaller, string $class = null) + public function __construct(MarshallerInterface $marshaller, ?string $class = null) { $this->reflection = new \ReflectionClass($class ?? \stdClass::class); diff --git a/src/Internal/Support/DateInterval.php b/src/Internal/Support/DateInterval.php index fc61b28be..f23eb4e56 100644 --- a/src/Internal/Support/DateInterval.php +++ b/src/Internal/Support/DateInterval.php @@ -136,7 +136,7 @@ public static function assert($interval): bool /** * @return ($i is null ? null : Duration) */ - public static function toDuration(\DateInterval $i = null): ?Duration + public static function toDuration(?\DateInterval $i = null): ?Duration { if ($i === null) { return null; diff --git a/src/Internal/Support/Diff.php b/src/Internal/Support/Diff.php index c3d914e71..0cfc8d847 100644 --- a/src/Internal/Support/Diff.php +++ b/src/Internal/Support/Diff.php @@ -62,7 +62,7 @@ public function __construct(object $context) /** * @param non-empty-string|null $property */ - public function isPresent(object $context, string $property = null): bool + public function isPresent(object $context, ?string $property = null): bool { return !$this->isChanged($context, $property); } @@ -70,7 +70,7 @@ public function isPresent(object $context, string $property = null): bool /** * @param non-empty-string|null $property */ - public function isChanged(object $context, string $property = null): bool + public function isChanged(object $context, ?string $property = null): bool { $this->matchContext($context); diff --git a/src/Internal/Transport/Request/CompleteWorkflow.php b/src/Internal/Transport/Request/CompleteWorkflow.php index 16c60cf12..c03c2042a 100644 --- a/src/Internal/Transport/Request/CompleteWorkflow.php +++ b/src/Internal/Transport/Request/CompleteWorkflow.php @@ -21,7 +21,7 @@ final class CompleteWorkflow extends Request { public const NAME = 'CompleteWorkflow'; - public function __construct(ValuesInterface $values, \Throwable $failure = null) + public function __construct(ValuesInterface $values, ?\Throwable $failure = null) { parent::__construct(self::NAME, [], $values); $this->setFailure($failure); diff --git a/src/Internal/Transport/Request/Panic.php b/src/Internal/Transport/Request/Panic.php index 6cf2e3a4d..378c971ce 100644 --- a/src/Internal/Transport/Request/Panic.php +++ b/src/Internal/Transport/Request/Panic.php @@ -20,7 +20,7 @@ final class Panic extends Request { public const NAME = 'Panic'; - public function __construct(\Throwable $failure = null) + public function __construct(?\Throwable $failure = null) { parent::__construct(self::NAME, [], null); $this->setFailure($failure); diff --git a/src/Internal/Transport/Request/SignalExternalWorkflow.php b/src/Internal/Transport/Request/SignalExternalWorkflow.php index a00101b0a..234d264e3 100644 --- a/src/Internal/Transport/Request/SignalExternalWorkflow.php +++ b/src/Internal/Transport/Request/SignalExternalWorkflow.php @@ -26,7 +26,7 @@ public function __construct( string $workflowId, ?string $runId, string $signal, - ValuesInterface $input = null, + ?ValuesInterface $input = null, bool $childWorkflowOnly = false, ) { $options = [ diff --git a/src/Internal/Workflow/ActivityStub.php b/src/Internal/Workflow/ActivityStub.php index 2c462f5a6..980455f03 100644 --- a/src/Internal/Workflow/ActivityStub.php +++ b/src/Internal/Workflow/ActivityStub.php @@ -58,7 +58,7 @@ public function getOptionsArray(): array public function execute( string $name, array $args = [], - Type|string|\ReflectionClass|\ReflectionType $returnType = null, + Type|string|\ReflectionClass|\ReflectionType|null $returnType = null, bool $isLocalActivity = false, ): PromiseInterface { $request = $isLocalActivity ? diff --git a/src/Internal/Workflow/Input.php b/src/Internal/Workflow/Input.php index 89e930f92..00f4fd9d8 100644 --- a/src/Internal/Workflow/Input.php +++ b/src/Internal/Workflow/Input.php @@ -41,7 +41,7 @@ final class Input #[Immutable] public Header $header; - public function __construct(WorkflowInfo $info = null, ValuesInterface $args = null, HeaderInterface $header = null) + public function __construct(?WorkflowInfo $info = null, ?ValuesInterface $args = null, ?HeaderInterface $header = null) { $this->info = $info ?? new WorkflowInfo(); $this->input = $args ?? EncodedValues::empty(); diff --git a/src/Internal/Workflow/Process/Scope.php b/src/Internal/Workflow/Process/Scope.php index f2518f417..9a7c6fafd 100644 --- a/src/Internal/Workflow/Process/Scope.php +++ b/src/Internal/Workflow/Process/Scope.php @@ -209,7 +209,7 @@ public function onClose(callable $then): self return $this; } - public function cancel(\Throwable $reason = null): void + public function cancel(?\Throwable $reason = null): void { if ($this->detached && !$reason instanceof DestructMemorizedInstanceException) { // detaches scopes can be offload via memory flush @@ -231,7 +231,7 @@ public function cancel(\Throwable $reason = null): void /** * @param non-empty-string|null $layer */ - public function startScope(callable $handler, bool $detached, string $layer = null): CancellationScopeInterface + public function startScope(callable $handler, bool $detached, ?string $layer = null): CancellationScopeInterface { $scope = $this->createScope($detached, $layer); $scope->start($handler, null, false); @@ -245,9 +245,9 @@ public function promise(): PromiseInterface } public function then( - callable $onFulfilled = null, - callable $onRejected = null, - callable $onProgress = null, + ?callable $onFulfilled = null, + ?callable $onRejected = null, + ?callable $onProgress = null, ): PromiseInterface { return $this->deferred->promise()->then($onFulfilled, $onRejected); } @@ -278,7 +278,7 @@ public function always(callable $onFulfilledOrRejected): PromiseInterface */ public function onAwait(Deferred $deferred): void { - $this->onCancel[++$this->cancelID] = static function (\Throwable $e = null) use ($deferred): void { + $this->onCancel[++$this->cancelID] = static function (?\Throwable $e = null) use ($deferred): void { $deferred->reject($e ?? new CanceledFailure('')); }; @@ -308,7 +308,7 @@ public function destroy(): void protected function createScope( bool $detached, ?string $layer = null, - WorkflowContext $context = null, + ?WorkflowContext $context = null, ?Workflow\UpdateContext $updateContext = null, ): self { $scope = new Scope($this->services, $context ?? $this->context, $updateContext); diff --git a/src/Internal/Workflow/WorkflowContext.php b/src/Internal/Workflow/WorkflowContext.php index da1ba74cf..b77728065 100644 --- a/src/Internal/Workflow/WorkflowContext.php +++ b/src/Internal/Workflow/WorkflowContext.php @@ -236,7 +236,7 @@ public function isReplaying(): bool return $this->services->env->isReplaying(); } - public function complete(array $result = null, \Throwable $failure = null): PromiseInterface + public function complete(?array $result = null, ?\Throwable $failure = null): PromiseInterface { if ($failure !== null) { $this->workflowInstance->clearSignalQueue(); @@ -255,7 +255,7 @@ function (CompleteInput $input): PromiseInterface { )(new CompleteInput($result, $failure)); } - public function panic(\Throwable $failure = null): PromiseInterface + public function panic(?\Throwable $failure = null): PromiseInterface { return $this->callsInterceptor->with( fn(PanicInput $failure): PromiseInterface => $this->request(new Panic($failure->failure), false), @@ -267,7 +267,7 @@ public function panic(\Throwable $failure = null): PromiseInterface public function continueAsNew( string $type, array $args = [], - ContinueAsNewOptions $options = null, + ?ContinueAsNewOptions $options = null, ): PromiseInterface { return $this->callsInterceptor->with( function (ContinueAsNewInput $input): PromiseInterface { @@ -288,7 +288,7 @@ function (ContinueAsNewInput $input): PromiseInterface { )(new ContinueAsNewInput($type, $args, $options)); } - public function newContinueAsNewStub(string $class, ContinueAsNewOptions $options = null): object + public function newContinueAsNewStub(string $class, ?ContinueAsNewOptions $options = null): object { $options ??= new ContinueAsNewOptions(); @@ -305,7 +305,7 @@ public function isContinuedAsNew(): bool public function executeChildWorkflow( string $type, array $args = [], - ChildWorkflowOptions $options = null, + ?ChildWorkflowOptions $options = null, mixed $returnType = null, ): PromiseInterface { return $this->callsInterceptor->with( @@ -319,7 +319,7 @@ public function executeChildWorkflow( public function newUntypedChildWorkflowStub( string $type, - ChildWorkflowOptions $options = null, + ?ChildWorkflowOptions $options = null, ): ChildWorkflowStubInterface { $options ??= new ChildWorkflowOptions(); @@ -328,7 +328,7 @@ public function newUntypedChildWorkflowStub( public function newChildWorkflowStub( string $class, - ChildWorkflowOptions $options = null, + ?ChildWorkflowOptions $options = null, ): object { $workflow = $this->services->workflowsReader->fromClass($class); $options = $options ?? (new ChildWorkflowOptions()) @@ -359,8 +359,8 @@ public function newUntypedExternalWorkflowStub(WorkflowExecution $execution): Ex public function executeActivity( string $type, array $args = [], - ActivityOptionsInterface $options = null, - Type|string|\ReflectionClass|\ReflectionType $returnType = null, + ?ActivityOptionsInterface $options = null, + Type|string|\ReflectionClass|\ReflectionType|null $returnType = null, ): PromiseInterface { $isLocal = $options instanceof LocalActivityOptions; @@ -382,7 +382,7 @@ public function executeActivity( } public function newUntypedActivityStub( - ActivityOptionsInterface $options = null, + ?ActivityOptionsInterface $options = null, ): ActivityStubInterface { $options ??= new ActivityOptions(); @@ -391,7 +391,7 @@ public function newUntypedActivityStub( public function newActivityStub( string $class, - ActivityOptionsInterface $options = null, + ?ActivityOptionsInterface $options = null, ): ActivityProxy { $activities = $this->services->activitiesReader->fromClass($class); diff --git a/src/Worker/ActivityInvocationCache/ActivityInvocationResult.php b/src/Worker/ActivityInvocationCache/ActivityInvocationResult.php index 76b9f0244..6400c2a1b 100644 --- a/src/Worker/ActivityInvocationCache/ActivityInvocationResult.php +++ b/src/Worker/ActivityInvocationCache/ActivityInvocationResult.php @@ -20,7 +20,7 @@ public static function fromValue(mixed $value, ?DataConverterInterface $dataConv return new self($value->toPayloads()); } - public function toValue(Type|string $type = null, ?DataConverterInterface $dataConverter = null) + public function toValue(Type|string|null $type = null, ?DataConverterInterface $dataConverter = null) { return $this->toEncodedValues($dataConverter)->getValue(0, $type); } diff --git a/src/Worker/ActivityInvocationCache/InMemoryActivityInvocationCache.php b/src/Worker/ActivityInvocationCache/InMemoryActivityInvocationCache.php index f5e8442d2..0c1c7a864 100644 --- a/src/Worker/ActivityInvocationCache/InMemoryActivityInvocationCache.php +++ b/src/Worker/ActivityInvocationCache/InMemoryActivityInvocationCache.php @@ -21,7 +21,7 @@ final class InMemoryActivityInvocationCache implements ActivityInvocationCacheIn private DataConverterInterface $dataConverter; - public function __construct(DataConverterInterface $dataConverter = null) + public function __construct(?DataConverterInterface $dataConverter = null) { $this->dataConverter = $dataConverter ?? DataConverter::createDefault(); } diff --git a/src/Worker/ActivityInvocationCache/RoadRunnerActivityInvocationCache.php b/src/Worker/ActivityInvocationCache/RoadRunnerActivityInvocationCache.php index c9ab2a12b..d70f90833 100644 --- a/src/Worker/ActivityInvocationCache/RoadRunnerActivityInvocationCache.php +++ b/src/Worker/ActivityInvocationCache/RoadRunnerActivityInvocationCache.php @@ -24,13 +24,13 @@ final class RoadRunnerActivityInvocationCache implements ActivityInvocationCache private StorageInterface $cache; private DataConverterInterface $dataConverter; - public function __construct(string $host, string $cacheName, DataConverterInterface $dataConverter = null) + public function __construct(string $host, string $cacheName, ?DataConverterInterface $dataConverter = null) { $this->cache = (new Factory(RPC::create($host)))->select($cacheName); $this->dataConverter = $dataConverter ?? DataConverter::createDefault(); } - public static function create(DataConverterInterface $dataConverter = null): self + public static function create(?DataConverterInterface $dataConverter = null): self { $env = Environment::fromGlobals(); return new self($env->getRPCAddress(), self::CACHE_NAME, $dataConverter); diff --git a/src/Worker/Transport/Command/Client/Request.php b/src/Worker/Transport/Command/Client/Request.php index 44ac4083f..d39819961 100644 --- a/src/Worker/Transport/Command/Client/Request.php +++ b/src/Worker/Transport/Command/Client/Request.php @@ -40,7 +40,7 @@ class Request implements RequestInterface public function __construct( protected string $name, protected array $options = [], - ValuesInterface $payloads = null, + ?ValuesInterface $payloads = null, ?HeaderInterface $header = null, ) { $this->payloads = $payloads ?? EncodedValues::empty(); diff --git a/src/Worker/Transport/Goridge.php b/src/Worker/Transport/Goridge.php index 6df2d1c5f..ce71ded71 100644 --- a/src/Worker/Transport/Goridge.php +++ b/src/Worker/Transport/Goridge.php @@ -29,7 +29,7 @@ public function __construct(RelayInterface $relay) $this->rpc = new RPC($relay); } - public static function create(EnvironmentInterface $env = null): RPCConnectionInterface + public static function create(?EnvironmentInterface $env = null): RPCConnectionInterface { $env ??= Environment::fromGlobals(); diff --git a/src/Worker/Transport/RoadRunner.php b/src/Worker/Transport/RoadRunner.php index f422fcd18..955a214a3 100644 --- a/src/Worker/Transport/RoadRunner.php +++ b/src/Worker/Transport/RoadRunner.php @@ -46,8 +46,8 @@ public function __construct(RoadRunnerWorker $worker) } public static function create( - EnvironmentInterface $env = null, - RoadRunnerVersionChecker $versionChecker = null, + ?EnvironmentInterface $env = null, + ?RoadRunnerVersionChecker $versionChecker = null, ): HostConnectionInterface { $versionChecker ??= new RoadRunnerVersionChecker(); $versionChecker->check(); @@ -97,7 +97,7 @@ public function error(\Throwable $error): void * @return array * @throws ProtocolException */ - private function decodeHeaders(string $headers = null): array + private function decodeHeaders(?string $headers = null): array { if ($headers === null) { return []; diff --git a/src/Worker/Worker.php b/src/Worker/Worker.php index 32f736ff4..956a9f67e 100644 --- a/src/Worker/Worker.php +++ b/src/Worker/Worker.php @@ -88,7 +88,7 @@ public function registerActivityImplementations(object ...$activity): WorkerInte return $this; } - public function registerActivity(string $type, callable $factory = null): WorkerInterface + public function registerActivity(string $type, ?callable $factory = null): WorkerInterface { foreach ($this->services->activitiesReader->fromClass($type) as $proto) { if ($factory !== null) { diff --git a/src/Worker/WorkerFactoryInterface.php b/src/Worker/WorkerFactoryInterface.php index 6e7cb4a68..c094d8cc5 100644 --- a/src/Worker/WorkerFactoryInterface.php +++ b/src/Worker/WorkerFactoryInterface.php @@ -36,7 +36,7 @@ interface WorkerFactoryInterface */ public function newWorker( string $taskQueue = self::DEFAULT_TASK_QUEUE, - WorkerOptions $options = null, + ?WorkerOptions $options = null, ): WorkerInterface; /** diff --git a/src/Worker/WorkerInterface.php b/src/Worker/WorkerInterface.php index 90140f60e..90612ae55 100644 --- a/src/Worker/WorkerInterface.php +++ b/src/Worker/WorkerInterface.php @@ -72,7 +72,7 @@ public function registerActivityImplementations(object ...$activity): self; * * $worker->registerActivity(MyActivity::class, fn(ReflectionClass $class) => $container->create($class->getName())); */ - public function registerActivity(string $type, callable $factory = null): self; + public function registerActivity(string $type, ?callable $factory = null): self; /** * Returns list of registered activities. diff --git a/src/WorkerFactory.php b/src/WorkerFactory.php index b5cbd3a06..43b170dd9 100644 --- a/src/WorkerFactory.php +++ b/src/WorkerFactory.php @@ -132,8 +132,8 @@ public function __construct( } public static function create( - DataConverterInterface $converter = null, - RPCConnectionInterface $rpc = null, + ?DataConverterInterface $converter = null, + ?RPCConnectionInterface $rpc = null, ): WorkerFactoryInterface { return new static( $converter ?? DataConverter::createDefault(), @@ -143,9 +143,9 @@ public static function create( public function newWorker( string $taskQueue = self::DEFAULT_TASK_QUEUE, - WorkerOptions $options = null, - ExceptionInterceptorInterface $exceptionInterceptor = null, - PipelineProvider $interceptorProvider = null, + ?WorkerOptions $options = null, + ?ExceptionInterceptorInterface $exceptionInterceptor = null, + ?PipelineProvider $interceptorProvider = null, ): WorkerInterface { $worker = new Worker( $taskQueue, @@ -195,7 +195,7 @@ public function getEnvironment(): EnvironmentInterface return $this->env; } - public function run(HostConnectionInterface $host = null): int + public function run(?HostConnectionInterface $host = null): int { $host ??= RoadRunner::create(); $this->codec = $this->createCodec(); diff --git a/src/Workflow.php b/src/Workflow.php index 8c2b7c829..62e58e8e1 100644 --- a/src/Workflow.php +++ b/src/Workflow.php @@ -507,7 +507,7 @@ public static function timer($interval): PromiseInterface public static function continueAsNew( string $type, array $args = [], - ContinueAsNewOptions $options = null, + ?ContinueAsNewOptions $options = null, ): PromiseInterface { return self::getCurrentContext()->continueAsNew($type, $args, $options); } @@ -548,7 +548,7 @@ public static function continueAsNew( * @return T * @throws OutOfContextException in the absence of the workflow execution context. */ - public static function newContinueAsNewStub(string $class, ContinueAsNewOptions $options = null): object + public static function newContinueAsNewStub(string $class, ?ContinueAsNewOptions $options = null): object { return self::getCurrentContext()->newContinueAsNewStub($class, $options); } @@ -603,7 +603,7 @@ public static function newContinueAsNewStub(string $class, ContinueAsNewOptions public static function executeChildWorkflow( string $type, array $args = [], - ChildWorkflowOptions $options = null, + ?ChildWorkflowOptions $options = null, mixed $returnType = null, ): PromiseInterface { return self::getCurrentContext()->executeChildWorkflow($type, $args, $options, $returnType); @@ -651,7 +651,7 @@ public static function executeChildWorkflow( */ public static function newChildWorkflowStub( string $class, - ChildWorkflowOptions $options = null, + ?ChildWorkflowOptions $options = null, ): object { return self::getCurrentContext()->newChildWorkflowStub($class, $options); } @@ -700,7 +700,7 @@ public static function newChildWorkflowStub( */ public static function newUntypedChildWorkflowStub( string $name, - ChildWorkflowOptions $options = null, + ?ChildWorkflowOptions $options = null, ): ChildWorkflowStubInterface { return self::getCurrentContext()->newUntypedChildWorkflowStub($name, $options); } @@ -797,8 +797,8 @@ public static function newUntypedExternalWorkflowStub(WorkflowExecution $executi public static function executeActivity( string $type, array $args = [], - ActivityOptionsInterface $options = null, - Type|string|\ReflectionClass|\ReflectionType $returnType = null, + ?ActivityOptionsInterface $options = null, + Type|string|\ReflectionClass|\ReflectionType|null $returnType = null, ): PromiseInterface { return self::getCurrentContext()->executeActivity($type, $args, $options, $returnType); } @@ -838,7 +838,7 @@ public static function executeActivity( */ public static function newActivityStub( string $class, - ActivityOptionsInterface $options = null, + ?ActivityOptionsInterface $options = null, ): object { return self::getCurrentContext()->newActivityStub($class, $options); } @@ -865,7 +865,7 @@ public static function newActivityStub( * @throws OutOfContextException in the absence of the workflow execution context. */ public static function newUntypedActivityStub( - ActivityOptionsInterface $options = null, + ?ActivityOptionsInterface $options = null, ): ActivityStubInterface { return self::getCurrentContext()->newUntypedActivityStub($options); } diff --git a/src/Workflow/ActivityStubInterface.php b/src/Workflow/ActivityStubInterface.php index 7ec4bb41a..bc4a9fab0 100644 --- a/src/Workflow/ActivityStubInterface.php +++ b/src/Workflow/ActivityStubInterface.php @@ -30,7 +30,7 @@ public function getOptions(): ActivityOptionsInterface; public function execute( string $name, array $args = [], - Type|string|\ReflectionClass|\ReflectionType $returnType = null, + Type|string|\ReflectionClass|\ReflectionType|null $returnType = null, bool $isLocalActivity = false, ): PromiseInterface; } diff --git a/src/Workflow/WorkflowContextInterface.php b/src/Workflow/WorkflowContextInterface.php index 747fc4dbb..62fb982b2 100644 --- a/src/Workflow/WorkflowContextInterface.php +++ b/src/Workflow/WorkflowContextInterface.php @@ -112,13 +112,13 @@ public function sideEffect(callable $context): PromiseInterface; * @internal This is an internal method * */ - public function complete(array $result = null, \Throwable $failure = null): PromiseInterface; + public function complete(?array $result = null, ?\Throwable $failure = null): PromiseInterface; /** * @internal This is an internal method * */ - public function panic(\Throwable $failure = null): PromiseInterface; + public function panic(?\Throwable $failure = null): PromiseInterface; /** * Stops workflow execution work for a specified period. @@ -139,7 +139,7 @@ public function timer($interval): PromiseInterface; public function continueAsNew( string $type, array $args = [], - ContinueAsNewOptions $options = null, + ?ContinueAsNewOptions $options = null, ): PromiseInterface; /** @@ -151,7 +151,7 @@ public function continueAsNew( * @param class-string $class * @return T */ - public function newContinueAsNewStub(string $class, ContinueAsNewOptions $options = null): object; + public function newContinueAsNewStub(string $class, ?ContinueAsNewOptions $options = null): object; /** * Calls an external workflow without stopping the current one. @@ -164,7 +164,7 @@ public function newContinueAsNewStub(string $class, ContinueAsNewOptions $option public function executeChildWorkflow( string $type, array $args = [], - ChildWorkflowOptions $options = null, + ?ChildWorkflowOptions $options = null, $returnType = null, ): PromiseInterface; @@ -180,7 +180,7 @@ public function executeChildWorkflow( */ public function newChildWorkflowStub( string $class, - ChildWorkflowOptions $options = null, + ?ChildWorkflowOptions $options = null, ): object; /** @@ -192,7 +192,7 @@ public function newChildWorkflowStub( */ public function newUntypedChildWorkflowStub( string $type, - ChildWorkflowOptions $options = null, + ?ChildWorkflowOptions $options = null, ): ChildWorkflowStubInterface; /** @@ -228,8 +228,8 @@ public function newUntypedExternalWorkflowStub(WorkflowExecution $execution): Ex public function executeActivity( string $type, array $args = [], - ActivityOptionsInterface $options = null, - Type|string|\ReflectionClass|\ReflectionType $returnType = null, + ?ActivityOptionsInterface $options = null, + Type|string|\ReflectionClass|\ReflectionType|null $returnType = null, ): PromiseInterface; /** @@ -246,7 +246,7 @@ public function executeActivity( */ public function newActivityStub( string $class, - ActivityOptionsInterface $options = null, + ?ActivityOptionsInterface $options = null, ): object; /** @@ -258,7 +258,7 @@ public function newActivityStub( * */ public function newUntypedActivityStub( - ActivityOptionsInterface $options = null, + ?ActivityOptionsInterface $options = null, ): ActivityStubInterface; /** diff --git a/src/Workflow/WorkflowExecution.php b/src/Workflow/WorkflowExecution.php index db8561068..4e5a88fa0 100644 --- a/src/Workflow/WorkflowExecution.php +++ b/src/Workflow/WorkflowExecution.php @@ -37,7 +37,7 @@ class WorkflowExecution #[Marshal(name: 'run_id')] private ?string $runId; - public function __construct(string $id = null, ?string $runId = null) + public function __construct(?string $id = null, ?string $runId = null) { $this->id = $id ?? Uuid::nil(); $this->runId = $runId; diff --git a/src/Workflow/WorkflowMethod.php b/src/Workflow/WorkflowMethod.php index aff8c1795..1951937aa 100644 --- a/src/Workflow/WorkflowMethod.php +++ b/src/Workflow/WorkflowMethod.php @@ -33,7 +33,7 @@ final class WorkflowMethod #[Immutable] public ?string $name = null; - public function __construct(string $name = null) + public function __construct(?string $name = null) { $this->name = $name; } diff --git a/src/Workflow/WorkflowRunInterface.php b/src/Workflow/WorkflowRunInterface.php index 307ecf184..87003f8cd 100644 --- a/src/Workflow/WorkflowRunInterface.php +++ b/src/Workflow/WorkflowRunInterface.php @@ -45,7 +45,7 @@ public function getExecution(): WorkflowExecution; * * @see DateInterval */ - public function getResult($type = null, int $timeout = null): mixed; + public function getResult($type = null, ?int $timeout = null): mixed; public function describe(): WorkflowExecutionDescription; } diff --git a/testing/src/ActivityMocker.php b/testing/src/ActivityMocker.php index 30c1e0b7e..8ef6e52b7 100644 --- a/testing/src/ActivityMocker.php +++ b/testing/src/ActivityMocker.php @@ -11,7 +11,7 @@ final class ActivityMocker { private ActivityInvocationCacheInterface $cache; - public function __construct(ActivityInvocationCacheInterface $cache = null) + public function __construct(?ActivityInvocationCacheInterface $cache = null) { $this->cache = $cache ?? RoadRunnerActivityInvocationCache::create(); } diff --git a/testing/src/Environment.php b/testing/src/Environment.php index 79fcdec40..312452641 100644 --- a/testing/src/Environment.php +++ b/testing/src/Environment.php @@ -44,7 +44,7 @@ public static function create(): self /** * @param array $envs */ - public function start(string $rrCommand = null, int $commandTimeout = 10, array $envs = []): void + public function start(?string $rrCommand = null, int $commandTimeout = 10, array $envs = []): void { $this->startTemporalTestServer($commandTimeout); $this->startRoadRunner($rrCommand, $commandTimeout, $envs); @@ -110,7 +110,7 @@ public function startTemporalTestServer(int $commandTimeout = 10): void /** * @param array $envs */ - public function startRoadRunner(string $rrCommand = null, int $commandTimeout = 10, array $envs = []): void + public function startRoadRunner(?string $rrCommand = null, int $commandTimeout = 10, array $envs = []): void { $this->roadRunnerProcess = new Process( command: $rrCommand ? \explode(' ', $rrCommand) : [$this->systemInfo->rrExecutable, 'serve'], diff --git a/testing/src/WorkerFactory.php b/testing/src/WorkerFactory.php index 97eb0f713..5def52efa 100644 --- a/testing/src/WorkerFactory.php +++ b/testing/src/WorkerFactory.php @@ -47,9 +47,9 @@ public static function create( public function newWorker( string $taskQueue = self::DEFAULT_TASK_QUEUE, - WorkerOptions $options = null, - ExceptionInterceptorInterface $exceptionInterceptor = null, - PipelineProvider $interceptorProvider = null, + ?WorkerOptions $options = null, + ?ExceptionInterceptorInterface $exceptionInterceptor = null, + ?PipelineProvider $interceptorProvider = null, ): WorkerInterface { $worker = new WorkerMock( new Worker( diff --git a/testing/src/WorkerMock.php b/testing/src/WorkerMock.php index 6b88fbea2..a725dbfa9 100644 --- a/testing/src/WorkerMock.php +++ b/testing/src/WorkerMock.php @@ -63,7 +63,7 @@ public function registerActivityImplementations(object ...$activity): WorkerInte return $this->wrapped->registerActivityImplementations(...$activity); } - public function registerActivity(string $type, callable $factory = null): WorkerInterface + public function registerActivity(string $type, ?callable $factory = null): WorkerInterface { return $this->wrapped->registerActivity($type, $factory); } From 3d9737f0067e43011d9242be6be1a0203c065395 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Mon, 9 Dec 2024 14:14:26 +0400 Subject: [PATCH 15/21] ci: add PHP 8.4 in tests pipeline --- .github/workflows/run-test-suite.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-test-suite.yml b/.github/workflows/run-test-suite.yml index 3abf00c31..3ee5da826 100644 --- a/.github/workflows/run-test-suite.yml +++ b/.github/workflows/run-test-suite.yml @@ -47,7 +47,7 @@ jobs: strategy: fail-fast: ${{ inputs.fail-fast }} matrix: - php: [ 8.1, 8.2, 8.3 ] + php: [ 8.1, 8.2, 8.3, 8.4 ] os: [ ubuntu-latest ] extensions-suffix: [ '', ', protobuf' ] dependencies: [ lowest , highest ] From 756e749bb0b354491ec841d936c129a5728f4942 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Mon, 9 Dec 2024 14:21:21 +0400 Subject: [PATCH 16/21] fix "Error when evaluating 'timeout-minutes' for job 'test'" --- .github/workflows/run-test-suite.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/run-test-suite.yml b/.github/workflows/run-test-suite.yml index 3ee5da826..c9b89fef6 100644 --- a/.github/workflows/run-test-suite.yml +++ b/.github/workflows/run-test-suite.yml @@ -42,7 +42,7 @@ jobs: test: name: PHP${{ matrix.php }}${{ matrix.extensions-suffix }}, ${{ matrix.os }}, ${{ matrix.dependencies }} deps runs-on: ${{ matrix.os }} - timeout-minutes: ${{ matrix.timeout-minutes }} + timeout-minutes: ${{ inputs.test-timeout }} env: {GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'} strategy: fail-fast: ${{ inputs.fail-fast }} @@ -51,7 +51,6 @@ jobs: os: [ ubuntu-latest ] extensions-suffix: [ '', ', protobuf' ] dependencies: [ lowest , highest ] - timeout-minutes: [ '${{ inputs.test-timeout }}' ] include: - os: windows-latest extensions-suffix: ', protobuf' From 9b3feb4907e042558ab9979e4fe42c31a983eb98 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Mon, 9 Dec 2024 14:38:05 +0400 Subject: [PATCH 17/21] Add composer command `get:binaries` and use it in CI --- .github/workflows/run-test-suite.yml | 3 +-- composer.json | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-test-suite.yml b/.github/workflows/run-test-suite.yml index c9b89fef6..f729de487 100644 --- a/.github/workflows/run-test-suite.yml +++ b/.github/workflows/run-test-suite.yml @@ -106,8 +106,7 @@ jobs: - name: Download RoadRunner if: inputs.download-binaries == true - run: | - vendor/bin/dload get --no-interaction -vv + run: composer get:binaries - name: Run tests run: ${{ inputs.test-command }} diff --git a/composer.json b/composer.json index dc65d5079..df64ed763 100644 --- a/composer.json +++ b/composer.json @@ -82,6 +82,7 @@ }, "scripts": { "post-update-cmd": "Temporal\\Worker\\Transport\\RoadRunnerVersionChecker::postUpdate", + "get:binaries": "dload get --no-interaction -vv", "cs:diff": "php-cs-fixer fix --dry-run -v --diff --show-progress dots", "cs:fix": "php-cs-fixer fix -v", "psalm": "psalm", From d77ad58d82645413a0d7ecd6e9c436fd2b2b3b37 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Mon, 9 Dec 2024 15:52:31 +0400 Subject: [PATCH 18/21] Ignore PHP dependencies constrain in CI when PHP 8.4 is used --- .github/workflows/run-test-suite.yml | 18 ++++++++++++++---- composer.json | 1 - .../Exception/FailureConverterTestCase.php | 15 +++++++++++---- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/.github/workflows/run-test-suite.yml b/.github/workflows/run-test-suite.yml index f729de487..0eda23db9 100644 --- a/.github/workflows/run-test-suite.yml +++ b/.github/workflows/run-test-suite.yml @@ -91,20 +91,30 @@ jobs: php-${{ matrix.php }}-${{ matrix.os }}-composer- - name: Install lowest dependencies from composer.json - if: matrix.dependencies == 'lowest' + if: matrix.dependencies == 'lowest' && matrix.php != '8.4' run: composer update --no-interaction --no-progress --prefer-lowest + - name: Install lowest dependencies from composer.json + if: matrix.dependencies == 'lowest' && matrix.php == '8.4' + run: composer update --no-interaction --no-progress --prefer-lowest --ignore-platform-req php + + - name: Validate lowest dependencies - if: matrix.dependencies == 'lowest' + if: matrix.dependencies == 'lowest' && matrix.php == '8.1' env: COMPOSER_POOL_OPTIMIZER: 0 run: vendor/bin/validate-prefer-lowest + - name: Install highest dependencies from composer.json - if: matrix.dependencies == 'highest' + if: matrix.dependencies == 'highest' && matrix.php != '8.4' run: composer update --no-interaction --no-progress - - name: Download RoadRunner + - name: Install highest dependencies from composer.json + if: matrix.dependencies == 'highest' && matrix.php == '8.4' + run: composer update --no-interaction --no-progress --ignore-platform-req php + + - name: Download binaries if: inputs.download-binaries == true run: composer get:binaries diff --git a/composer.json b/composer.json index df64ed763..4fa82650a 100644 --- a/composer.json +++ b/composer.json @@ -61,7 +61,6 @@ "phpunit/phpunit": "^10.5", "spiral/code-style": "~2.1.2", "spiral/core": "^3.13", - "symfony/var-dumper": "^6.0 || ^7.0", "ta-tikoma/phpunit-architecture-test": "^0.8.4", "vimeo/psalm": "^4.30 || ^5.4" }, diff --git a/tests/Unit/Exception/FailureConverterTestCase.php b/tests/Unit/Exception/FailureConverterTestCase.php index ee32ee962..59db778ee 100644 --- a/tests/Unit/Exception/FailureConverterTestCase.php +++ b/tests/Unit/Exception/FailureConverterTestCase.php @@ -72,10 +72,17 @@ public function testStackTraceStringForAdditionalContextEvenWhenClassIsNotPresen $trace, ); - self::assertStringContainsString( - 'Temporal\Tests\Unit\Exception\FailureConverterTestCase->Temporal\Tests\Unit\Exception\{closure}()', - $trace, - ); + if (\PHP_VERSION_ID < 80400) { + self::assertStringContainsString( + 'Temporal\Tests\Unit\Exception\FailureConverterTestCase->Temporal\Tests\Unit\Exception\{closure}()', + $trace, + ); + } else { + self::assertStringContainsString( + 'Temporal\Tests\Unit\Exception\FailureConverterTestCase->{closure:Temporal\Tests\Unit\Exception\FailureConverterTestCase::testStackTraceStringForAdditionalContextEvenWhenClassIsNotPresented()', + $trace, + ); + } self::assertStringContainsString( 'call_user_func(Closure)', From 40f62996b772757a632b8b4d703bb43da633c64a Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Mon, 9 Dec 2024 16:20:46 +0400 Subject: [PATCH 19/21] Use DLOAD util via CPX because it fails in lower deps with PHP 8.4 --- .github/workflows/run-test-suite.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-test-suite.yml b/.github/workflows/run-test-suite.yml index 0eda23db9..a57473cb7 100644 --- a/.github/workflows/run-test-suite.yml +++ b/.github/workflows/run-test-suite.yml @@ -55,6 +55,7 @@ jobs: - os: windows-latest extensions-suffix: ', protobuf' php: 8.1 + dependencies: highest steps: - name: Set Git To Use LF run: | @@ -77,6 +78,10 @@ jobs: - name: Validate composer.json and composer.lock run: composer validate --strict + - name: Download CPX (PHP 8.4) + if: inputs.download-binaries == true && matrix.php == '8.4' + run: composer global require cpx/cpx + - name: Get Composer Cache Directory id: composer-cache run: | @@ -94,7 +99,7 @@ jobs: if: matrix.dependencies == 'lowest' && matrix.php != '8.4' run: composer update --no-interaction --no-progress --prefer-lowest - - name: Install lowest dependencies from composer.json + - name: Install lowest dependencies from composer.json ignoring ext-php constraint (PHP 8.4) if: matrix.dependencies == 'lowest' && matrix.php == '8.4' run: composer update --no-interaction --no-progress --prefer-lowest --ignore-platform-req php @@ -110,13 +115,18 @@ jobs: if: matrix.dependencies == 'highest' && matrix.php != '8.4' run: composer update --no-interaction --no-progress - - name: Install highest dependencies from composer.json + - name: Install highest dependencies from composer.json ignoring ext-php constraint (PHP 8.4) if: matrix.dependencies == 'highest' && matrix.php == '8.4' run: composer update --no-interaction --no-progress --ignore-platform-req php + - name: Download binaries - if: inputs.download-binaries == true + if: inputs.download-binaries == true && matrix.php != '8.4' run: composer get:binaries + - name: Download binaries (PHP 8.4) + if: inputs.download-binaries == true && matrix.php == '8.4' + run: cpx internal/dload get --no-interaction + - name: Run tests run: ${{ inputs.test-command }} From 552c26f520a01d739e054f184899f7dbd03db72b Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Mon, 9 Dec 2024 16:46:43 +0400 Subject: [PATCH 20/21] Functional tests bootstrap: build RR start command based on the current platform --- tests/Functional/bootstrap.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/Functional/bootstrap.php b/tests/Functional/bootstrap.php index 1128b7843..df7b3642f 100644 --- a/tests/Functional/bootstrap.php +++ b/tests/Functional/bootstrap.php @@ -9,10 +9,14 @@ chdir(__DIR__ . '/../..'); require_once __DIR__ . '/../../vendor/autoload.php'; +$sysInfo = \Temporal\Testing\SystemInfo::detect(); + $environment = Environment::create(); $environment->startTemporalTestServer(); (new SearchAttributeTestInvoker)(); -$environment->startRoadRunner('./rr serve -c .rr.silent.yaml -w tests/Functional'); +$environment->startRoadRunner( + rrCommand: sprintf('%s serve -c .rr.silent.yaml -w tests/Functional', $sysInfo->rrExecutable), +); register_shutdown_function(fn() => $environment->stop()); // Default feature flags From 00c4108357b310ec8edf0700061c65cb51483cce Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Mon, 9 Dec 2024 17:44:37 +0400 Subject: [PATCH 21/21] Fix min symfony/http-client version to improve tests --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4fa82650a..8009b87df 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,7 @@ "spiral/roadrunner-kv": "^4.2", "spiral/roadrunner-worker": "^3.5", "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", - "symfony/http-client": "^5.4 || ^6.0 || ^7.0", + "symfony/http-client": "^5.4.3 || ^6.0.3 || ^7.0", "symfony/process": "^5.4 || ^6.0 || ^7.0" }, "autoload": {