Skip to content

Commit f2d8c0f

Browse files
bonroyagederrabus
authored andcommitted
Code style change in @PER-CS2.0 affecting @Symfony (parentheses for anonymous classes)
1 parent c6a6b73 commit f2d8c0f

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

EventSourceHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function connect(string $url, array $options = [], string $method = 'GET'
5252

5353
public function request(string $method, string $url, array $options = []): ResponseInterface
5454
{
55-
$state = new class() {
55+
$state = new class {
5656
public ?string $buffer = null;
5757
public ?string $lastEventId = null;
5858
public float $reconnectionTime;

Internal/AmpClientState.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ private function getClient(array $options): array
141141
$options['capture_peer_cert_chain'] && $context = $context->withPeerCapturing();
142142
$options['crypto_method'] && $context = $context->withMinimumVersion($options['crypto_method']);
143143

144-
$connector = $handleConnector = new class() implements Connector {
144+
$connector = $handleConnector = new class implements Connector {
145145
public DnsConnector $connector;
146146
public string $uri;
147147
/** @var resource|null */

Response/AmpResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ private static function followRedirects(Request $originRequest, AmpClientState $
292292
return $response;
293293
}
294294

295-
$urlResolver = new class() {
295+
$urlResolver = new class {
296296
use HttpClientTrait {
297297
parseUrl as public;
298298
resolveUrl as public;

Tests/DataCollector/HttpClientDataCollectorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public static function provideCurlRequests(): iterable
273273
'fooprop' => 'foopropval',
274274
'barprop' => 'barpropval',
275275
],
276-
'tostring' => new class() {
276+
'tostring' => new class {
277277
public function __toString(): string
278278
{
279279
return 'tostringval';

Tests/MockHttpClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ public function testStringableBodyParam()
518518
{
519519
$client = new MockHttpClient();
520520

521-
$param = new class() {
521+
$param = new class {
522522
public function __toString(): string
523523
{
524524
return 'bar';

Tests/RetryableHttpClientTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public function testRetryWithDelay()
215215
]),
216216
new GenericRetryStrategy(),
217217
1,
218-
$logger = new class() extends TestLogger {
218+
$logger = new class extends TestLogger {
219219
public array $context = [];
220220

221221
public function log($level, $message, array $context = []): void
@@ -259,7 +259,7 @@ public function testRetryOnTimeout()
259259

260260
TestHttpServer::start();
261261

262-
$strategy = new class() implements RetryStrategyInterface {
262+
$strategy = new class implements RetryStrategyInterface {
263263
public $isCalled = false;
264264

265265
public function shouldRetry(AsyncContext $context, ?string $responseContent, ?TransportExceptionInterface $exception): ?bool

0 commit comments

Comments
 (0)