Skip to content

Commit cee4dae

Browse files
Anonymous class CS fixes
1 parent eaca1cb commit cee4dae

17 files changed

+90
-47
lines changed

src/Illuminate/Foundation/Testing/Concerns/InteractsWithExceptionHandling.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ protected function withoutExceptionHandling(array $except = [])
6464
$this->originalExceptionHandler = app(ExceptionHandler::class);
6565
}
6666

67-
$this->app->instance(ExceptionHandler::class, new class($this->originalExceptionHandler, $except) implements ExceptionHandler {
67+
$this->app->instance(ExceptionHandler::class, new class($this->originalExceptionHandler, $except) implements ExceptionHandler
68+
{
6869
protected $except;
6970
protected $originalHandler;
7071

src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ public function withoutMiddleware($middleware = null)
121121
}
122122

123123
foreach ((array) $middleware as $abstract) {
124-
$this->app->instance($abstract, new class {
124+
$this->app->instance($abstract, new class
125+
{
125126
public function handle($request, $next)
126127
{
127128
return $next($request);

tests/Auth/AuthenticatableTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ public function testItReturnsStringAsRememberTokenWhenItWasSetToTrue()
2323

2424
public function testItReturnsNullWhenRememberTokenNameWasSetToEmpty()
2525
{
26-
$user = new class extends User {
26+
$user = new class extends User
27+
{
2728
public function getRememberTokenName()
2829
{
2930
return '';

tests/Console/CommandTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ public function testCallingClassCommandResolveCommandViaApplicationResolution()
4848

4949
public function testGettingCommandArgumentsAndOptionsByClass()
5050
{
51-
$command = new class extends Command {
51+
$command = new class extends Command
52+
{
5253
public function handle()
5354
{
5455
}

tests/Database/DatabaseEloquentCollectionTest.php

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -454,17 +454,22 @@ public function testQueueableCollectionImplementationThrowsExceptionOnMultipleMo
454454
public function testQueueableRelationshipsReturnsOnlyRelationsCommonToAllModels()
455455
{
456456
// This is needed to prevent loading non-existing relationships on polymorphic model collections (#26126)
457-
$c = new Collection([new class {
458-
public function getQueueableRelations()
457+
$c = new Collection([
458+
new class
459459
{
460-
return ['user'];
461-
}
462-
}, new class {
463-
public function getQueueableRelations()
460+
public function getQueueableRelations()
461+
{
462+
return ['user'];
463+
}
464+
},
465+
new class
464466
{
465-
return ['user', 'comments'];
466-
}
467-
}]);
467+
public function getQueueableRelations()
468+
{
469+
return ['user', 'comments'];
470+
}
471+
},
472+
]);
468473

469474
$this->assertEquals(['user'], $c->getQueueableRelations());
470475
}

tests/Database/DatabaseSoftDeletingTest.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ public function testDeletedAtIsAddedToDateCasts()
1818

1919
public function testDeletedAtIsUniqueWhenAlreadyExists()
2020
{
21-
$model = new class extends SoftDeletingModel {
21+
$model = new class extends SoftDeletingModel
22+
{
2223
protected $dates = ['deleted_at'];
2324
};
2425
$entries = array_filter($model->getDates(), function ($attribute) {
@@ -40,7 +41,8 @@ public function testDeletedAtIsCastToCarbonInstance()
4041

4142
public function testExistingCastOverridesAddedDateCast()
4243
{
43-
$model = new class(['deleted_at' => '2018-12-29 13:59:39']) extends SoftDeletingModel {
44+
$model = new class(['deleted_at' => '2018-12-29 13:59:39']) extends SoftDeletingModel
45+
{
4446
protected $casts = ['deleted_at' => 'bool'];
4547
};
4648

@@ -49,7 +51,8 @@ public function testExistingCastOverridesAddedDateCast()
4951

5052
public function testExistingMutatorOverridesAddedDateCast()
5153
{
52-
$model = new class(['deleted_at' => '2018-12-29 13:59:39']) extends SoftDeletingModel {
54+
$model = new class(['deleted_at' => '2018-12-29 13:59:39']) extends SoftDeletingModel
55+
{
5356
protected function getDeletedAtAttribute()
5457
{
5558
return 'expected';
@@ -61,7 +64,8 @@ protected function getDeletedAtAttribute()
6164

6265
public function testCastingToStringOverridesAutomaticDateCastingToRetainPreviousBehaviour()
6366
{
64-
$model = new class(['deleted_at' => '2018-12-29 13:59:39']) extends SoftDeletingModel {
67+
$model = new class(['deleted_at' => '2018-12-29 13:59:39']) extends SoftDeletingModel
68+
{
6569
protected $casts = ['deleted_at' => 'string'];
6670
};
6771

tests/Foundation/FoundationApplicationTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public function testServiceProvidersAreCorrectlyRegistered()
4545
public function testClassesAreBoundWhenServiceProviderIsRegistered()
4646
{
4747
$app = new Application;
48-
$app->register($provider = new class($app) extends ServiceProvider {
48+
$app->register($provider = new class($app) extends ServiceProvider
49+
{
4950
public $bindings = [
5051
AbstractClass::class => ConcreteClass::class,
5152
];
@@ -62,7 +63,8 @@ public function testClassesAreBoundWhenServiceProviderIsRegistered()
6263
public function testSingletonsAreCreatedWhenServiceProviderIsRegistered()
6364
{
6465
$app = new Application;
65-
$app->register($provider = new class($app) extends ServiceProvider {
66+
$app->register($provider = new class($app) extends ServiceProvider
67+
{
6668
public $singletons = [
6769
AbstractClass::class => ConcreteClass::class,
6870
];

tests/Foundation/FoundationTestResponseTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ public function testAssertViewHas()
3939

4040
public function testAssertViewHasModel()
4141
{
42-
$model = new class extends Model {
42+
$model = new class extends Model
43+
{
4344
public function is($model)
4445
{
4546
return $this == $model;

tests/Foundation/Http/Middleware/CheckForMaintenanceModeTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ public function testApplicationAllowsSomeURIs()
105105
{
106106
$app = $this->createMaintenanceApplication();
107107

108-
$middleware = new class($app) extends CheckForMaintenanceMode {
108+
$middleware = new class($app) extends CheckForMaintenanceMode
109+
{
109110
public function __construct($app)
110111
{
111112
parent::__construct($app);

tests/Integration/Foundation/FoundationHelpersTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ public function testRescue()
2929
return 'no need to rescue';
3030
}, 'rescued!'), 'no need to rescue');
3131

32-
$testClass = new class {
32+
$testClass = new class
33+
{
3334
public function test(int $a)
3435
{
3536
return $a;

0 commit comments

Comments
 (0)