Skip to content

Commit 11edbfe

Browse files
Fix spaces (#45105)
* Fix spaces * fix
1 parent 2071b04 commit 11edbfe

File tree

11 files changed

+36
-37
lines changed

11 files changed

+36
-37
lines changed

src/Illuminate/Database/Concerns/CompilesJsonPaths.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected function wrapJsonPath($value, $delimiter = '->')
3535
$value = preg_replace("/([\\\\]+)?\\'/", "''", $value);
3636

3737
$jsonPath = collect(explode($delimiter, $value))
38-
->map(fn ($segment) => $this->wrapJsonPathSegment($segment))
38+
->map(fn ($segment) => $this->wrapJsonPathSegment($segment))
3939
->join('.');
4040

4141
return "'$".(str_starts_with($jsonPath, '[') ? '' : '.').$jsonPath."'";

tests/Database/DatabaseEloquentWithCastsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ protected function setUp(): void
1515
$db = new DB;
1616

1717
$db->addConnection([
18-
'driver' => 'sqlite',
18+
'driver' => 'sqlite',
1919
'database' => ':memory:',
2020
]);
2121

tests/Http/HttpRequestTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ public function testInputMethod()
587587

588588
public function testBooleanMethod()
589589
{
590-
$request = Request::create('/', 'GET', ['with_trashed' => 'false', 'download' => true, 'checked' => 1, 'unchecked' => '0', 'with_on' => 'on', 'with_yes'=> 'yes']);
590+
$request = Request::create('/', 'GET', ['with_trashed' => 'false', 'download' => true, 'checked' => 1, 'unchecked' => '0', 'with_on' => 'on', 'with_yes' => 'yes']);
591591
$this->assertTrue($request->boolean('checked'));
592592
$this->assertTrue($request->boolean('download'));
593593
$this->assertFalse($request->boolean('unchecked'));
@@ -605,8 +605,8 @@ public function testIntegerMethod()
605605
'zero_padded' => '078',
606606
'space_padded' => ' 901',
607607
'nan' => 'nan',
608-
'mixed'=> '1ab',
609-
'underscore_notation'=> '2_000',
608+
'mixed' => '1ab',
609+
'underscore_notation' => '2_000',
610610
]);
611611
$this->assertSame(123, $request->integer('int'));
612612
$this->assertSame(456, $request->integer('raw_int'));
@@ -627,8 +627,8 @@ public function testFloatMethod()
627627
'zero_padded' => '0.78',
628628
'space_padded' => ' 90.1',
629629
'nan' => 'nan',
630-
'mixed'=> '1.ab',
631-
'scientific_notation'=> '1e3',
630+
'mixed' => '1.ab',
631+
'scientific_notation' => '1e3',
632632
]);
633633
$this->assertSame(1.23, $request->float('float'));
634634
$this->assertSame(45.6, $request->float('raw_float'));

tests/Integration/Database/EloquentWhereHasTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public static function dataProviderWhereRelationCallback()
110110
};
111111

112112
return [
113-
'Find user with post.public = true' => $callbackArray(true),
113+
'Find user with post.public = true' => $callbackArray(true),
114114
'Find user with post.public = false' => $callbackArray(false),
115115
];
116116
}

tests/Notifications/NotificationDatabaseChannelTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ public function testCustomizeTypeIsSentToDatabase()
5757
$notifiable = m::mock();
5858

5959
$notifiable->shouldReceive('routeNotificationFor->create')->with([
60-
'id' => 1,
61-
'type' => 'MONTHLY',
62-
'data' => ['invoice_id' => 1],
63-
'read_at' => null,
60+
'id' => 1,
61+
'type' => 'MONTHLY',
62+
'data' => ['invoice_id' => 1],
63+
'read_at' => null,
6464
'something' => 'else',
6565
]);
6666

tests/Queue/QueueDatabaseQueueUnitTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,10 @@ public function testDelayedPushProperlyPushesJobOntoDatabase()
5454
return $uuid;
5555
});
5656

57-
$queue = $this->getMockBuilder(
58-
DatabaseQueue::class)->onlyMethods(
59-
['currentTime'])->setConstructorArgs(
60-
[$database = m::mock(Connection::class), 'table', 'default']
61-
)->getMock();
57+
$queue = $this->getMockBuilder(DatabaseQueue::class)
58+
->onlyMethods(['currentTime'])
59+
->setConstructorArgs([$database = m::mock(Connection::class), 'table', 'default'])
60+
->getMock();
6261
$queue->expects($this->any())->method('currentTime')->willReturn('time');
6362
$queue->setContainer($container = m::spy(Container::class));
6463
$database->shouldReceive('table')->with('table')->andReturn($query = m::mock(stdClass::class));

