Skip to content

Commit 3a61fca

Browse files
authored
Merge pull request #553: Expose Typed Search Attributes
2 parents fc67190 + 8ca1c3f commit 3a61fca

Some content is hidden

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

46 files changed

+2202
-224
lines changed

.gitattributes

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
* text=auto
22

3-
.github/ export-ignore
3+
/.* export-ignore
44
config/ export-ignore
55
resources/scripts/ export-ignore
66
runtime/ export-ignore
77
tests/ export-ignore
88

9-
.editorconfig export-ignore
10-
.gitattributes export-ignore
11-
.gitignore export-ignore
12-
.php-cs-fixer.dist.php export-ignore
13-
dload.xml export-ignore
9+
/*.xml export-ignore
10+
/*.xml.dist export-ignore
1411
Makefile export-ignore
15-
phpunit.xml.dist export-ignore
16-
psalm.xml export-ignore
17-
psalm-baseline.xml export-ignore
18-
phpdoc.dist.xml export-ignore

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ Thumbs.db
1919
*.exe
2020
rr
2121
temporal-test-server
22+
.ai

.php-cs-fixer.dist.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@
88
->include(__DIR__ . '/src')
99
->include(__DIR__ . '/testing/src')
1010
->include(__FILE__)
11-
->exclude(__DIR__ . '/src/Client/GRPC/ServiceClientInterface.php')
1211
->allowRisky(true)
1312
->build();

composer.json

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,24 @@
2424
"php": ">=8.1",
2525
"ext-curl": "*",
2626
"ext-json": "*",
27-
"google/common-protos": "^1.3 || ^2.0 || ^3.0 || ^4.0",
28-
"google/protobuf": "^3.22 || ^4.0",
29-
"grpc/grpc": "^1.42",
30-
"nesbot/carbon": "^2.72 || ^3.0.2",
31-
"psr/log": "^2.0 || ^3.0",
32-
"ramsey/uuid": "^4.7",
33-
"react/promise": "^2.9",
34-
"roadrunner-php/roadrunner-api-dto": "^1.9.0",
35-
"roadrunner-php/version-checker": "^1.0",
36-
"spiral/attributes": "^3.1.6",
37-
"spiral/roadrunner": "^2024.3",
38-
"spiral/roadrunner-cli": "^2.5",
39-
"spiral/roadrunner-kv": "^4.2",
40-
"spiral/roadrunner-worker": "^3.5",
41-
"symfony/filesystem": "^5.4 || ^6.0 || ^7.0",
42-
"symfony/http-client": "^5.4.3 || ^6.0.3 || ^7.0",
43-
"symfony/process": "^5.4 || ^6.0 || ^7.0"
27+
"google/common-protos": "^1.4 || ^2.2 || ^3.2 || ^4.9",
28+
"google/protobuf": "^3.25.5 || ^4.29.3",
29+
"grpc/grpc": "^1.57",
30+
"nesbot/carbon": "^2.72.6 || ^3.8.4",
31+
"psr/log": "^2.0 || ^3.0.2",
32+
"ramsey/uuid": "^4.7.6",
33+
"react/promise": "^2.11",
34+
"roadrunner-php/roadrunner-api-dto": "^1.10.0",
35+
"roadrunner-php/version-checker": "^1.0.1",
36+
"spiral/attributes": "^3.1.8",
37+
"spiral/roadrunner": "^2024.3.2",
38+
"spiral/roadrunner-cli": "^2.6",
39+
"spiral/roadrunner-kv": "^4.3",
40+
"spiral/roadrunner-worker": "^3.6.1",
41+
"symfony/filesystem": "^5.4.45 || ^6.4.13 || ^7.0",
42+
"symfony/http-client": "^5.4.49 || ^6.4.17 || ^7.0",
43+
"symfony/polyfill-php83": "^1.31.0",
44+
"symfony/process": "^5.4.47 || ^6.4.15 || ^7.0"
4445
},
4546
"autoload": {
4647
"psr-4": {
@@ -51,18 +52,18 @@
5152
}
5253
},
5354
"require-dev": {
54-
"buggregator/trap": "^1.10.1",
55-
"composer/composer": "^2.0",
55+
"buggregator/trap": "^1.13.0",
56+
"composer/composer": "^2.8.4",
5657
"dereuromark/composer-prefer-lowest": "^0.1.10",
57-
"doctrine/annotations": "^1.14|^2.0.0",
58+
"doctrine/annotations": "^1.14.4 || ^2.0.2",
5859
"internal/dload": "^1.0",
5960
"jetbrains/phpstorm-attributes": "dev-master@dev",
60-
"laminas/laminas-code": "^4.0",
61-
"phpunit/phpunit": "^10.5",
61+
"laminas/laminas-code": "^4.16",
62+
"phpunit/phpunit": "^10.5.41",
6263
"spiral/code-style": "~2.1.2",
63-
"spiral/core": "^3.13",
64+
"spiral/core": "^3.14.9",
6465
"ta-tikoma/phpunit-architecture-test": "^0.8.4",
65-
"vimeo/psalm": "^4.30 || ^5.4"
66+
"vimeo/psalm": "^5.26.1 || ^6.2"
6667
},
6768
"autoload-dev": {
6869
"psr-4": {

psalm-baseline.xml

Lines changed: 60 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0">
2+
<files psalm-version="6.2.0@814dfde37b43a1fe6d9b0996e08b19661af53bc5">
33
<file src="src/Activity.php">
44
<ImplicitToStringCast>
55
<code><![CDATA[$type]]></code>
@@ -40,6 +40,11 @@
4040
<code><![CDATA[recordHeartbeatByToken]]></code>
4141
</MissingReturnType>
4242
</file>
43+
<file src="src/Client/Common/Paginator.php">
44+
<PossiblyNullPropertyAssignmentValue>
45+
<code><![CDATA[$loader->current()]]></code>
46+
</PossiblyNullPropertyAssignmentValue>
47+
</file>
4348
<file src="src/Client/GRPC/Context.php">
4449
<ArgumentTypeCoercion>
4550
<code><![CDATA[$format]]></code>
@@ -181,14 +186,20 @@
181186
</file>
182187
<file src="src/Client/WorkflowOptions.php">
183188
<ImpureMethodCall>
189+
<code><![CDATA[$this->typedSearchAttributes]]></code>
184190
<code><![CDATA[setFields]]></code>
185191
<code><![CDATA[setIndexedFields]]></code>
192+
<code><![CDATA[setIndexedFields]]></code>
193+
<code><![CDATA[toPayload]]></code>
186194
<code><![CDATA[toPayload]]></code>
187195
<code><![CDATA[toPayload]]></code>
188196
</ImpureMethodCall>
189197
<PossiblyNullReference>
190198
<code><![CDATA[mergeWith]]></code>
191199
</PossiblyNullReference>
200+
<UnnecessaryVarAnnotation>
201+
<code><![CDATA[SearchAttributeKey]]></code>
202+
</UnnecessaryVarAnnotation>
192203
</file>
193204
<file src="src/Common/CronSchedule.php">
194205
<DeprecatedClass>
@@ -214,6 +225,37 @@
214225
<code><![CDATA[DateInterval::toDuration($this->maximumInterval)]]></code>
215226
</PossiblyNullArgument>
216227
</file>
228+
<file src="src/Common/SearchAttributes/SearchAttributeKey.php">
229+
<ImpureMethodCall>
230+
<code><![CDATA[valueSet]]></code>
231+
<code><![CDATA[valueUnset]]></code>
232+
</ImpureMethodCall>
233+
</file>
234+
<file src="src/Common/SearchAttributes/SearchAttributeKey/KeywordListValue.php">
235+
<MismatchingDocblockParamType>
236+
<code><![CDATA[iterable<string|\Stringable>]]></code>
237+
</MismatchingDocblockParamType>
238+
</file>
239+
<file src="src/Common/TypedSearchAttributes.php">
240+
<InvalidArgument>
241+
<code><![CDATA[$key]]></code>
242+
<code><![CDATA[$key]]></code>
243+
</InvalidArgument>
244+
<PossiblyInvalidClone>
245+
<code><![CDATA[clone $this->collection]]></code>
246+
</PossiblyInvalidClone>
247+
<PossiblyNullArrayAccess>
248+
<code><![CDATA[$this->collection[$found]]]></code>
249+
<code><![CDATA[$this->collection[$key]]]></code>
250+
</PossiblyNullArrayAccess>
251+
<PossiblyNullReference>
252+
<code><![CDATA[$this->collection]]></code>
253+
<code><![CDATA[$this->collection]]></code>
254+
</PossiblyNullReference>
255+
<UndefinedMethod>
256+
<code><![CDATA[valueSet]]></code>
257+
</UndefinedMethod>
258+
</file>
217259
<file src="src/Common/Uuid.php">
218260
<LessSpecificReturnStatement>
219261
<code><![CDATA[\vsprintf('%s-%s-%s-%s-%s', [
@@ -422,6 +464,8 @@
422464
</PossiblyNullArgument>
423465
<PossiblyNullReference>
424466
<code><![CDATA[getName]]></code>
467+
<code><![CDATA[getStartWorkflow]]></code>
468+
<code><![CDATA[getUpdateWorkflow]]></code>
425469
</PossiblyNullReference>
426470
<RedundantConditionGivenDocblockType>
427471
<code><![CDATA[$delay !== null]]></code>
@@ -715,11 +759,6 @@
715759
<MoreSpecificReturnType>
716760
<code><![CDATA[null|\Closure(Message): mixed]]></code>
717761
</MoreSpecificReturnType>
718-
<PossiblyFalseArgument>
719-
<code><![CDATA[$now->modify(
720-
\sprintf('+%d seconds +%d microseconds', $input->getSeconds(), $input->getNanos() / 1000),
721-
)]]></code>
722-
</PossiblyFalseArgument>
723762
</file>
724763
<file src="src/Internal/Marshaller/Type/ArrayType.php">
725764
<MoreSpecificImplementedParamType>
@@ -1017,6 +1056,11 @@
10171056
<code><![CDATA[UpsertSearchAttributes]]></code>
10181057
</MissingImmutableAnnotation>
10191058
</file>
1059+
<file src="src/Internal/Transport/Request/UpsertTypedSearchAttributes.php">
1060+
<MissingImmutableAnnotation>
1061+
<code><![CDATA[UpsertTypedSearchAttributes]]></code>
1062+
</MissingImmutableAnnotation>
1063+
</file>
10201064
<file src="src/Internal/Transport/Router/CancelWorkflow.php">
10211065
<DocblockTypeContradiction>
10221066
<code><![CDATA[$process === null]]></code>
@@ -1075,6 +1119,9 @@
10751119
</ArgumentTypeCoercion>
10761120
</file>
10771121
<file src="src/Internal/Transport/Router/StartWorkflow.php">
1122+
<PossiblyFalseArgument>
1123+
<code><![CDATA[\json_encode($param)]]></code>
1124+
</PossiblyFalseArgument>
10781125
<UnnecessaryVarAnnotation>
10791126
<code><![CDATA[Input]]></code>
10801127
</UnnecessaryVarAnnotation>
@@ -1194,6 +1241,9 @@
11941241
</PossiblyNullReference>
11951242
</file>
11961243
<file src="src/Internal/Workflow/ScopeContext.php">
1244+
<InaccessibleProperty>
1245+
<code><![CDATA[$this->input->info->typedSearchAttributes]]></code>
1246+
</InaccessibleProperty>
11971247
<MissingImmutableAnnotation>
11981248
<code><![CDATA[ScopeContext]]></code>
11991249
</MissingImmutableAnnotation>
@@ -1355,6 +1405,10 @@
13551405
</PossiblyNullReference>
13561406
</file>
13571407
<file src="src/Worker/Transport/Codec/ProtoCodec/Encoder.php">
1408+
<PossiblyFalseArgument>
1409+
<code><![CDATA[\json_encode($cmd->getOptions(), JSON_INVALID_UTF8_IGNORE | JSON_UNESCAPED_UNICODE)]]></code>
1410+
<code><![CDATA[\json_encode($options)]]></code>
1411+
</PossiblyFalseArgument>
13581412
<PossiblyNullArgument>
13591413
<code><![CDATA[$cmd->getFailure()]]></code>
13601414
</PossiblyNullArgument>

psalm.xml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,4 @@
2121
<directory name="vendor" />
2222
</ignoreFiles>
2323
</projectFiles>
24-
<issueHandlers>
25-
<UndefinedDocblockClass>
26-
<errorLevel type="suppress">
27-
<referencedClass name="UnitEnum" />
28-
</errorLevel>
29-
</UndefinedDocblockClass>
30-
<UndefinedClass>
31-
<errorLevel type="suppress">
32-
<referencedClass name="BackedEnum" />
33-
<referencedClass name="UnitEnum" />
34-
</errorLevel>
35-
</UndefinedClass>
36-
</issueHandlers>
3724
</psalm>

resources/scripts/generate-client.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -157,24 +157,10 @@
157157
$interface->addMethodFromGenerator($m);
158158

159159
echo "[OK]\n";
160-
161-
$docBlock = new Generator\DocBlockGenerator(
162-
join(
163-
"\n",
164-
[
165-
'This file is part of Temporal package.',
166-
'',
167-
'For the full copyright and license information, please view the LICENSE',
168-
'file that was distributed with this source code.'
169-
]
170-
)
171-
);
172-
173160
echo "writing interface: ";
174161

175162
$file = new Generator\FileGenerator();
176163
$file->setNamespace('Temporal\\Client\\GRPC');
177-
$file->setDocBlock($docBlock);
178164
$file->setClass($interface);
179165
$file->setUses(
180166
[
@@ -223,7 +209,6 @@
223209

224210
$file = new Generator\FileGenerator();
225211
$file->setNamespace('Temporal\\Client\\GRPC');
226-
$file->setDocBlock($docBlock);
227212
$file->setClass($impl);
228213
$file->setUses(
229214
[

src/Client/ClientOptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ClientOptions
4141
*/
4242
public function __construct()
4343
{
44-
$this->identity = \sprintf('%d@%s', \getmypid(), \gethostname());
44+
$this->identity = \sprintf('%d@%s', (string) \getmypid(), (string) \gethostname());
4545
}
4646

4747
/**

0 commit comments

Comments
 (0)