Completed
Pull Request — master (#11)
by Karl
02:49
created
app/Console/Commands/EmailJobs.php 1 patch
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -2,11 +2,8 @@
 block discarded – undo
2 2
 
3 3
 use Illuminate\Console\Command;
4 4
 use Illuminate\Foundation\Bus\DispatchesJobs;
5
-use JobApis\JobsToMail\Jobs\CollectJobsForUser;
6 5
 use JobApis\JobsToMail\Jobs\SearchAndNotifyUser;
7 6
 use JobApis\JobsToMail\Repositories\Contracts\SearchRepositoryInterface;
8
-use JobApis\JobsToMail\Repositories\SearchRepository;
9
-use JobApis\JobsToMail\Repositories\UserRepository;
10 7
 
11 8
 class EmailJobs extends Command
12 9
 {
Please login to merge, or discard this patch.
app/Repositories/SearchRepository.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,6 @@
 block discarded – undo
12 12
     /**
13 13
      * SearchRepository constructor.
14 14
      *
15
-     * @param Search $model
16 15
      */
17 16
     public function __construct(Search $searches)
18 17
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,10 +27,10 @@
 block discarded – undo
27 27
      *
28 28
      * @return Search
29 29
      */
30
-    public function create($userId = null, $data = [])
30
+    public function create($userId = null, $data = [ ])
31 31
     {
32 32
         return $this->searches->create(
33
-            array_merge(['user_id' => $userId], $data)
33
+            array_merge([ 'user_id' => $userId ], $data)
34 34
         );
35 35
     }
36 36
 
Please login to merge, or discard this patch.
database/migrations/2016_10_14_215937_create_searches_table.php 2 patches
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-use Illuminate\Support\Facades\Schema;
4
-use Illuminate\Database\Schema\Blueprint;
5 3
 use Illuminate\Database\Migrations\Migration;
4
+use Illuminate\Database\Schema\Blueprint;
5
+use Illuminate\Support\Facades\Schema;
6 6
 
7 7
 class CreateTokensTable extends Migration
8 8
 {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('searches', function (Blueprint $table) {
16
+        Schema::create('searches', function(Blueprint $table) {
17 17
             $table->uuid('id');
18 18
             $table->primary('id');
19 19
             $table->uuid('user_id')->unsigned();
Please login to merge, or discard this patch.
app/Jobs/CreateUserAndSearch.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
     /**
16 16
      * Create a new job instance.
17 17
      */
18
-    public function __construct($data = [])
18
+    public function __construct($data = [ ])
19 19
     {
20 20
         $this->data = $data;
21 21
     }
Please login to merge, or discard this patch.
app/Models/Search.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     {
34 34
         parent::boot();
35 35
 
36
-        static::creating(function ($model) {
36
+        static::creating(function($model) {
37 37
             $model->{$model->getKeyName()} = Uuid::uuid4();
38 38
         });
39 39
     }
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public function scopeActive($query)
57 57
     {
58
-        return $query->whereHas('user', function ($query) {
58
+        return $query->whereHas('user', function($query) {
59 59
             return $query->confirmed();
60 60
         });
61 61
     }
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      */
68 68
     public function scopeWhereUserEmail($query, $email = null)
69 69
     {
70
-        return $query->whereHas('user', function ($query) use ($email) {
70
+        return $query->whereHas('user', function($query) use ($email) {
71 71
             return $query->where('email', $email);
72 72
         });
73 73
     }
Please login to merge, or discard this patch.
app/Repositories/Contracts/UserRepositoryInterface.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,11 +4,11 @@
 block discarded – undo
4 4
 {
5 5
     public function confirm($token = null);
6 6
 
7
-    public function create($data = []);
7
+    public function create($data = [ ]);
8 8
 
9
-    public function firstOrCreate($data = []);
9
+    public function firstOrCreate($data = [ ]);
10 10
 
11
-    public function getById($id = null, $options = []);
11
+    public function getById($id = null, $options = [ ]);
12 12
 
13
-    public function update($id = null, $data = []);
13
+    public function update($id = null, $data = [ ]);
14 14
 }
Please login to merge, or discard this patch.
app/Repositories/Contracts/SearchRepositoryInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 interface SearchRepositoryInterface
4 4
 {
5
-    public function create($userId = null, $data = []);
5
+    public function create($userId = null, $data = [ ]);
6 6
 
7 7
     public function getActive($userEmail = null);
8 8
 }
Please login to merge, or discard this patch.
app/Repositories/UserRepository.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     {
40 40
         $tokenObject = $this->getUnexpiredConfirmationToken($token);
41 41
         if ($tokenObject) {
42
-            if ($this->update($tokenObject->user_id, ['confirmed_at' => Carbon::now()])) {
42
+            if ($this->update($tokenObject->user_id, [ 'confirmed_at' => Carbon::now() ])) {
43 43
                 return true;
44 44
             }
45 45
         }
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      *
54 54
      * @return \JobApis\JobsToMail\Models\User
55 55
      */
56
-    public function create($data = [])
56
+    public function create($data = [ ])
57 57
     {
58 58
         $user = $this->users->create($data);
59 59
 
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
      *
70 70
      * @return \JobApis\JobsToMail\Models\User
71 71
      */
72
-    public function firstOrCreate($data = [])
72
+    public function firstOrCreate($data = [ ])
73 73
     {
74
-        if ($user = $this->users->where('email', $data['email'])->first()) {
74
+        if ($user = $this->users->where('email', $data[ 'email' ])->first()) {
75 75
             // Resend the user a confirmation token if they haven't confirmed
76 76
             if (!$user->confirmed_at) {
77 77
                 $this->sendConfirmationToken($user);
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      *
91 91
      * @return \JobApis\JobsToMail\Models\User
92 92
      */
93
-    public function getById($id = null, $options = [])
93
+    public function getById($id = null, $options = [ ])
94 94
     {
95 95
         return $this->users->where('id', $id)->first();
96 96
     }
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
      *
104 104
      * @return boolean
105 105
      */
106
-    public function update($id = null, $data = [])
106
+    public function update($id = null, $data = [ ])
107 107
     {
108 108
         return $this->users->where('id', $id)->update($data);
109 109
     }
Please login to merge, or discard this patch.
app/Notifications/JobsCollected.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      */
34 34
     public function via($notifiable)
35 35
     {
36
-        return ['mail'];
36
+        return [ 'mail' ];
37 37
     }
38 38
 
39 39
     /**
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     {
47 47
         $url = config('app.url').'users/confirm/'.$this->token;
48 48
         $message = new MailMessage;
49
-        $message->viewData['user_id'] = $notifiable->id;
49
+        $message->viewData[ 'user_id' ] = $notifiable->id;
50 50
         return $message
51 51
             ->subject('Confirm your email address to start receiving jobs')
52 52
             ->greeting('Thank you for joining JobsToMail.com.')
Please login to merge, or discard this patch.