8000 Merge pull request #28297 from laravel/analysis-8jekNB · laravel/framework@46fd897 · GitHub
[go: up one dir, main page]

Skip to content

Commit 46fd897

Browse files
authored
Merge pull request #28297 from laravel/analysis-8jekNB
Apply fixes from StyleCI
2 parents b066ff0 + e5862a8 commit 46fd897

File tree

12 files changed

+18
-31
lines changed

12 files changed

+18
-31
lines changed

src/Illuminate/Auth/Access/Gate.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,6 @@ protected function resolveAuthCallback($user, $ability, array $arguments)
490490
}
491491

492492
return function () {
493-
return null;
494493
};
495494
}
496495

@@ -580,7 +579,7 @@ protected function resolvePolicyCallback($user, $ability, array $arguments, $pol
580579
protected function callPolicyBefore($policy, $user, $ability, $arguments)
581580
{
582581
if (! method_exists($policy, 'before')) {
583-
return null;
582+
return;
584583
}
585584

586585
if ($this->canBeCalledWithUser($user, $policy, 'before')) {
@@ -607,7 +606,7 @@ protected function callPolicyMethod($policy, $method, $user, array $arguments)
607606
}
608607

609608
if (! is_callable([$policy, $method])) {
610-
return null;
609+
return;
611610
}
612611

613612
if ($this->canBeCalledWithUser($user, $policy, $method)) {

src/Illuminate/Auth/EloquentUserProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function retrieveByToken($identifier, $token)
6666
$model = $model->where($model->getAuthIdentifierName(), $identifier)->first();
6767

6868
if (! $model) {
69-
return null;
69+
return;
7070
}
7171

7272
$rememberToken = $model->getRememberToken();

src/Illuminate/Database/Eloquent/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function loadMissing($relations)
141141
* @param array $path
142142
* @return void
143143
*/
144-
protected function loadMissingRelation(Collection $models, array $path)
144+
protected function loadMissingRelation(self $models, array $path)
145145
{
146146
$relation = array_shift($path);
147147

src/Illuminate/Http/Resources/ConditionallyLoadsAttributes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ protected function whenLoaded($relationship, $value = null, $default = null)
160160
}
161161

162162
if ($this->resource->{$relationship} === null) {
163-
return null;
163+
return;
164164
}
165165

166166
return value($value);

src/Illuminate/Queue/DatabaseQueue.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,6 @@ public function pop($queue = null)
199199
if ($job = $this->getNextAvailableJob($queue)) {
200200
return $this->marshalJob($queue, $job);
201201
}
202-
203-
return null;
204202
});
205203
}
206204