tests/Support/SupportArrTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -994,9 +994,9 @@ public function testForget()
994994
Arr::forget($array, 1);
995995
$this->assertEquals(['name' => 'hAz', 2 => 'bAz'], $array);
996996

997-
$array = [2 => [1 =>'products', 3 => 'users']];
997+
$array = [2 => [1 => 'products', 3 => 'users']];
998998
Arr::forget($array, 2.3);
999-
$this->assertEquals([2 => [1 =>'products']], $array);
999+
$this->assertEquals([2 => [1 => 'products']], $array);
10001000
}
10011001

10021002
public function testWrap()

tests/Support/SupportStrTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ public function testSlug()
326326
$this->assertSame('500-dollar-bill', Str::slug('500-$-bill', '-', 'en', ['$' => 'dollar']));
327327
$this->assertSame('500-dollar-bill', Str::slug('500$--bill', '-', 'en', ['$' => 'dollar']));
328328
$this->assertSame('500-dollar-bill', Str::slug('500-$--bill', '-', 'en', ['$' => 'dollar']));
329-
$this->assertSame('أحمد-في-المدرسة', Str::slug('أحمد@المدرسة', '-', null, ['@' =>'في']));
329+
$this->assertSame('أحمد-في-المدرسة', Str::slug('أحمد@المدرسة', '-', null, ['@' => 'في']));
330330
}
331331

332332
public function testStrStart()

