8000 Apply fixes from StyleCI by driesvints · Pull Request #28297 · laravel/framework · GitHub
[go: up one dir, main page]

Skip to content
8000

Apply fixes from StyleCI #28297

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
Apr 22, 2019
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
5 changes: 2 additions & 3 deletions src/Illuminate/Auth/Access/Gate.php
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,6 @@ protected function resolveAuthCallback($user, $ability, array $arguments)
}

return function () {
return null;
};
}

Expand Down Expand Up @@ -580,7 +579,7 @@ protected function resolvePolicyCallback($user, $ability, array $arguments, $pol
protected function callPolicyBefore($policy, $user, $ability, $arguments)
{
if (! method_exists($policy, 'before')) {
return null;
return;
}

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

if (! is_callable([$policy, $method])) {
return null;
return;
}

if ($this->canBeCalledWithUser($user, $policy, $method)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Auth/EloquentUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function retrieveByToken($identifier, $token)
$model = $model->where($model->getAuthIdentifierName(), $identifier)->first();

if (! $model) {
return null;
return;
}

$rememberToken = $model->getRememberToken();
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Eloquent/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function loadMissing($relations)
* @param array $path
* @return void
*/
protected function loadMissingRelation(Collection $models, array $path)
protected function loadMissingRelation(self $models, array $path)
{
$relation = array_shift($path);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ protected function whenLoaded($relationship, $value = null, $default = null)
}

if ($this->resource->{$relationship} === null) {
return null;
return;
}

return value($value);
Expand Down
2 changes: 0 additions & 2 deletions src/Illuminate/Queue/DatabaseQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,6 @@ public function pop($queue = null)
if ($job = $this->getNextAvailableJob($queue)) {
return $this->marshalJob($queue, $job);
}

return null;
});
}

Expand Down
9 changes: 0 additions & 9 deletions tests/Auth/AuthAccessGateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public function test_basic_closures_can_be_defined()
public function test_before_can_take_an_array_callback_as_object()
{
$gate = new Gate(new Container, function () {
return null;
});

$gate->before([new AccessGateTestBeforeCallback, 'allowEverything']);
Expand All @@ -40,7 +39,6 @@ public function test_before_can_take_an_array_callback_as_object()
public function test_before_can_take_an_array_callback_as_object_static()
{
$gate = new Gate(new Container, function () {
return null;
});

$gate->before([new AccessGateTestBeforeCallback, 'allowEverythingStatically']);
Expand All @@ -51,7 +49,6 @@ public function test_before_can_take_an_array_callback_as_object_static()
public function test_before_can_take_an_array_callback_with_static_method()
{
$gate = new Gate(new Container, function () {
return null;
});

$gate->before([AccessGateTestBeforeCallback::class, 'allowEverythingStatically']);
Expand All @@ -62,7 +59,6 @@ public function test_before_can_take_an_array_callback_with_static_method()
public function test_before_can_allow_guests()
{
$gate = new Gate(new Container, function () {
return null;
});

$gate->before(function (?StdClass $user) {
Expand All @@ -75,7 +71,6 @@ public function test_before_can_allow_guests()
public function test_after_can_allow_guests()
{
$gate = new Gate(new Container, function () {
return null;
});

$gate->after(function (?StdClass $user) {
Expand All @@ -88,7 +83,6 @@ public function test_after_can_allow_guests()
public function test_closures_can_allow_guest_users()
{
$gate = new Gate(new Container, function () {
return null;
});

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

$gate = new Gate(new Container, function () {
return null;
});

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

$gate = new Gate(new Container, function () {
return null;
});

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

$gate = new Gate(new Container, function () {
return null;
});

$gate->before(function (?StdClass $user) {
Expand Down
10 changes: 5 additions & 5 deletions tests/Database/DatabaseEloquentBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1224,27 +1224,27 @@ class EloquentBuilderTestModelSelfRelatedStub extends Model

public function parentFoo()
{
return $this->belongsTo(EloquentBuilderTestModelSelfRelatedStub::class, 'parent_id', 'id', 'parent');
return $this->belongsTo(self::class, 'parent_id', 'id', 'parent');
}

public function childFoo()
{
return $this->hasOne(EloquentBuilderTestModelSelfRelatedStub::class, 'parent_id', 'id');
return $this->hasOne(self::class, 'parent_id', 'id');
}

public function childFoos()
{
return $this->hasMany(EloquentBuilderTestModelSelfRelatedStub::class, 'parent_id', 'id', 'children');
return $this->hasMany(self::class, 'parent_id', 'id', 'children');
}

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

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

public function bazes()
Expand Down
10 changes: 5 additions & 5 deletions tests/Database/DatabaseEloquentIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1587,17 +1587,17 @@ class EloquentTestUser extends Eloquent

public function friends()
{
return $this->belongsToMany(EloquentTestUser::class, 'friends', 'user_id', 'friend_id');
return $this->belongsToMany(self::class, 'friends', 'user_id', 'friend_id');
}

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

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

public function posts()
Expand Down Expand Up @@ -1705,12 +1705,12 @@ public function photos()

public function childPosts()
{
return $this->hasMany(EloquentTestPost::class, 'parent_id');
return $this->hasMany(self::class, 'parent_id');
}

public function parentPost()
{
return $this->belongsTo(EloquentTestPost::class, 'parent_id');
return $this->belongsTo(self::class, 'parent_id');
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class Comment extends Model

public function parent()
{
return $this->belongsTo(Comment::class);
return $this->belongsTo(self::class);
}

public function revisions()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Comment extends Model

public function parent()
{
return $this->belongsTo(Comment::class);
return $this->belongsTo(self::class);
}
}

Expand Down
1 change: 0 additions & 1 deletion tests/Integration/Support/Fixtures/NullableManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ class NullableManager extends Manager
*/
public function getDefaultDriver()
{
return null;
}
}
2 changes: 1 addition & 1 deletion tests/View/fixtures/section-exception-layout.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php echo $__env->yieldContent('content'); ?>
<?php echo $__env->yieldContent('content');
0