Skip to content

Commit 5a43ea9

Browse files
keradusnicolas-grekas
authored andcommitted
chore: CS fixes
1 parent e940fa0 commit 5a43ea9

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

Chunk/ServerSentEvent.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,22 @@ public function __construct(string $content)
4545
$i += 1 + (' ' === ($line[1 + $i] ?? ''));
4646

4747
switch ($field) {
48-
case 'id': $this->id = substr($line, $i); break;
49-
case 'event': $this->type = substr($line, $i); break;
50-
case 'data': $this->data .= ('' === $this->data ? '' : "\n").substr($line, $i); break;
48+
case 'id':
49+
$this->id = substr($line, $i);
50+
break;
51+
case 'event':
52+
$this->type = substr($line, $i);
53+
break;
54+
case 'data':
55+
$this->data .= ('' === $this->data ? '' : "\n").substr($line, $i);
56+
break;
5157
case 'retry':
5258
$retry = substr($line, $i);
5359

5460
if ('' !== $retry && \strlen($retry) === strspn($retry, '0123456789')) {
5561
$this->retry = $retry / 1000.0;
5662
}
63+
5764
break;
5865
}
5966
}

Tests/MockHttpClientTest.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,11 +471,21 @@ protected function getHttpClient(string $testCase): HttpClientInterface
471471

472472
case 'testNonBlockingStream':
473473
case 'testSeekAsyncStream':
474-
$responses[] = new MockResponse((function () { yield '<1>'; yield ''; yield '<2>'; })(), ['response_headers' => $headers]);
474+
$responses[] = new MockResponse(
475+
(function () {
476+
yield '<1>';
477+
yield '';
478+
yield '<2>';
479+
})(),
480+
['response_headers' => $headers]
481+
);
475482
break;
476483

477484
case 'testMaxDuration':
478-
$responses[] = new MockResponse('', ['error' => 'Max duration was reached.']);
485+
$responses[] = new MockResponse(
486+
'',
487+
['error' => 'Max duration was reached.']
488+
);
479489
break;
480490
}
481491

0 commit comments

Comments
 (0)