Skip to content

Commit f53f162

Browse files
authored
Code Style improvements (#92)
* Apply phpcs * Simplify code (extra new lines and else statements) * Remove unused methods * Fix docblocks * Fix inheritance instantiation bug * Fix type cast bug * Fix incompatible types * Remove unused env trait * Improve type hint * Fix docblocks and service client codestyle * Fix bad docblock signatures
1 parent 45d4a8b commit f53f162

37 files changed

+458
-354
lines changed

src/Client/ActivityCompletionClientInterface.php

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,13 @@ interface ActivityCompletionClientInterface
2525
* @param string $activityId
2626
* @param mixed $result
2727
*/
28-
public function complete(
29-
string $workflowId,
30-
?string $runId,
31-
string $activityId,
32-
$result = null
33-
): void;
28+
public function complete(string $workflowId, ?string $runId, string $activityId, $result = null): void;
3429

3530
/**
3631
* @param string $taskToken
3732
* @param mixed $result
3833
*/
39-
public function completeByToken(
40-
string $taskToken,
41-
$result = null
42-
): void;
34+
public function completeByToken(string $taskToken, $result = null): void;
4335

4436
/**
4537
* @param string $workflowId
@@ -58,10 +50,7 @@ public function completeExceptionally(
5850
* @param string $taskToken
5951
* @param \Throwable $error
6052
*/
61-
public function completeExceptionallyByToken(
62-
string $taskToken,
63-
\Throwable $error
64-
): void;
53+
public function completeExceptionallyByToken(string $taskToken, \Throwable $error): void;
6554

6655
/**
6756
* @param string $workflowId
@@ -80,10 +69,7 @@ public function reportCancellation(
8069
* @param string $taskToken
8170
* @param $details
8271
*/
83-
public function reportCancellationByToken(
84-
string $taskToken,
85-
$details = null
86-
): void;
72+
public function reportCancellationByToken(string $taskToken, $details = null): void;
8773

8874
/**
8975
* @param string $workflowId
@@ -106,8 +92,5 @@ public function recordHeartbeat(
10692
*
10793
* @throw ActivityCanceledException
10894
*/
109-
public function recordHeartbeatByToken(
110-
string $taskToken,
111-
$details = null
112-
);
95+
public function recordHeartbeatByToken(string $taskToken, $details = null);
11396
}

src/Client/GRPC/BaseClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ protected function invoke(string $method, object $arg, ContextInterface $ctx = n
143143
}
144144

145145
// wait till next call
146-
usleep($waitRetry->totalMicroseconds);
146+
\usleep((int)$waitRetry->totalMicroseconds);
147147

148148
$waitRetry = CarbonInterval::millisecond(
149149
$waitRetry->totalMilliseconds + $retryOption->backoffCoefficient

0 commit comments

Comments
 (0)