Skip to content

Commit 866f1f0

Browse files
committed
Updated to new CS rules
1 parent cda0f7e commit 866f1f0

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/Middleware.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function pre(
3737
string $transactionId,
3838
array $options = []
3939
): CancellablePromiseInterface {
40-
$this->times[$transactionId] = microtime(true);
40+
$this->times[$transactionId] = \microtime(true);
4141

4242
return resolve($request);
4343
}
@@ -57,7 +57,7 @@ public function post(
5757
string $transactionId,
5858
array $options = []
5959
): CancellablePromiseInterface {
60-
$time = microtime(true) - $this->times[$transactionId];
60+
$time = \microtime(true) - $this->times[$transactionId];
6161
unset($this->times[$transactionId]);
6262

6363
return resolve($response->withAddedHeader(self::HEADER, (string)$time));

tests/MiddlewareTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@
99
use RingCentral\Psr7\Response;
1010
use function Clue\React\Block\await;
1111

12+
/**
13+
* @internal
14+
*/
1215
final class MiddlewareTest extends TestCase
1316
{
14-
public function testPost()
17+
public function testPost(): void
1518
{
1619
$idA = 'Abc';
1720
$idB = 'aBc';
@@ -21,7 +24,7 @@ public function testPost()
2124
$middleware->pre(new Request('GET', 'https://example.com/'), $idB, []);
2225
$responseObject = await($middleware->post($response, $idA, []), Factory::create());
2326
self::assertTrue((float)$responseObject->getHeaderLine(Middleware::HEADER) < 1);
24-
sleep(1);
27+
\sleep(1);
2528
$responseObject = await($middleware->post($response, $idB, []), Factory::create());
2629
self::assertTrue((float)$responseObject->getHeaderLine(Middleware::HEADER) > 1);
2730
}

0 commit comments

Comments
 (0)