Skip to content

Commit 923f673

Browse files
committed
feat: add Nexus integration
1 parent 487887e commit 923f673

276 files changed

Lines changed: 21378 additions & 200 deletions

File tree

Some content is hidden

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

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"internal/destroy": "^1.0",
3131
"internal/promise": "^3.4",
3232
"nesbot/carbon": "^2.72.6 || ^3.8.4",
33+
"psr/clock": "^1.0",
3334
"psr/log": "^2.0 || ^3.0.2",
3435
"ramsey/uuid": "^4.7.6",
3536
"roadrunner-php/roadrunner-api-dto": "^1.14.0",

phpunit.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
</testsuite>
7676
<testsuite name="Unit">
7777
<directory suffix="TestCase.php">tests/Unit</directory>
78+
<directory suffix="Test.php">tests/Nexus/Unit</directory>
7879
</testsuite>
7980
<testsuite name="Functional">
8081
<directory suffix="TestCase.php">tests/Functional</directory>

psalm-baseline.xml

Lines changed: 57 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@
3131
</ArgumentTypeCoercion>
3232
</file>
3333
<file src="src/Client/Schedule/Action/StartWorkflowAction.php">
34-
<DocblockTypeContradiction>
35-
<code><![CDATA[parse]]></code>
36-
<code><![CDATA[parse]]></code>
37-
<code><![CDATA[parse]]></code>
38-
</DocblockTypeContradiction>
3934
<InaccessibleProperty>
4035
<code><![CDATA[$workflowType->name]]></code>
4136
</InaccessibleProperty>
@@ -99,9 +94,6 @@
9994
<code><![CDATA[$this->excludeCalendarList]]></code>
10095
<code><![CDATA[$this->excludeCalendarList]]></code>
10196
</DeprecatedProperty>
102-
<DocblockTypeContradiction>
103-
<code><![CDATA[parse]]></code>
104-
</DocblockTypeContradiction>
10597
</file>
10698
<file src="src/Client/ScheduleClient.php">
10799
<DeprecatedProperty>
@@ -258,11 +250,6 @@
258250
<code><![CDATA[getID]]></code>
259251
</PossiblyNullReference>
260252
</file>
261-
<file src="src/Exception/Client/ServiceClientException.php">
262-
<ImplementedReturnTypeMismatch>
263-
<code><![CDATA[RepeatedField]]></code>
264-
</ImplementedReturnTypeMismatch>
265-
</file>
266253
<file src="src/Exception/Client/WorkflowException.php">
267254
<UnsafeInstantiation>
268255
<code><![CDATA[new static(null, $execution, $workflowType, $previous)]]></code>
@@ -447,9 +434,6 @@
447434
</PropertyNotSetInConstructor>
448435
</file>
449436
<file src="src/Internal/Declaration/Graph/ClassNode.php">
450-
<ImplicitToStringCast>
451-
<code><![CDATA[list<array{class-string, \ReflectionMethod}>]]></code>
452-
</ImplicitToStringCast>
453437
<InvalidReturnType>
454438
<code><![CDATA[\Traversable<ClassNode>]]></code>
455439
</InvalidReturnType>
@@ -515,6 +499,12 @@
515499
</RedundantConditionGivenDocblockType>
516500
<UnnecessaryVarAnnotation>
517501
<code><![CDATA[\ReflectionMethod]]></code>
502+
<code><![CDATA[\Traversable<ClassNode, \ReflectionMethod>]]></code>
503+
</UnnecessaryVarAnnotation>
504+
</file>
505+
<file src="src/Internal/Declaration/Reader/NexusServiceReader.php">
506+
<UnnecessaryVarAnnotation>
507+
<code><![CDATA[\Traversable<ClassNode, \ReflectionMethod>]]></code>
518508
</UnnecessaryVarAnnotation>
519509
</file>
520510
<file src="src/Internal/Declaration/Reader/WorkflowReader.php">
@@ -533,7 +523,8 @@
533523
<code><![CDATA[$retry !== null]]></code>
534524
</RedundantConditionGivenDocblockType>
535525
<UnnecessaryVarAnnotation>
536-
<code><![CDATA[\Traversable<class-string, \ReflectionMethod>]]></code>
526+
<code><![CDATA[\Traversable<ClassNode, \ReflectionMethod>]]></code>
527+
<code><![CDATA[\Traversable<ClassNode, \ReflectionMethod>]]></code>
537528
</UnnecessaryVarAnnotation>
538529
</file>
539530
<file src="src/Internal/Declaration/WorkflowInstance/QueryDispatcher.php">
@@ -585,18 +576,6 @@
585576
<code><![CDATA[setDataConverter]]></code>
586577
</UndefinedInterfaceMethod>
587578
</file>
588-
<file src="src/Internal/Mapper/WorkflowExecutionConfigMapper.php">
589-
<DocblockTypeContradiction>
590-
<code><![CDATA[parse]]></code>
591-
<code><![CDATA[parse]]></code>
592-
<code><![CDATA[parse]]></code>
593-
<code><![CDATA[parse]]></code>
594-
<code><![CDATA[parse]]></code>
595-
</DocblockTypeContradiction>
596-
<RedundantConditionGivenDocblockType>
597-
<code><![CDATA[parse]]></code>
598-
</RedundantConditionGivenDocblockType>
599-
</file>
600579
<file src="src/Internal/Mapper/WorkflowExecutionInfoMapper.php">
601580
<ArgumentTypeCoercion>
602581
<code><![CDATA[$execution->getRunId()]]></code>
@@ -609,16 +588,6 @@
609588
<code><![CDATA[getBinaryChecksum]]></code>
610589
<code><![CDATA[getMostRecentWorkerVersionStamp]]></code>
611590
</DeprecatedMethod>
612-
<DocblockTypeContradiction>
613-
<code><![CDATA[parse]]></code>
614-
<code><![CDATA[parse]]></code>
615-
<code><![CDATA[parse]]></code>
616-
<code><![CDATA[parse]]></code>
617-
<code><![CDATA[parse]]></code>
618-
</DocblockTypeContradiction>
619-
<RedundantConditionGivenDocblockType>
620-
<code><![CDATA[parse]]></code>
621-
</RedundantConditionGivenDocblockType>
622591
</file>
623592
<file src="src/Internal/Marshaller/Mapper/AttributeMapper.php">
624593
<MissingClosureParamType>
@@ -817,17 +786,7 @@
817786
</DeprecatedConstant>
818787
<RedundantCondition>
819788
<code><![CDATA[$nullEmpty && $seconds === 0 && $micros === 0]]></code>
820-
<code><![CDATA[parse]]></code>
821789
</RedundantCondition>
822-
<TypeDoesNotContainNull>
823-
<code><![CDATA[parse]]></code>
824-
</TypeDoesNotContainNull>
825-
<TypeDoesNotContainType>
826-
<code><![CDATA[parse]]></code>
827-
<code><![CDATA[parse]]></code>
828-
<code><![CDATA[parse]]></code>
829-
<code><![CDATA[parse]]></code>
830-
</TypeDoesNotContainType>
831790
</file>
832791
<file src="src/Internal/Support/DateTime.php">
833792
<InvalidReturnStatement>
@@ -924,10 +883,6 @@
924883
</ArgumentTypeCoercion>
925884
</file>
926885
<file src="src/Internal/Transport/Router/StartWorkflow.php">
927-
<PossiblyFalseArgument>
928-
<code><![CDATA[\json_encode($param)]]></code>
929-
<code><![CDATA[\json_encode($param)]]></code>
930-
</PossiblyFalseArgument>
931886
<UnnecessaryVarAnnotation>
932887
<code><![CDATA[Input]]></code>
933888
</UnnecessaryVarAnnotation>
@@ -936,13 +891,6 @@
936891
<ArgumentTypeCoercion>
937892
<code><![CDATA[$e->getMessage()]]></code>
938893
</ArgumentTypeCoercion>
939-
<InvalidArgument>
940-
<code><![CDATA[$request]]></code>
941-
<code><![CDATA[$request]]></code>
942-
</InvalidArgument>
943-
<MismatchingDocblockParamType>
944-
<code><![CDATA[RequestInterface]]></code>
945-
</MismatchingDocblockParamType>
946894
</file>
947895
<file src="src/Internal/Workflow/ActivityProxy.php">
948896
<ArgumentTypeCoercion>
@@ -1003,6 +951,17 @@
1003951
<code><![CDATA[$header ?? Header::empty()]]></code>
1004952
</PropertyTypeCoercion>
1005953
</file>
954+
<file src="src/Internal/Workflow/NexusOperationStub.php">
955+
<ArgumentTypeCoercion>
956+
<code><![CDATA[$endpoint]]></code>
957+
<code><![CDATA[$service]]></code>
958+
</ArgumentTypeCoercion>
959+
</file>
960+
<file src="src/Internal/Workflow/NexusServiceProxy.php">
961+
<ArgumentTypeCoercion>
962+
<code><![CDATA[$input->operation]]></code>
963+
</ArgumentTypeCoercion>
964+
</file>
1006965
<file src="src/Internal/Workflow/Process/DeferredGenerator.php">
1007966
<UnevaluatedCode>
1008967
<code><![CDATA[yield;]]></code>
@@ -1060,6 +1019,7 @@
10601019
<ArgumentTypeCoercion>
10611020
<code><![CDATA[$input->maxSupported]]></code>
10621021
<code><![CDATA[$input->minSupported]]></code>
1022+
<code><![CDATA[$input->operation]]></code>
10631023
<code><![CDATA[$input->type]]></code>
10641024
<code><![CDATA[$type]]></code>
10651025
<code><![CDATA[$type]]></code>
@@ -1102,6 +1062,37 @@
11021062
<code><![CDATA[$clone->trace = &$this->trace]]></code>
11031063
</UnsupportedPropertyReferenceUsage>
11041064
</file>
1065+
<file src="src/Nexus/Attribute/AsyncOperation.php">
1066+
<DeprecatedClass>
1067+
<code><![CDATA[NamedArgumentConstructor]]></code>
1068+
</DeprecatedClass>
1069+
</file>
1070+
<file src="src/Nexus/Attribute/Operation.php">
1071+
<DeprecatedClass>
1072+
<code><![CDATA[NamedArgumentConstructor]]></code>
1073+
</DeprecatedClass>
1074+
</file>
1075+
<file src="src/Nexus/Attribute/Service.php">
1076+
<DeprecatedClass>
1077+
<code><![CDATA[NamedArgumentConstructor]]></code>
1078+
</DeprecatedClass>
1079+
</file>
1080+
<file src="src/Nexus/Handler/Internal/WorkflowRunStarter.php">
1081+
<DeprecatedConstant>
1082+
<code><![CDATA[Header::OPERATION_ID]]></code>
1083+
<code><![CDATA[Header::OPERATION_ID]]></code>
1084+
</DeprecatedConstant>
1085+
</file>
1086+
<file src="src/Nexus/Handler/LinkCollection.php">
1087+
<RedundantFunctionCall>
1088+
<code><![CDATA[\array_values]]></code>
1089+
</RedundantFunctionCall>
1090+
</file>
1091+
<file src="src/Nexus/WorkflowRunOperation.php">
1092+
<ArgumentTypeCoercion>
1093+
<code><![CDATA[$decoded->workflowId]]></code>
1094+
</ArgumentTypeCoercion>
1095+
</file>
11051096
<file src="src/Promise.php">
11061097
<InvalidArgument>
11071098
<code><![CDATA[$reasons]]></code>
@@ -1182,12 +1173,6 @@
11821173
</PossiblyNullArgument>
11831174
</file>
11841175
<file src="src/Worker/Transport/Codec/ProtoCodec.php">
1185-
<LessSpecificReturnStatement>
1186-
<code><![CDATA[$frame->serializeToString()]]></code>
1187-
</LessSpecificReturnStatement>
1188-
<MoreSpecificReturnType>
1189-
<code><![CDATA[string]]></code>
1190-
</MoreSpecificReturnType>
11911176
<PossiblyInvalidArgument>
11921177
<code><![CDATA[$e->getCode()]]></code>
11931178
<code><![CDATA[$e->getCode()]]></code>
@@ -1210,22 +1195,10 @@
12101195
</PossiblyNullReference>
12111196
</file>
12121197
<file src="src/Worker/Transport/Codec/ProtoCodec/Encoder.php">
1213-
<PossiblyFalseArgument>
1214-
<code><![CDATA[\json_encode($cmd->getOptions(), JSON_INVALID_UTF8_IGNORE | JSON_UNESCAPED_UNICODE)]]></code>
1215-
<code><![CDATA[\json_encode($options)]]></code>
1216-
</PossiblyFalseArgument>
12171198
<PossiblyNullArgument>
12181199
<code><![CDATA[$cmd->getFailure()]]></code>
12191200
</PossiblyNullArgument>
12201201
</file>
1221-
<file src="src/Worker/Transport/Command/Client/FailedClientResponse.php">
1222-
<InvalidNullableReturnType>
1223-
<code><![CDATA[\Throwable]]></code>
1224-
</InvalidNullableReturnType>
1225-
<NullableReturnStatement>
1226-
<code><![CDATA[$this->failure]]></code>
1227-
</NullableReturnStatement>
1228-
</file>
12291202
<file src="src/Worker/Transport/Command/Client/SuccessClientResponse.php">
12301203
<InvalidNullableReturnType>
12311204
<code><![CDATA[ValuesInterface]]></code>
@@ -1360,6 +1333,12 @@
13601333
<code><![CDATA[getUpdateContext]]></code>
13611334
</UndefinedInterfaceMethod>
13621335
</file>
1336+
<file src="src/Workflow/NexusOperationOptions.php">
1337+
<ImpureMethodCall>
1338+
<code><![CDATA[assert]]></code>
1339+
<code><![CDATA[parse]]></code>
1340+
</ImpureMethodCall>
1341+
</file>
13631342
<file src="src/Workflow/QueryMethod.php">
13641343
<DeprecatedClass>
13651344
<code><![CDATA[NamedArgumentConstructor]]></code>
@@ -1492,19 +1471,6 @@
14921471
<code><![CDATA[$message->getHeader()]]></code>
14931472
<code><![CDATA[$message->getPayloads()]]></code>
14941473
</PossiblyNullArgument>
1495-
<TooManyTemplateParams>
1496-
<code><![CDATA[$fields]]></code>
1497-
<code><![CDATA[$meta]]></code>
1498-
</TooManyTemplateParams>
1499-
</file>
1500-
<file src="testing/src/Transcript/WorkflowHistoryDumper.php">
1501-
<InvalidOperand>
1502-
<code><![CDATA[$eventTime->getSeconds() + \round($eventTime->getNanos() / 1_000_000_000, 6)]]></code>
1503-
<code><![CDATA[($sec - $startSec) * 1000]]></code>
1504-
</InvalidOperand>
1505-
<PossiblyInvalidOperand>
1506-
<code><![CDATA[$eventTime->getSeconds()]]></code>
1507-
</PossiblyInvalidOperand>
15081474
</file>
15091475
<file src="testing/src/WorkerMock.php">
15101476
<DeprecatedMethod>

psalm.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
<directory name="vendor" />
2323
</ignoreFiles>
2424
</projectFiles>
25+
<stubs>
26+
<file name="stubs/GoogleProtobufRepeatedField.phpstub" />
27+
<file name="stubs/GoogleProtobufMapField.phpstub" />
28+
<file name="stubs/CarbonInterval.phpstub" />
29+
</stubs>
2530
<issueHandlers>
2631
<MissingOverrideAttribute errorLevel="suppress" />
2732
<ClassMustBeFinal errorLevel="suppress" />

0 commit comments

Comments
 (0)