Skip to content

[12.x] apply final Pint fixes #55014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Illuminate/Validation/InvokableValidationRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ protected function __construct(ValidationRule|InvokableRule $invokable)
public static function make($invokable)
{
if ($invokable->implicit ?? false) {
return new class($invokable) extends InvokableValidationRule implements ImplicitRule {
return new class($invokable) extends InvokableValidationRule implements ImplicitRule
{
};
}

Expand Down
12 changes: 9 additions & 3 deletions tests/Bus/BusPendingBatchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ public function test_batch_is_deleted_from_storage_if_exception_thrown_during_ba

$container = new Container;

$job = new class {};
$job = new class
{
};

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

Expand Down Expand Up @@ -225,7 +227,9 @@ public function test_batch_before_event_is_called()

public function test_it_throws_exception_if_batched_job_is_not_batchable(): void
{
$nonBatchableJob = new class {};
$nonBatchableJob = new class
{
};

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

Expand All @@ -240,7 +244,9 @@ public function test_it_throws_an_exception_if_batched_job_contains_batch_with_n
new PendingBatch(
$container,
new Collection(
[new PendingBatch($container, new Collection([new BatchableJob, new class {}]))]
[new PendingBatch($container, new Collection([new BatchableJob, new class
{
}]))]
)
);
}
Expand Down
8 changes: 6 additions & 2 deletions tests/Database/DatabaseAbstractSchemaGrammarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,19 @@ protected function tearDown(): void
public function testCreateDatabase()
{
$connection = m::mock(Connection::class);
$grammar = new class($connection) extends Grammar {};
$grammar = new class($connection) extends Grammar
{
};

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

public function testDropDatabaseIfExists()
{
$connection = m::mock(Connection::class);
$grammar = new class($connection) extends Grammar {};
$grammar = new class($connection) extends Grammar
{
};

$this->assertSame('drop database if exists "foo"', $grammar->compileDropDatabaseIfExists('foo'));
}
Expand Down
4 changes: 3 additions & 1 deletion tests/Database/DatabaseEloquentInverseRelationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ public function testOnlyHydratesInverseRelationOnModels()
[],
new HasInverseRelationRelatedStub(),
'foo',
new class() {},
new class()
{
},
new HasInverseRelationRelatedStub(),
]);
}
Expand Down
8 changes: 6 additions & 2 deletions tests/Encryption/EncrypterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,13 @@ public static function provideTamperedData()

return [
[['iv' => ['value_in_array'], 'value' => '', 'mac' => '']],
[['iv' => new class() {}, 'value' => '', 'mac' => '']],
[['iv' => new class()
{
}, 'value' => '', 'mac' => '']],
[['iv' => $validIv, 'value' => ['value_in_array'], 'mac' => '']],
[['iv' => $validIv, 'value' => new class() {}, 'mac' => '']],
[['iv' => $validIv, 'value' => new class()
{
}, 'mac' => '']],
[['iv' => $validIv, 'value' => '', 'mac' => ['value_in_array']]],
[['iv' => $validIv, 'value' => '', 'mac' => null]],
[['iv' => $validIv, 'value' => '', 'mac' => '', 'tag' => ['value_in_array']]],
Expand Down
8 changes: 6 additions & 2 deletions tests/Http/JsonResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ class JsonResourceTest extends TestCase
{
public function testJsonResourceNullAttributes()
{
$model = new class extends Model {};
$model = new class extends Model
{
};

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

public function testJsonResourceToJsonSucceedsWithPriorErrors(): void
{
$model = new class extends Model {};
$model = new class extends Model
{
};

$resource = m::mock(JsonResource::class, ['resource' => $model])
->makePartial()
Expand Down
4 changes: 3 additions & 1 deletion tests/Pagination/CursorPaginatorLoadMorphCountTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ public function testCollectionLoadMorphCountCanChainOnThePaginator()
$items = m::mock(Collection::class);
$items->shouldReceive('loadMorphCount')->once()->with('parentable', $relations);

$p = (new class extends AbstractCursorPaginator {})->setCollection($items);
$p = (new class extends AbstractCursorPaginator
{
})->setCollection($items);

$this->assertSame($p, $p->loadMorphCount('parentable', $relations));
}
Expand Down
4 changes: 3 additions & 1 deletion tests/Pagination/CursorPaginatorLoadMorphTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ public function testCollectionLoadMorphCanChainOnThePaginator()
$items = m::mock(Collection::class);
$items->shouldReceive('loadMorph')->once()->with('parentable', $relations);

$p = (new class extends AbstractCursorPaginator {})->setCollection($items);
$p = (new class extends AbstractCursorPaginator
{
})->setCollection($items);

$this->assertSame($p, $p->loadMorph('parentable', $relations));
}
Expand Down
4 changes: 3 additions & 1 deletion tests/Pagination/PaginatorLoadMorphCountTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ public function testCollectionLoadMorphCountCanChainOnThePaginator()
$items = m::mock(Collection::class);
$items->shouldReceive('loadMorphCount')->once()->with('parentable', $relations);

$p = (new class extends AbstractPaginator {})->setCollection($items);
$p = (new class extends AbstractPaginator
{
})->setCollection($items);

$this->assertSame($p, $p->loadMorphCount('parentable', $relations));
}
Expand Down
4 changes: 3 additions & 1 deletion tests/Pagination/PaginatorLoadMorphTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ public function testCollectionLoadMorphCanChainOnThePaginator()
$items = m::mock(Collection::class);
$items->shouldReceive('loadMorph')->once()->with('parentable', $relations);

$p = (new class extends AbstractPaginator {})->setCollection($items);
$p = (new class extends AbstractPaginator
{
})->setCollection($items);

$this->assertSame($p, $p->loadMorph('parentable', $relations));
}
Expand Down
8 changes: 6 additions & 2 deletions tests/Support/SupportCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2371,9 +2371,13 @@ public function testImplode($collection)
#[DataProvider('collectionClassProvider')]
public function testImplodeModels($collection)
{
$model = new class extends Model {};
$model = new class extends Model
{
};
$model->setAttribute('email', 'foo');
$modelTwo = new class extends Model {};
$modelTwo = new class extends Model
{
};
$modelTwo->setAttribute('email', 'bar');
$data = new $collection([$model, $modelTwo]);

Expand Down
4 changes: 3 additions & 1 deletion tests/Validation/ValidationValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,9 @@ public function testCustomException()

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

$exception = new class($v) extends ValidationException {};
$exception = new class($v) extends ValidationException
{
};
$v->setException($exception);

try {
Expand Down
4 changes: 3 additions & 1 deletion tests/View/Blade/BladeComponentTagCompilerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,9 @@ public function __toString()
}
};

$model = new class extends Model {};
$model = new class extends Model
{
};

$this->assertEquals(e('<hi>'), BladeCompiler::sanitizeComponentAttribute('<hi>'));
$this->assertEquals(e('1'), BladeCompiler::sanitizeComponentAttribute('1'));
Expand Down
Loading