diff --git a/.github/workflows/run-test-suite.yml b/.github/workflows/run-test-suite.yml index 3abf00c3..a57473cb 100644 --- a/.github/workflows/run-test-suite.yml +++ b/.github/workflows/run-test-suite.yml @@ -42,20 +42,20 @@ 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 }} 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 ] - timeout-minutes: [ '${{ inputs.test-timeout }}' ] include: - os: windows-latest extensions-suffix: ', protobuf' php: 8.1 + dependencies: highest steps: - name: Set Git To Use LF run: | @@ -78,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: | @@ -92,23 +96,37 @@ 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 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 + + - 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 - if: inputs.download-binaries == true - run: | - vendor/bin/dload get --no-interaction -vv + - 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 && 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 }} diff --git a/composer.json b/composer.json index dc65d507..8009b87d 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": { @@ -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" }, @@ -82,6 +81,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", diff --git a/src/Activity/ActivityMethod.php b/src/Activity/ActivityMethod.php index e7882336..4942402b 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 a6efee90..4c08cad4 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 895c6eaf..c3caf5f2 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 441e5f32..4099b1bd 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 7b96da82..1ecb8803 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 bdeedc2c..8e67be3a 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 9a486a43..92380977 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 7eb2d720..dd9c3dce 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 bcb7de0c..1156eb17 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 f25e325e..49c08a25 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 bffacb4a..9a9c5bae 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 5122431a..bb0ed99f 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 d9fe7fb7..8f422e4d 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 540edece..70af788e 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 a474047d..daeed894 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 e8c7eb9a..e5506ca8 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 1b7850e4..9b6bb869 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 c9ecfc32..28c31e80 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 5e698050..1307131d 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 efc59c9c..538644e1 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 8574d66e..04adac67 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 67741370..3aceb7cd 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 c18a2563..6a983d94 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 eccb17e9..f01ebd5e 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 2fadd0ab..b61a66ae 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 677edb0a..f10c87f6 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 4d5e101e..396f65ea 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 c2f53e8c..13d24fdd 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 0ce1a2b4..2289bdeb 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 1146b74b..4e37ea0d 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 da23ec18..e616d6c8 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 d89851f2..03febaf6 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 27955621..6a28df07 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 8b74d1c4..97b1533e 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 f6a58792..bbdd9c99 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 070386c3..5c7cc03d 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 1491d02f..85f284f7 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 adb882a9..ef00264f 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 5dc9b4da..ceacaac1 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 c033d192..62b47603 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 0485c5c1..00febc9e 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 4905be80..e46a82b5 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 384795eb..76a2bb3d 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 40546226..ec41ef15 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 61905ae3..75d1527a 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 61feb6a1..1c632584 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 b9214e77..1dfe6724 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 a3fc66ba..d390737a 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 0c75583d..d914721a 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 a5824a99..43c2a6d1 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 3c770a96..10ed8a3c 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 694141f6..372e2266 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 0e40efb7..85430102 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 c7f32792..25140b5b 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 fc61b28b..f23eb4e5 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 c3d914e7..0cfc8d84 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 16c60cf1..c03c2042 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 6cf2e3a4..378c971c 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 a00101b0..234d264e 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 2c462f5a..980455f0 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 89e930f9..00f4fd9d 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 f2518f41..9a7c6faf 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 da1ba74c..b7772806 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 76b9f024..6400c2a1 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 f5e8442d..0c1c7a86 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 c9ab2a12..d70f9083 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 44ac4083..d3981996 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 6df2d1c5..ce71ded7 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 f422fcd1..955a214a 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 32f736ff..956a9f67 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 6e7cb4a6..c094d8cc 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 90140f60..90612ae5 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 b5cbd3a0..43b170dd 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 8c2b7c82..62e58e8e 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 7ec4bb41..bc4a9fab 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 747fc4db..62fb982b 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 db856106..4e5a88fa 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 aff8c179..1951937a 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 307ecf18..87003f8c 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 30c1e0b7..8ef6e52b 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 79fcdec4..31245264 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 97eb0f71..5def52ef 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 6b88fbea..a725dbfa 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); } diff --git a/tests/Functional/bootstrap.php b/tests/Functional/bootstrap.php index 1128b784..df7b3642 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 diff --git a/tests/Unit/Exception/FailureConverterTestCase.php b/tests/Unit/Exception/FailureConverterTestCase.php index ee32ee96..59db778e 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)',