Skip to content

Commit a5c35a5

Browse files
authored
Merge branch 'master' into camper/missing-dependency-cooldown-finding-cooldown-sdk-php
2 parents 4759610 + 50511c2 commit a5c35a5

51 files changed

Lines changed: 1342 additions & 214 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/run-test-suite.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ jobs:
5353
strategy:
5454
fail-fast: ${{ inputs.fail-fast }}
5555
matrix:
56-
php: [ 8.1, 8.2, 8.3, 8.4 ]
56+
php:
57+
- 8.1
58+
- 8.2
59+
- 8.3
60+
- 8.4
61+
- 8.5
5762
os: [ ubuntu-latest ]
5863
extensions-suffix: [ '', ', protobuf' ]
5964
dependencies: [ lowest , highest ]

CONTRIBUTING.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Contributing
2+
3+
This doc is intended for contributors to `sdk-php` (hopefully that's you!)
4+
5+
All contributors must complete the Temporal Contributor License Agreement (CLA) before changes can be merged. A link to the CLA will be posted in the PR.
6+
7+
## Development environment
8+
9+
- [PHP 8.1+](https://www.php.net/downloads.php)
10+
- [Composer](https://getcomposer.org/download/)
11+
12+
## Build
13+
14+
```bash
15+
composer install # Downloads regular dependencies
16+
composer run get:binaries # Downloads dependencies for local development
17+
pecl install grpc # Required by the Temporal client
18+
pecl install protobuf # Improves performance of protobuf serialization
19+
```
20+
21+
## Test
22+
23+
```bash
24+
composer run test:unit # Unit tests
25+
composer run test:func # Functional tests
26+
composer run test:arch # Architecture tests
27+
composer run test:accept # All acceptance tests
28+
composer run test:accept-fast # All acceptance tests except the slow ones
29+
composer run test:accept-slow # Only the slow acceptance tests
30+
```
31+
32+
## Quality control
33+
34+
```bash
35+
composer run cs:diff # Show code style violations (dry run)
36+
composer run cs:fix # Auto-fix code style violations
37+
composer run psalm # Run static analysis
38+
composer run psalm:baseline # Update the Psalm baseline file
39+
```

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
![Temporal PHP SDK](https://raw.githubusercontent.com/temporalio/assets/main/files/w/php.png)
2+
13
# Temporal PHP SDK
24

35
Temporal is a distributed, scalable, durable, and highly available orchestration
@@ -140,6 +142,10 @@ Web UI will be available at `http://localhost:8000`.
140142
For advanced autocomplete while coding in PHPStorm, use [Meta Storm plugin](https://github.com/xepozz/meta-storm-idea-plugin).
141143
The plugin provides better autocomplete and links Workflow and Activity when writing and debugging code.
142144

145+
## Contibuting
146+
147+
We'd love your help improving the Temporal PHP SDK. Please review our [contribution guidelines](./CONTRIBUTING.md).
148+
143149
## Resources
144150

145151
Read the docs

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"spiral/roadrunner-kv": "^4.3.1",
4141
"spiral/roadrunner-worker": "^3.6.2",
4242
"symfony/filesystem": "^5.4.45 || ^6.4.13 || ^7.0 || ^8.0",
43-
"symfony/http-client": "^5.4.49 || ^6.4.17 || ^7.0 || ^8.0",
43+
"symfony/http-client": "^5.4.53 || ^6.4.17 || ^7.0 || ^8.0",
4444
"symfony/polyfill-php83": "^1.31.0",
4545
"symfony/process": "^5.4.51 || ^6.4.15 || ^7.0 || ^8.0"
4646
},

phpunit.xml.dist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@
8282
<directory suffix="TestCase.php">tests/Functional</directory>
8383
</testsuite>
8484
</testsuites>
85+
<extensions>
86+
<bootstrap class="Temporal\Tests\Acceptance\AcceptanceBootExtension"/>
87+
</extensions>
8588
<groups>
8689
<exclude>
8790
<group>skip-on-test-server</group>

src/Activity.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,10 @@ public static function hasHeartbeatDetails(): bool
9595
*
9696
* This method retrieves the payload that was passed into the last call of the {@see Activity::heartbeat()} method.
9797
*
98-
* @param null|mixed $type
9998
* @psalm-param TType $type
10099
* @throws OutOfContextException in the absence of the activity execution context.
101100
*/
102-
public static function getHeartbeatDetails($type = null): mixed
101+
public static function getHeartbeatDetails(mixed $type = null): mixed
103102
{
104103
$context = self::getCurrentContext();
105104

@@ -158,7 +157,7 @@ public static function doNotCompleteOnReturn(): void
158157
*
159158
* @throws OutOfContextException in the absence of the activity execution context.
160159
*/
161-
public static function heartbeat($details): void
160+
public static function heartbeat(mixed $details): void
162161
{
163162
$context = self::getCurrentContext();
164163

src/Activity/ActivityCancellationDetails.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ public function __construct(
1818
public readonly bool $paused = false,
1919
public readonly bool $timedOut = false,
2020
public readonly bool $workerShutdown = false,
21+
public readonly bool $reset = false,
2122
) {}
2223
}

src/Activity/ActivityContextInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Temporal\Exception\Client\ActivityCanceledException;
1818
use Temporal\Exception\Client\ActivityCompletionException;
1919
use Temporal\Exception\Client\ActivityPausedException;
20+
use Temporal\Exception\Client\ActivityResetException;
2021

2122
/**
2223
* @psalm-import-type TType from Type
@@ -67,6 +68,7 @@ public function doNotCompleteOnReturn(): void;
6768
* @throws ActivityCompletionException
6869
* @throws ActivityCanceledException
6970
* @throws ActivityPausedException
71+
* @throws ActivityResetException
7072
*
7173
* @see Activity::heartbeat()
7274
*

src/Client/Update/UpdateHandle.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
/**
2121
* UpdateHandle is a handle to an update workflow execution request that can be used to get the
2222
* status of that update request.
23+
* @template ReturnType
2324
*/
2425
final class UpdateHandle
2526
{
@@ -67,6 +68,7 @@ public function hasResult(): bool
6768
*
6869
* @param int|float|null $timeout Timeout in seconds. Accuracy to milliseconds.
6970
*
71+
* @return ReturnType
7072
* @throws WorkflowUpdateException
7173
* @throws WorkflowUpdateRPCTimeoutOrCanceledException
7274
*/

src/Client/Workflow/WorkflowExecutionDescription.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Temporal\Client\Workflow;
66

7+
use Temporal\Workflow\PendingActivityInfo;
78
use Temporal\Workflow\WorkflowExecutionConfig;
89
use Temporal\Workflow\WorkflowExecutionInfo;
910

@@ -15,10 +16,13 @@
1516
final class WorkflowExecutionDescription
1617
{
1718
/**
19+
* @param list<PendingActivityInfo> $pendingActivities
20+
*
1821
* @internal
1922
*/
2023
public function __construct(
2124
public readonly WorkflowExecutionConfig $config,
2225
public readonly WorkflowExecutionInfo $info,
26+
public readonly array $pendingActivities = [],
2327
) {}
2428
}

0 commit comments

Comments
 (0)