Skip to content

Commit 9a5b570

Browse files
authored
apply final Pint fixes (#55014)
these changes apply the final Pint changes to make it pass. the majority of them are "braces_position" rule changes.
1 parent 76a20d3 commit 9a5b570

13 files changed

+56
-19
lines changed

src/Illuminate/Validation/InvokableValidationRule.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ protected function __construct(ValidationRule|InvokableRule $invokable)
6969
public static function make($invokable)
7070
{
7171
if ($invokable->implicit ?? false) {
72-
return new class($invokable) extends InvokableValidationRule implements ImplicitRule {
72+
return new class($invokable) extends InvokableValidationRule implements ImplicitRule
73+
{
7374
};
7475
}
7576

tests/Bus/BusPendingBatchTest.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ public function test_batch_is_deleted_from_storage_if_exception_thrown_during_ba
7171

7272
$container = new Container;
7373

74-
$job = new class {};
74+
$job = new class
75+
{
76+
};
7577

7678
$pendingBatch = new PendingBatch($container, new Collection([$job]));
7779

@@ -225,7 +227,9 @@ public function test_batch_before_event_is_called()
225227

226228
public function test_it_throws_exception_if_batched_job_is_not_batchable(): void
227229
{
228-
$nonBatchableJob = new class {};
230+
$nonBatchableJob = new class
231+
{
232+
};
229233

230234
$this->expectException(RuntimeException::class);
231235

@@ -240,7 +244,9 @@ public function test_it_throws_an_exception_if_batched_job_contains_batch_with_n
240244
new PendingBatch(
241245
$container,
242246
new Collection(
243-
[new PendingBatch($container, new Collection([new BatchableJob, new class {}]))]
247+
[new PendingBatch($container, new Collection([new BatchableJob, new class
248+
{
249+
}]))]
244250
)
245251
);
246252
}

tests/Database/DatabaseAbstractSchemaGrammarTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,19 @@ protected function tearDown(): void
1717
public function testCreateDatabase()
1818
{
1919
$connection = m::mock(Connection::class);
20-
$grammar = new class($connection) extends Grammar {};
20+
$grammar = new class($connection) extends Grammar
21+
{
22+
};
2123

2224
$this->assertSame('create database "foo"', $grammar->compileCreateDatabase('foo'));
2325
}
2426

2527
public function testDropDatabaseIfExists()
2628
{
2729
$connection = m::mock(Connection::class);
28-
$grammar = new class($connection) extends Grammar {};
30+
$grammar = new class($connection) extends Grammar
31+
{
32+
};
2933

3034
$this->assertSame('drop database if exists "foo"', $grammar->compileDropDatabaseIfExists('foo'));
3135
}

tests/Database/DatabaseEloquentInverseRelationTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ public function testOnlyHydratesInverseRelationOnModels()
288288
[],
289289
new HasInverseRelationRelatedStub(),
290290
'foo',
291-
new class() {},
291+
new class()
292+
{
293+
},
292294
new HasInverseRelationRelatedStub(),
293295
]);
294296
}

tests/Encryption/EncrypterTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,13 @@ public static function provideTamperedData()
248248

249249
return [
250250
[['iv' => ['value_in_array'], 'value' => '', 'mac' => '']],
251-
[['iv' => new class() {}, 'value' => '', 'mac' => '']],
251+
[['iv' => new class()
252+
{
253+
}, 'value' => '', 'mac' => '']],
252254
[['iv' => $validIv, 'value' => ['value_in_array'], 'mac' => '']],
253-
[['iv' => $validIv, 'value' => new class() {}, 'mac' => '']],
255+
[['iv' => $validIv, 'value' => new class()
256+
{
257+
}, 'mac' => '']],
254258
[['iv' => $validIv, 'value' => '', 'mac' => ['value_in_array']]],
255259
[['iv' => $validIv, 'value' => '', 'mac' => null]],
256260
[['iv' => $validIv, 'value' => '', 'mac' => '', 'tag' => ['value_in_array']]],

tests/Http/JsonResourceTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ class JsonResourceTest extends TestCase
1212
{
1313
public function testJsonResourceNullAttributes()
1414
{
15-
$model = new class extends Model {};
15+
$model = new class extends Model
16+
{
17+
};
1618

1719
$model->setAttribute('relation_sum_column', null);
1820
$model->setAttribute('relation_count', null);
@@ -31,7 +33,9 @@ public function testJsonResourceNullAttributes()
3133

3234
public function testJsonResourceToJsonSucceedsWithPriorErrors(): void
3335
{
34-
$model = new class extends Model {};
36+
$model = new class extends Model
37+
{
38+
};
3539

3640
$resource = m::mock(JsonResource::class, ['resource' => $model])
3741
->makePartial()

tests/Pagination/CursorPaginatorLoadMorphCountTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ public function testCollectionLoadMorphCountCanChainOnThePaginator()
1919
$items = m::mock(Collection::class);
2020
$items->shouldReceive('loadMorphCount')->once()->with('parentable', $relations);
2121

22-
$p = (new class extends AbstractCursorPaginator {})->setCollection($items);
22+
$p = (new class extends AbstractCursorPaginator
23+
{
24+
})->setCollection($items);
2325

2426
$this->assertSame($p, $p->loadMorphCount('parentable', $relations));
2527
}

tests/Pagination/CursorPaginatorLoadMorphTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ public function testCollectionLoadMorphCanChainOnThePaginator()
1919
$items = m::mock(Collection::class);
2020
$items->shouldReceive('loadMorph')->once()->with('parentable', $relations);
2121

22-
$p = (new class extends AbstractCursorPaginator {})->setCollection($items);
22+
$p = (new class extends AbstractCursorPaginator
23+
{
24+
})->setCollection($items);
2325

2426
$this->assertSame($p, $p->loadMorph('parentable', $relations));
2527
}

tests/Pagination/PaginatorLoadMorphCountTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ public function testCollectionLoadMorphCountCanChainOnThePaginator()
1919
$items = m::mock(Collection::class);
2020
$items->shouldReceive('loadMorphCount')->once()->with('parentable', $relations);
2121

22-
$p = (new class extends AbstractPaginator {})->setCollection($items);
22+
$p = (new class extends AbstractPaginator
23+
{
24+
})->setCollection($items);
2325

2426
$this->assertSame($p, $p->loadMorphCount('parentable', $relations));
2527
}

tests/Pagination/PaginatorLoadMorphTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ public function testCollectionLoadMorphCanChainOnThePaginator()
1919
$items = m::mock(Collection::class);
2020
$items->shouldReceive('loadMorph')->once()->with('parentable', $relations);
2121

22-
$p = (new class extends AbstractPaginator {})->setCollection($items);
22+
$p = (new class extends AbstractPaginator
23+
{
24+
})->setCollection($items);
2325

2426
$this->assertSame($p, $p->loadMorph('parentable', $relations));
2527
}

0 commit comments

Comments
 (0)