Skip to content

Commit 5f96604

Browse files
authored
Merge pull request #21 from AmazonPython/analysis-QMgVdm
Apply fixes from StyleCI
2 parents 581be76 + a28d1c2 commit 5f96604

File tree

74 files changed

+597
-583
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+597
-583
lines changed

app/Channel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace App;
44

5-
use Illuminate\Support\Str;
65
use Illuminate\Database\Eloquent\Model;
6+
use Illuminate\Support\Str;
77

88
class Channel extends Model
99
{

app/Console/Kernel.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ class Kernel extends ConsoleKernel
1919
/**
2020
* Define the application's command schedule.
2121
*
22-
* @param \Illuminate\Console\Scheduling\Schedule $schedule
22+
* @param \Illuminate\Console\Scheduling\Schedule $schedule
23+
*
2324
* @return void
2425
*/
2526
protected function schedule(Schedule $schedule)

app/Events/ThreadReceivedNewReply.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
namespace App\Events;
44

5-
use Illuminate\Queue\SerializesModels;
5+
use Illuminate\Broadcasting\InteractsWithSockets;
66
use Illuminate\Broadcasting\PrivateChannel;
77
use Illuminate\Foundation\Events\Dispatchable;
8-
use Illuminate\Broadcasting\InteractsWithSockets;
8+
use Illuminate\Queue\SerializesModels;
99

1010
class ThreadReceivedNewReply
1111
{
12-
use Dispatchable, InteractsWithSockets, SerializesModels;
12+
use Dispatchable;
13+
use InteractsWithSockets;
14+
use SerializesModels;
1315

1416
public $reply;
1517

app/Exceptions/Handler.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ class Handler extends ExceptionHandler
2929
/**
3030
* Report or log an exception.
3131
*
32-
* @param \Exception $exception
32+
* @param \Exception $exception
33+
*
3334
* @return void
3435
*/
3536
public function report(Exception $exception)
@@ -40,8 +41,9 @@ public function report(Exception $exception)
4041
/**
4142
* Render an exception into an HTTP response.
4243
*
43-
* @param \Illuminate\Http\Request $request
44-
* @param \Exception $exception
44+
* @param \Illuminate\Http\Request $request
45+
* @param \Exception $exception
46+
*
4547
* @return \Illuminate\Http\Response
4648
*/
4749
public function render($request, Exception $exception)

app/Extensions/EloquentUserProvider.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22

33
namespace App\Extensions;
44

5-
use Illuminate\Support\Str;
65
use Illuminate\Auth\EloquentUserProvider as BaseUserProvider;
6+
use Illuminate\Support\Str;
77

88
class EloquentUserProvider extends BaseUserProvider
99
{
1010
/**
1111
* Retrieve a user by the given credentials.
1212
*
13-
* @param array $credentials
13+
* @param array $credentials
14+
*
1415
* @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|object
1516
*/
1617
public function retrieveByCredentials(array $credentials)

app/Favoritable.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace App;
44

5-
use Illuminate\Database\Eloquent\Model;
6-
75
trait Favoritable
86
{
97
protected static function bootFavoritable()
@@ -22,7 +20,7 @@ public function favorite()
2220
{
2321
$arrtributes = ['user_id' => auth()->id()];
2422

25-
if (! $this->favorites()->where($arrtributes)->exists()){
23+
if (!$this->favorites()->where($arrtributes)->exists()) {
2624
return $this->favorites()->create($arrtributes);
2725
}
2826
}
@@ -36,7 +34,7 @@ public function unfavorite()
3634

3735
public function isFavorited()
3836
{
39-
return ! ! $this->favorites->where('user_id', auth()->id())->count();
37+
return (bool) $this->favorites->where('user_id', auth()->id())->count();
4038
}
4139

4240
public function getIsFavoritedAttribute()

app/Filters/Filters.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
abstract class Filters
88
{
9-
protected $request, $builder;
9+
protected $request;
10+
protected $builder;
1011

1112
protected $filters = [];
1213

app/Http/Controllers/Admin/ChannelController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function store()
2323
{
2424
$channel = Channel::create(
2525
request()->validate([
26-
'name' => 'required|unique:channels',
26+
'name' => 'required|unique:channels',
2727
'description' => 'required',
2828
])
2929
);

app/Http/Controllers/Admin/ThreadController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace App\Http\Controllers\Admin;
44

5+
use App\Http\Controllers\Controller;
56
use App\Thread;
67
use App\Trending;
7-
use App\Http\Controllers\Controller;
88

99
class ThreadController extends Controller
1010
{

app/Http/Controllers/Auth/RegisterController.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
namespace App\Http\Controllers\Auth;
44

5-
use App\User;
65
use App\Http\Controllers\Controller;
6+
use App\User;
7+
use Illuminate\Foundation\Auth\RegistersUsers;
78
use Illuminate\Support\Facades\Hash;
89
use Illuminate\Support\Facades\Validator;
9-
use Illuminate\Foundation\Auth\RegistersUsers;
1010

1111
class RegisterController extends Controller
1212
{
@@ -47,29 +47,31 @@ protected function redirectTo()
4747
/**
4848
* Get a validator for an incoming registration request.
4949
*
50-
* @param array $data
50+
* @param array $data
51+
*
5152
* @return \Illuminate\Contracts\Validation\Validator
5253
*/
5354
protected function validator(array $data)
5455
{
5556
return Validator::make($data, [
56-
'name' => ['required', 'string', 'max:255', 'unique:users'],
57-
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
57+
'name' => ['required', 'string', 'max:255', 'unique:users'],
58+
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
5859
'password' => ['required', 'string', 'min:8', 'confirmed'],
5960
]);
6061
}
6162

6263
/**
6364
* Create a new user instance after a valid registration.
6465
*
65-
* @param array $data
66+
* @param array $data
67+
*
6668
* @return \App\User
6769
*/
6870
protected function create(array $data)
6971
{
7072
return User::create([
71-
'name' => $data['name'],
72-
'email' => $data['email'],
73+
'name' => $data['name'],
74+
'email' => $data['email'],
7375
'password' => Hash::make($data['password']),
7476
]);
7577
}

0 commit comments

Comments
 (0)