Skip to content

Commit 8f3f0fd

Browse files
committed
Apply fixes from StyleCI
1 parent 5b661de commit 8f3f0fd

13 files changed

+19
-38
lines changed

src/Illuminate/Validation/InvokableValidationRule.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ 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
73-
{
72+
return new class($invokable) extends InvokableValidationRule implements ImplicitRule {
7473
};
7574
}
7675

tests/Bus/BusPendingBatchTest.php

+3-6
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ public function test_batch_is_deleted_from_storage_if_exception_thrown_during_ba
7171

7272
$container = new Container;
7373

74-
$job = new class
75-
{
74+
$job = new class {
7675
};
7776

7877
$pendingBatch = new PendingBatch($container, new Collection([$job]));
@@ -227,8 +226,7 @@ public function test_batch_before_event_is_called()
227226

228227
public function test_it_throws_exception_if_batched_job_is_not_batchable(): void
229228
{
230-
$nonBatchableJob = new class
231-
{
229+
$nonBatchableJob = new class {
232230
};
233231

234232
$this->expectException(RuntimeException::class);
@@ -244,8 +242,7 @@ public function test_it_throws_an_exception_if_batched_job_contains_batch_with_n
244242
new PendingBatch(
245243
$container,
246244
new Collection(
247-
[new PendingBatch($container, new Collection([new BatchableJob, new class
248-
{
245+
[new PendingBatch($container, new Collection([new BatchableJob, new class {
249246
}]))]
250247
)
251248
);

tests/Database/DatabaseAbstractSchemaGrammarTest.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ protected function tearDown(): void
1717
public function testCreateDatabase()
1818
{
1919
$connection = m::mock(Connection::class);
20-
$grammar = new class($connection) extends Grammar
21-
{
20+
$grammar = new class($connection) extends Grammar {
2221
};
2322

2423
$this->assertSame('create database "foo"', $grammar->compileCreateDatabase('foo'));
@@ -27,8 +26,7 @@ public function testCreateDatabase()
2726
public function testDropDatabaseIfExists()
2827
{
2928
$connection = m::mock(Connection::class);
30-
$grammar = new class($connection) extends Grammar
31-
{
29+
$grammar = new class($connection) extends Grammar {
3230
};
3331

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

tests/Database/DatabaseEloquentInverseRelationTest.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,7 @@ public function testOnlyHydratesInverseRelationOnModels()
288288
[],
289289
new HasInverseRelationRelatedStub(),
290290
'foo',
291-
new class()
292-
{
291+
new class() {
293292
},
294293
new HasInverseRelationRelatedStub(),
295294
]);

tests/Encryption/EncrypterTest.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,10 @@ public static function provideTamperedData()
248248

249249
return [
250250
[['iv' => ['value_in_array'], 'value' => '', 'mac' => '']],
251-
[['iv' => new class()
252-
{
251+
[['iv' => new class() {
253252
}, 'value' => '', 'mac' => '']],
254253
[['iv' => $validIv, 'value' => ['value_in_array'], 'mac' => '']],
255-
[['iv' => $validIv, 'value' => new class()
256-
{
254+
[['iv' => $validIv, 'value' => new class() {
257255
}, 'mac' => '']],
258256
[['iv' => $validIv, 'value' => '', 'mac' => ['value_in_array']]],
259257
[['iv' => $validIv, 'value' => '', 'mac' => null]],

tests/Http/JsonResourceTest.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ class JsonResourceTest extends TestCase
1212
{
1313
public function testJsonResourceNullAttributes()
1414
{
15-
$model = new class extends Model
16-
{
15+
$model = new class extends Model {
1716
};
1817

1918
$model->setAttribute('relation_sum_column', null);
@@ -33,8 +32,7 @@ public function testJsonResourceNullAttributes()
3332

3433
public function testJsonResourceToJsonSucceedsWithPriorErrors(): void
3534
{
36-
$model = new class extends Model
37-
{
35+
$model = new class extends Model {
3836
};
3937

4038
$resource = m::mock(JsonResource::class, ['resource' => $model])

tests/Pagination/CursorPaginatorLoadMorphCountTest.php

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

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

2625
$this->assertSame($p, $p->loadMorphCount('parentable', $relations));

tests/Pagination/CursorPaginatorLoadMorphTest.php

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

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

2625
$this->assertSame($p, $p->loadMorph('parentable', $relations));

tests/Pagination/PaginatorLoadMorphCountTest.php

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

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

2625
$this->assertSame($p, $p->loadMorphCount('parentable', $relations));

tests/Pagination/PaginatorLoadMorphTest.php

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

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

2625
$this->assertSame($p, $p->loadMorph('parentable', $relations));

tests/Support/SupportCollectionTest.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -2371,12 +2371,10 @@ public function testImplode($collection)
23712371
#[DataProvider('collectionClassProvider')]
23722372
public function testImplodeModels($collection)
23732373
{
2374-
$model = new class extends Model
2375-
{
2374+
$model = new class extends Model {
23762375
};
23772376
$model->setAttribute('email', 'foo');
2378-
$modelTwo = new class extends Model
2379-
{
2377+
$modelTwo = new class extends Model {
23802378
};
23812379
$modelTwo->setAttribute('email', 'bar');
23822380
$data = new $collection([$model, $modelTwo]);

tests/Validation/ValidationValidatorTest.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -925,8 +925,7 @@ public function testCustomException()
925925

926926
$v = new Validator($trans, ['name' => ''], ['name' => 'required']);
927927

928-
$exception = new class($v) extends ValidationException
929-
{
928+
$exception = new class($v) extends ValidationException {
930929
};
931930
$v->setException($exception);
932931

tests/View/Blade/BladeComponentTagCompilerTest.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -796,8 +796,7 @@ public function __toString()
796796
}
797797
};
798798

799-
$model = new class extends Model
800-
{
799+
$model = new class extends Model {
801800
};
802801

803802
$this->assertEquals(e('<hi>'), BladeCompiler::sanitizeComponentAttribute('<hi>'));

0 commit comments

Comments
 (0)