tests/Auth/AuthAccessGateTest.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public function test_basic_closures_can_be_defined()
2929
public function test_before_can_take_an_array_callback_as_object()
3030
{
3131
$gate = new Gate(new Container, function () {
32-
return null;
3332
});
3433

3534
$gate->before([new AccessGateTestBeforeCallback, 'allowEverything']);
@@ -40,7 +39,6 @@ public function test_before_can_take_an_array_callback_as_object()
4039
public function test_before_can_take_an_array_callback_as_object_static()
4140
{
4241
$gate = new Gate(new Container, function () {
43-
return null;
4442
});
4543

4644
$gate->before([new AccessGateTestBeforeCallback, 'allowEverythingStatically']);
@@ -51,7 +49,6 @@ public function test_before_can_take_an_array_callback_as_object_static()
5149
public function test_before_can_take_an_array_callback_with_static_method()
5250
{
5351
$gate = new Gate(new Container, function () {
54-
return null;
5552
});
5653

5754
$gate->before([AccessGateTestBeforeCallback::class, 'allowEverythingStatically']);
@@ -62,7 +59,6 @@ public function test_before_can_take_an_array_callback_with_static_method()
6259
public function test_before_can_allow_guests()
6360
{
6461
$gate = new Gate(new Container, function () {
65-
return null;
6662
});
6763

6864
$gate->before(function (?StdClass $user) {
@@ -75,7 +71,6 @@ public function test_before_can_allow_guests()
7571
public function test_after_can_allow_guests()
7672
{
7773
$gate = new Gate(new Container, function () {
78-
return null;
7974
});
8075

8176
$gate->after(function (?StdClass $user) {
@@ -88,7 +83,6 @@ public function test_after_can_allow_guests()
8883
public function test_closures_can_allow_guest_users()
8984
{
9085
$gate = new Gate(new Container, function () {
91-
return null;
9286
});
9387

9488
$gate->define('foo', function (?StdClass $user) {
@@ -108,7 +102,6 @@ public function test_policies_can_allow_guests()
108102
unset($_SERVER['__laravel.testBefore']);
109103

110104
$gate = new Gate(new Container, function () {
111-
return null;
112105
});
113106

114107
$gate->policy(AccessGateTestDummy::class, AccessGateTestPolicyThatAllowsGuests::class);
@@ -132,7 +125,6 @@ public function test_policy_before_not_called_with_guests_if_it_doesnt_allow_the
132125
$_SERVER['__laravel.testBefore'] = false;
133126

134127
$gate = new Gate(new Container, function () {
135-
return null;
136128
});
137129

138130
$gate->policy(AccessGateTestDummy::class, AccessGateTestPolicyWithNonGuestBefore::class);
@@ -152,7 +144,6 @@ public function test_before_and_after_callbacks_can_allow_guests()
152144
$_SERVER['__laravel.gateAfter2'] = false;
153145

154146
$gate = new Gate(new Container, function () {
155-
return null;
156147
});
157148

158149
$gate->before(function (?StdClass $user) {

tests/Database/DatabaseEloquentBuilderTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,27 +1224,27 @@ class EloquentBuilderTestModelSelfRelatedStub extends Model
12241224

12251225
public function parentFoo()
12261226
{
1227-
return $this->belongsTo(EloquentBuilderTestModelSelfRelatedStub::class, 'parent_id', 'id', 'parent');
1227+
return $this->belongsTo(self::class, 'parent_id', 'id', 'parent');
12281228
}
12291229

12301230
public function childFoo()
12311231
{
1232-
return $this->hasOne(EloquentBuilderTestModelSelfRelatedStub::class, 'parent_id', 'id');
1232+
return $this->hasOne(self::class, 'parent_id', 'id');
12331233
}
12341234

12351235
public function childFoos()
12361236
{
1237-
return $this->hasMany(EloquentBuilderTestModelSelfRelatedStub::class, 'parent_id', 'id', 'children');
1237+
return $this->hasMany(self::class, 'parent_id', 'id', 'children');
12381238
}
12391239

12401240
public function parentBars()
12411241
{
1242-
return $this->belongsToMany(EloquentBuilderTestModelSelfRelatedStub::class, 'self_pivot', 'child_id', 'parent_id', 'parent_bars');
1242+
return $this->belongsToMany(self::class, 'self_pivot', 'child_id', 'parent_id', 'parent_bars');
12431243
}
12441244

12451245
public function childBars()
12461246
{
1247-
return $this->belongsToMany(EloquentBuilderTestModelSelfRelatedStub::class, 'self_pivot', 'parent_id', 'child_id', 'child_bars');
1247+
return $this->belongsToMany(self::class, 'self_pivot', 'parent_id', 'child_id', 'child_bars');
12481248
}
12491249

12501250
public function bazes()

tests/Database/DatabaseEloquentIntegrationTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1587,17 +1587,17 @@ class EloquentTestUser extends Eloquent
15871587

15881588
public function friends()
15891589
{
1590-
return $this->belongsToMany(EloquentTestUser::class, 'friends', 'user_id', 'friend_id');
1590+
return $this->belongsToMany(self::class, 'friends', 'user_id', 'friend_id');
15911591
}
15921592

15931593
public function friendsOne()
15941594
{
1595-
return $this->belongsToMany(EloquentTestUser::class, 'friends', 'user_id', 'friend_id')->wherePivot('user_id', 1);
1595+
return $this->belongsToMany(self::class, 'friends', 'user_id', 'friend_id')->wherePivot('user_id', 1);
15961596
}
15971597

15981598
public function friendsTwo()
15991599
{
1600-
return $this->belongsToMany(EloquentTestUser::class, 'friends', 'user_id', 'friend_id')->wherePivot('user_id', 2);
1600+
return $this->belongsToMany(self::class, 'friends', 'user_id', 'friend_id')->wherePivot('user_id', 2);
16011601
}
16021602

16031603
public function posts()
@@ -1705,12 +1705,12 @@ public function photos()
17051705

17061706
public function childPosts()
17071707
{
1708-
return $this->hasMany(EloquentTestPost::class, 'parent_id');
1708+
return $this->hasMany(self::class, 'parent_id');
17091709
}
17101710

17111711
public function parentPost()
17121712
{
1713-
return $this->belongsTo(EloquentTestPost::class, 'parent_id');
1713+
return $this->belongsTo(self::class, 'parent_id');
17141714
}
17151715
}
17161716

tests/Integration/Database/EloquentCollectionLoadMissingTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class Comment extends Model
9999

100100
public function parent()
101101
{
102-
return $this->belongsTo(Comment::class);
102+
return $this->belongsTo(self::class);
103103
}
104104

105105
public function revisions()

tests/Integration/Database/EloquentModelLoadMissingTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class Comment extends Model
5454

5555
public function parent()
5656
{
57-
return $this->belongsTo(Comment::class);
57+
return $this->belongsTo(self::class);
5858
}
5959
}
6060

tests/Integration/Support/Fixtures/NullableManager.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ class NullableManager extends Manager
1313
*/
1414
public function getDefaultDriver()
1515
{
16-
return null;
1716
}
1817
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php echo $__env->yieldContent('content'); ?>
1+
<?php echo $__env->yieldContent('content');

0 commit comments

Comments
 (0)
0