8000 Code style change in `@PER-CS2.0` affecting `@Symfony` (parentheses f… · symfony/error-handler@0ee7b0f · GitHub
[go: up one dir, main page]

Skip to content

Commit 0ee7b0f

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

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

ErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public function __construct(
194194
$traceReflector->setValue($e, $trace);
195195
$e->file = $file ?? $e->file;
196196
$e->line = $line ?? $e->line;
197-
}, null, new class() extends \Exception {
197+
}, null, new class extends \Exception {
198198
});
199199
}
200200

ErrorRenderer/CliErrorRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class CliErrorRenderer implements ErrorRendererInterface
2626
public function render(\Throwable $exception): FlattenException
2727
{
2828
$cloner = new VarCloner();
29-
$dumper = new class() extends CliDumper {
29+
$dumper = new class extends CliDumper {
3030
protected function supportsColors(): bool
3131
{
3232
$outputStream = $this->outputStream;

Tests/ErrorHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ public function testHandleError()
333333

334334
public function testHandleErrorWithAnonymousClass()
335335
{
336-
$anonymousObject = new class() extends \stdClass {
336+
$anonymousObject = new class extends \stdClass {
337337
};
338338

339339
$handler = ErrorHandler::register();
@@ -422,7 +422,7 @@ public static function handleExceptionProvider(): array
422422
['Uncaught Exception: foo', new \Exception('foo')],
423423
['Uncaught Exception: foo', new class('foo') extends \RuntimeException {
424424
}],
425-
['Uncaught Exception: foo stdClass@anonymous bar', new \RuntimeException('foo '.(new class() extends \stdClass {
425+
['Uncaught Exception: foo stdClass@anonymous bar', new \RuntimeException('foo '.(new class extends \stdClass {
426426
})::class.' bar')],
427427
['Uncaught Error: bar', new \Error('bar')],
428428
['Uncaught ccc', new \ErrorException('ccc')],

Tests/Exception/FlattenExceptionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ public static function stringAndIntDataProvider(): array
245245

246246
public function testAnonymousClass()
247247
{
248-
$flattened = FlattenException::createFromThrowable(new class() extends \RuntimeException {
248+
$flattened = FlattenException::createFromThrowable(new class extends \RuntimeException {
249249
});
250250

251251
$this->assertSame('RuntimeException@anonymous', $flattened->getClass());
@@ -255,7 +255,7 @@ public function testAnonymousClass()
255255

256256
$this->assertSame('Symfony\Component\HttpKernel\Exception\NotFoundHttpException@anonymous', $flattened->getClass());
257257

258-
$flattened = FlattenException::createFromThrowable(new \Exception(\sprintf('Class "%s" blah.', (new class() extends \RuntimeException {
258+
$flattened = FlattenException::createFromThrowable(new \Exception(\sprintf('Class "%s" blah.', (new class extends \RuntimeException {
259259
})::class)));
260260

261261
$this->assertSame('Class "RuntimeException@anonymous" blah.', $flattened->getMessage());

0 commit comments

Comments
 (0)
0