Skip to content

Commit d896530

Browse files
Apply structural limit ECS formatting
1 parent 9772ff5 commit d896530

4 files changed

Lines changed: 49 additions & 16 deletions

File tree

src/V2/Support/WorkflowExecutor.php

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,10 @@ private function scheduleActivity(
13591359
$this->logApproachingLimit(
13601360
StructuralLimits::warnApproachingPayloadSize($serializedArguments),
13611361
$run,
1362-
['payload_site' => 'activity_input', 'activity_class' => $activityCall->activity],
1362+
[
1363+
'payload_site' => 'activity_input',
1364+
'activity_class' => $activityCall->activity,
1365+
],
13631366
);
13641367
StructuralLimits::guardPayloadSize($serializedArguments);
13651368

@@ -1570,7 +1573,10 @@ private function scheduleChildWorkflow(
15701573
$this->logApproachingLimit(
15711574
StructuralLimits::warnApproachingPayloadSize($serializedChildArguments),
15721575
$run,
1573-
['payload_site' => 'child_workflow_input', 'child_workflow_class' => $childWorkflowCall->workflow],
1576+
[
1577+
'payload_site' => 'child_workflow_input',
1578+
'child_workflow_class' => $childWorkflowCall->workflow,
1579+
],
15741580
);
15751581
StructuralLimits::guardPayloadSize($serializedChildArguments);
15761582

@@ -2257,7 +2263,10 @@ private function continueAsNew(
22572263
$this->logApproachingLimit(
22582264
StructuralLimits::warnApproachingPayloadSize($continueAsNewArguments),
22592265
$run,
2260-
['payload_site' => 'continue_as_new_input', 'target_workflow_class' => $workflowClass],
2266+
[
2267+
'payload_site' => 'continue_as_new_input',
2268+
'target_workflow_class' => $workflowClass,
2269+
],
22612270
);
22622271
StructuralLimits::guardPayloadSize($continueAsNewArguments);
22632272

@@ -2508,7 +2517,9 @@ private function completeRun(WorkflowRun $run, WorkflowTask $task, mixed $result
25082517
$this->logApproachingLimit(
25092518
StructuralLimits::warnApproachingPayloadSize($serializedOutput),
25102519
$run,
2511-
['payload_site' => 'workflow_output'],
2520+
[
2521+
'payload_site' => 'workflow_output',
2522+
],
25122523
);
25132524
StructuralLimits::guardPayloadSize($serializedOutput);
25142525

@@ -3769,7 +3780,9 @@ private function recordSearchAttributesUpserted(
37693780
$this->logApproachingLimit(
37703781
StructuralLimits::warnApproachingSearchAttributeSize($serializedSearchAttributes),
37713782
$run,
3772-
['payload_site' => 'search_attributes'],
3783+
[
3784+
'payload_site' => 'search_attributes',
3785+
],
37733786
);
37743787
StructuralLimits::guardSearchAttributeSize($serializedSearchAttributes);
37753788

@@ -3846,7 +3859,9 @@ private function recordMemoUpserted(
38463859
$this->logApproachingLimit(
38473860
StructuralLimits::warnApproachingMemoSize($serializedMemo),
38483861
$run,
3849-
['payload_site' => 'memo'],
3862+
[
3863+
'payload_site' => 'memo',
3864+
],
38503865
);
38513866
StructuralLimits::guardMemoSize($serializedMemo);
38523867

src/V2/WorkflowStub.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1873,7 +1873,9 @@ private function recordAcceptedUpdateWithArguments(string $method, array $argume
18731873
'structural_limit_exceeded',
18741874
$this->commandTargetScope(),
18751875
$this->payloadLimitExceededCommandPayloadAttributes($updateName, $updateCodec, $e),
1876-
['arguments' => [$e->getMessage()]],
1876+
[
1877+
'arguments' => [$e->getMessage()],
1878+
],
18771879
);
18781880

18791881
return;
@@ -2232,7 +2234,9 @@ private function attemptSignalInternal(
22322234
$this->commandTargetScope(),
22332235
$this->payloadLimitExceededCommandPayloadAttributes($name, $signalCodec, $e),
22342236
);
2235-
$this->recordRejectedSignal($command, $name, [], ['arguments' => [$e->getMessage()]]);
2237+
$this->recordRejectedSignal($command, $name, [], [
2238+
'arguments' => [$e->getMessage()],
2239+
]);
22362240

22372241
return;
22382242
}

tests/Feature/V2/V2StructuralLimitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
namespace Tests\Feature\V2;
66

77
use Illuminate\Support\Facades\Log;
8-
use Tests\Fixtures\V2\TestContinueAsNewLargePayloadWorkflow;
98
use Tests\Fixtures\V2\TestAwaitWithTimeoutWorkflow;
9+
use Tests\Fixtures\V2\TestContinueAsNewLargePayloadWorkflow;
1010
use Tests\Fixtures\V2\TestGreetingActivity;
1111
use Tests\Fixtures\V2\TestLargeMemoWorkflow;
1212
use Tests\Fixtures\V2\TestLargePayloadChildWorkflow;

tests/Unit/V2/StructuralLimitsTest.php

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -528,32 +528,46 @@ public function testWarnApproachingSearchAttributeSizeReturnsWarning(): void
528528

529529
public function testLogWarningIsNoOpWhenWarningIsNull(): void
530530
{
531-
$logger = new class extends AbstractLogger {
532-
/** @var list<array{level: string, message: string, context: array}> */
531+
$logger = new class() extends AbstractLogger {
532+
/**
533+
* @var list<array{level: string, message: string, context: array}>
534+
*/
533535
public array $records = [];
534536

535537
public function log($level, $message, array $context = []): void
536538
{
537-
$this->records[] = ['level' => (string) $level, 'message' => (string) $message, 'context' => $context];
539+
$this->records[] = [
540+
'level' => (string) $level,
541+
'message' => (string) $message,
542+
'context' => $context,
543+
];
538544
}
539545
};
540546

541547
Log::swap($logger);
542548

543-
StructuralLimits::logWarning(null, ['workflow_run_id' => 'run-1']);
549+
StructuralLimits::logWarning(null, [
550+
'workflow_run_id' => 'run-1',
551+
]);
544552

545553
$this->assertSame([], $logger->records);
546554
}
547555

548556
public function testLogWarningEmitsStructuredRecordWithContext(): void
549557
{
550-
$logger = new class extends AbstractLogger {
551-
/** @var list<array{level: string, message: string, context: array}> */
558+
$logger = new class() extends AbstractLogger {
559+
/**
560+
* @var list<array{level: string, message: string, context: array}>
561+
*/
552562
public array $records = [];
553563

554564
public function log($level, $message, array $context = []): void
555565
{
556-
$this->records[] = ['level' => (string) $level, 'message' => (string) $message, 'context' => $context];
566+
$this->records[] = [
567+
'level' => (string) $level,
568+
'message' => (string) $message,
569+
'context' => $context,
570+
];
557571
}
558572
};
559573

0 commit comments

Comments
 (0)