Skip to content

Commit 877451f

Browse files
author
AmirHossein Fallah
committed
style: resolve final StyleCI issues
- Fix unary_operator_spaces in InvokableValidationRule.php - Fix remaining braces_position issues in test files - All StyleCI checks now pass (2529 files PASS) - PR laravel#56507 ready for merge
1 parent 56f5471 commit 877451f

File tree

4 files changed

+30
-15
lines changed

4 files changed

+30
-15
lines changed

src/Illuminate/Validation/InvokableValidationRule.php

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

tests/Bus/BusPendingBatchTest.php

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ public function test_pending_batch_may_be_configured_and_dispatched()
3030

3131
$container->instance(Dispatcher::class, $eventDispatcher);
3232

33-
$job = new class {
33+
$job = new class
34+
{
3435
use Batchable;
3536
};
3637

@@ -70,7 +71,8 @@ public function test_batch_is_deleted_from_storage_if_exception_thrown_during_ba
7071

7172
$container = new Container;
7273

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

7678
$pendingBatch = new PendingBatch($container, new Collection([$job]));
@@ -100,7 +102,8 @@ public function test_batch_is_dispatched_when_dispatchif_is_true()
100102
$eventDispatcher->shouldReceive('dispatch')->once();
101103
$container->instance(Dispatcher::class, $eventDispatcher);
102104

103-
$job = new class {
105+
$job = new class
106+
{
104107
use Batchable;
105108
};
106109

@@ -125,7 +128,8 @@ public function test_batch_is_not_dispatched_when_dispatchif_is_false()
125128
$eventDispatcher->shouldNotReceive('dispatch');
126129
$container->instance(Dispatcher::class, $eventDispatcher);
127130

128-
$job = new class {
131+
$job = new class
132+
{
129133
use Batchable;
130134
};
131135

@@ -147,7 +151,8 @@ public function test_batch_is_dispatched_when_dispatchunless_is_false()
147151
$eventDispatcher->shouldReceive('dispatch')->once();
148152
$container->instance(Dispatcher::class, $eventDispatcher);
149153

150-
$job = new class {
154+
$job = new class
155+
{
151156
use Batchable;
152157
};
153158

@@ -172,7 +177,8 @@ public function test_batch_is_not_dispatched_when_dispatchunless_is_true()
172177
$eventDispatcher->shouldNotReceive('dispatch');
173178
$container->instance(Dispatcher::class, $eventDispatcher);
174179

175-
$job = new class {
180+
$job = new class
181+
{
176182
use Batchable;
177183
};
178184

@@ -195,7 +201,8 @@ public function test_batch_before_event_is_called()
195201

196202
$container->instance(Dispatcher::class, $eventDispatcher);
197203

198-
$job = new class {
204+
$job = new class
205+
{
199206
use Batchable;
200207
};
201208

@@ -220,7 +227,8 @@ public function test_batch_before_event_is_called()
220227

221228
public function test_it_throws_exception_if_batched_job_is_not_batchable(): void
222229
{
223-
$nonBatchableJob = new class {
230+
$nonBatchableJob = new class
231+
{
224232
};
225233

226234
$this->expectException(RuntimeException::class);
@@ -236,7 +244,8 @@ public function test_it_throws_an_exception_if_batched_job_contains_batch_with_n
236244
new PendingBatch(
237245
$container,
238246
new Collection(
239-
[new PendingBatch($container, new Collection([new BatchableJob, new class {
247+
[new PendingBatch($container, new Collection([new BatchableJob, new class
248+
{
240249
}]))]
241250
)
242251
);

tests/Database/DatabaseAbstractSchemaGrammarTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ 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+
{
2122
};
2223

2324
$this->assertSame('create database "foo"', $grammar->compileCreateDatabase('foo'));
@@ -26,7 +27,8 @@ public function testCreateDatabase()
2627
public function testDropDatabaseIfExists()
2728
{
2829
$connection = m::mock(Connection::class);
29-
$grammar = new class($connection) extends Grammar {
30+
$grammar = new class($connection) extends Grammar
31+
{
3032
};
3133

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

tests/Http/JsonResourceTest.php

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

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

3334
public function testJsonResourceToJsonSucceedsWithPriorErrors(): void
3435
{
35-
$model = new class extends Model {
36+
$model = new class extends Model
37+
{
3638
};
3739

3840
$resource = m::mock(JsonResource::class, ['resource' => $model])
@@ -49,7 +51,8 @@ public function testJsonResourceToJsonSucceedsWithPriorErrors(): void
4951

5052
public function testJsonResourceToPrettyPrint(): void
5153
{
52-
$model = new class extends Model {
54+
$model = new class extends Model
55+
{
5356
};
5457

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

0 commit comments

Comments
 (0)