Skip to content

Commit cc18d66

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

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

Tests/InputBagTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class InputBagTest extends TestCase
2020
{
2121
public function testGet()
2222
{
23-
$bag = new InputBag(['foo' => 'bar', 'null' => null, 'int' => 1, 'float' => 1.0, 'bool' => false, 'stringable' => new class() implements \Stringable {
23+
$bag = new InputBag(['foo' => 'bar', 'null' => null, 'int' => 1, 'float' => 1.0, 'bool' => false, 'stringable' => new class implements \Stringable {
2424
public function __toString(): string
2525
{
2626
return 'strval';
@@ -58,7 +58,7 @@ public function testGetBooleanError()
5858

5959
public function testGetString()
6060
{
61-
$bag = new InputBag(['integer' => 123, 'bool_true' => true, 'bool_false' => false, 'string' => 'abc', 'stringable' => new class() implements \Stringable {
61+
$bag = new InputBag(['integer' => 123, 'bool_true' => true, 'bool_false' => false, 'string' => 'abc', 'stringable' => new class implements \Stringable {
6262
public function __toString(): string
6363
{
6464
return 'strval';

Tests/JsonResponseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public function testConstructorWithNullAsDataThrowsAnUnexpectedValueException()
171171

172172
public function testConstructorWithObjectWithToStringMethod()
173173
{
174-
$class = new class() {
174+
$class = new class {
175175
public function __toString(): string
176176
{
177177
return '{}';

Tests/ParameterBagTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public function testGetIntExceptionWithInvalid()
206206

207207
public function testGetString()
208208
{
209-
$bag = new ParameterBag(['integer' => 123, 'bool_true' => true, 'bool_false' => false, 'string' => 'abc', 'stringable' => new class() implements \Stringable {
209+
$bag = new ParameterBag(['integer' => 123, 'bool_true' => true, 'bool_false' => false, 'string' => 'abc', 'stringable' => new class implements \Stringable {
210210
public function __toString(): string
211211
{
212212
return 'strval';

Tests/RequestTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2213,7 +2213,7 @@ public function testFactory()
22132213

22142214
public function testFactoryCallable()
22152215
{
2216-
$requestFactory = new class() {
2216+
$requestFactory = new class {
22172217
public function createRequest(): Request
22182218
{
22192219
return new NewRequest();

Tests/Session/Storage/Proxy/AbstractProxyTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class AbstractProxyTest extends TestCase
2727

2828
protected function setUp(): void
2929
{
30-
$this->proxy = new class() extends AbstractProxy {};
30+
$this->proxy = new class extends AbstractProxy {};
3131
}
3232

3333
public function testGetSaveHandlerName()

Tests/StreamedJsonResponseTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,14 @@ public function testResponseOtherTraversable()
132132
{
133133
$arrayObject = new \ArrayObject(['__symfony_json__' => '__symfony_json__']);
134134

135-
$iteratorAggregate = new class() implements \IteratorAggregate {
135+
$iteratorAggregate = new class implements \IteratorAggregate {
136136
public function getIterator(): \Traversable
137137
{
138138
return new \ArrayIterator(['__symfony_json__']);
139139
}
140140
};
141141

142-
$jsonSerializable = new class() implements \IteratorAggregate, \JsonSerializable {
142+
$jsonSerializable = new class implements \IteratorAggregate, \JsonSerializable {
143143
public function getIterator(): \Traversable
144144
{
145145
return new \ArrayIterator(['This should be ignored']);
@@ -187,7 +187,7 @@ public function testResponseStatusCode()
187187

188188
public function testPlaceholderAsObjectStructure()
189189
{
190-
$object = new class() {
190+
$object = new class {
191191
public $__symfony_json__ = 'foo';
192192
public $bar = '__symfony_json__';
193193
};

0 commit comments

Comments
 (0)