tests/Validation/ValidationValidatorTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4736,71 +4736,71 @@ public function testItemAwareSometimesAddingRules()
47364736
{
47374737
// ['users'] -> if users is not empty it must be validated as array
47384738
$trans = $this->getIlluminateArrayTranslator();
4739-
$v = new Validator($trans, ['users' => [['name' => 'Taylor'], ['name' => 'Abigail']]], ['users.*.name'=> 'required|string']);
4739+
$v = new Validator($trans, ['users' => [['name' => 'Taylor'], ['name' => 'Abigail']]], ['users.*.name' => 'required|string']);
47404740
$v->sometimes(['users'], 'array', function ($i, $item) {
47414741
return $item !== null;
47424742
});
47434743
$this->assertEquals(['users' => ['array'], 'users.0.name' => ['required', 'string'], 'users.1.name' => ['required', 'string']], $v->getRules());
47444744

47454745
// ['users'] -> if users is null no rules will be applied
47464746
$trans = $this->getIlluminateArrayTranslator();
4747-
$v = new Validator($trans, ['users' => null], ['users.*.name'=> 'required|string']);
4747+
$v = new Validator($trans, ['users' => null], ['users.*.name' => 'required|string']);
47484748
$v->sometimes(['users'], 'array', function ($i, $item) {
47494749
return (bool) $item;
47504750
});
47514751
$this->assertEquals([], $v->getRules());
47524752

47534753
// ['company.users'] -> if users is not empty it must be validated as array
47544754
$trans = $this->getIlluminateArrayTranslator();
4755-
$v = new Validator($trans, ['company' => ['users' => [['name' => 'Taylor'], ['name' => 'Abigail']]]], ['company.users.*.name'=> 'required|string']);
4755+
$v = new Validator($trans, ['company' => ['users' => [['name' => 'Taylor'], ['name' => 'Abigail']]]], ['company.users.*.name' => 'required|string']);
47564756
$v->sometimes(['company.users'], 'array', function ($i, $item) {
47574757
return $item->users !== null;
47584758
});
47594759
$this->assertEquals(['company.users' => ['array'], 'company.users.0.name' => ['required', 'string'], 'company.users.1.name' => ['required', 'string']], $v->getRules());
47604760

47614761
// ['company.users'] -> if users is null no rules will be applied
47624762
$trans = $this->getIlluminateArrayTranslator();
4763-
$v = new Validator($trans, ['company' => ['users' => null]], ['company'=> 'required', 'company.users.*.name'=> 'required|string']);
4763+
$v = new Validator($trans, ['company' => ['users' => null]], ['company' => 'required', 'company.users.*.name' => 'required|string']);
47644764
$v->sometimes(['company.users'], 'array', function ($i, $item) {
47654765
return (bool) $item->users;
47664766
});
47674767
$this->assertEquals(['company' => ['required']], $v->getRules());
47684768

47694769
// ['company.*'] -> if users is not empty it must be validated as array
47704770
$trans = $this->getIlluminateArrayTranslator();
4771-
$v = new Validator($trans, ['company' => ['users' => [['name' => 'Taylor'], ['name' => 'Abigail']]]], ['company.users.*.name'=> 'required|string']);
4771+
$v = new Validator($trans, ['company' => ['users' => [['name' => 'Taylor'], ['name' => 'Abigail']]]], ['company.users.*.name' => 'required|string']);
47724772
$v->sometimes(['company.*'], 'array', function ($i, $item) {
47734773
return $item !== null;
47744774
});
47754775
$this->assertEquals(['company.users' => ['array'], 'company.users.0.name' => ['required', 'string'], 'company.users.1.name' => ['required', 'string']], $v->getRules());
47764776

47774777
// ['company.*'] -> if users is null no rules will be applied
47784778
$trans = $this->getIlluminateArrayTranslator();
4779-
$v = new Validator($trans, ['company' => ['users' => null]], ['company'=> 'required', 'company.users.*.name'=> 'required|string']);
4779+
$v = new Validator($trans, ['company' => ['users' => null]], ['company' => 'required', 'company.users.*.name' => 'required|string']);
47804780
$v->sometimes(['company.*'], 'array', function ($i, $item) {
47814781
return (bool) $item;
47824782
});
47834783
$this->assertEquals(['company' => ['required']], $v->getRules());
47844784

47854785
// ['users.*'] -> all nested array items in users must be validated as array
47864786
$trans = $this->getIlluminateArrayTranslator();
4787-
$v = new Validator($trans, ['users' => [['name' => 'Taylor'], ['name' => 'Abigail']]], ['users.*.name'=> 'required|string']);
4787+
$v = new Validator($trans, ['users' => [['name' => 'Taylor'], ['name' => 'Abigail']]], ['users.*.name' => 'required|string']);
47884788
$v->sometimes(['users.*'], 'array', function ($i, $item) {
47894789
return (bool) $item;
47904790
});
47914791
$this->assertEquals(['users.0' => ['array'], 'users.1' => ['array'], 'users.0.name' => ['required', 'string'], 'users.1.name' => ['required', 'string']], $v->getRules());
47924792

47934793
// ['company.users.*'] -> all nested array items in users must be validated as array
47944794
$trans = $this->getIlluminateArrayTranslator();
4795-
$v = new Validator($trans, ['company' => ['users' => [['name' => 'Taylor'], ['name' => 'Abigail']]]], ['company.users.*.name'=> 'required|string']);
4795+
$v = new Validator($trans, ['company' => ['users' => [['name' => 'Taylor'], ['name' => 'Abigail']]]], ['company.users.*.name' => 'required|string']);
47964796
$v->sometimes(['company.users.*'], 'array', function () {
47974797
return true;
47984798
});
47994799
$this->assertEquals(['company.users.0' => ['array'], 'company.users.1' => ['array'], 'company.users.0.name' => ['required', 'string'], 'company.users.1.name' => ['required', 'string']], $v->getRules());
48004800

48014801
// ['company.*.*'] -> all nested array items in users must be validated as array
48024802
$trans = $this->getIlluminateArrayTranslator();
4803-
$v = new Validator($trans, ['company' => ['users' => [['name' => 'Taylor'], ['name' => 'Abigail']]]], ['company.users.*.name'=> 'required|string']);
4803+
$v = new Validator($trans, ['company' => ['users' => [['name' => 'Taylor'], ['name' => 'Abigail']]]], ['company.users.*.name' => 'required|string']);
48044804
$v->sometimes(['company.*.*'], 'array', function ($i, $item) {
48054805
return true;
48064806
});
@@ -4905,7 +4905,7 @@ public function testItemAwareSometimesAddingRules()
49054905

49064906
// ['attendee.*'] -> if attendee name is set, all other fields will be required as well
49074907
$trans = $this->getIlluminateArrayTranslator();
4908-
$v = new Validator($trans, ['attendee' => ['name' => 'Taylor', 'title' => 'Creator of Laravel', 'type' => 'Developer']], ['attendee.*'=> 'string']);
4908+
$v = new Validator($trans, ['attendee' => ['name' => 'Taylor', 'title' => 'Creator of Laravel', 'type' => 'Developer']], ['attendee.*' => 'string']);
49094909
$v->sometimes(['attendee.*'], 'required', function ($i, $item) {
49104910
return (bool) $item;
49114911
});

types/Database/Eloquent/ModelNotFoundException.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
/** @var ModelNotFoundException<User> $exception */
77
$exception = new ModelNotFoundException();
88

9-
assertType('array<int, int|string>', $exception->getIds());
10-
assertType('class-string<User>', $exception->getModel());
9+
assertType('array<int, int|string>', $exception->getIds());
10+
assertType('class-string<User>', $exception->getModel());
1111

12-
$exception->setModel(User::class, 1);
13-
$exception->setModel(User::class, [1]);
14-
$exception->setModel(User::class, '1');
15-
$exception->setModel(User::class, ['1']);
12+
$exception->setModel(User::class, 1);
13+
$exception->setModel(User::class, [1]);
14+
$exception->setModel(User::class, '1');
15+
$exception->setModel(User::class, ['1']);

0 commit comments

Comments
 (0)