Completed
Pull Request — master (#24)
by Karl
03:37
created
database/migrations/2016_10_16_214801_create_notifications_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
      */
13 13
     public function up()
14 14
     {
15
-        Schema::create('notifications', function (Blueprint $table) {
15
+        Schema::create('notifications', function(Blueprint $table) {
16 16
             $table->uuid('id')->primary();
17 17
             $table->string('type');
18 18
             $table->uuid('notifiable_id');
Please login to merge, or discard this patch.
app/Notifications/JobsCollected.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      */
44 44
     public function via($notifiable)
45 45
     {
46
-        return ['mail', 'database'];
46
+        return [ 'mail', 'database' ];
47 47
     }
48 48
 
49 49
     /**
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
         $count = count($this->jobs);
69 69
         $message = new JobMailMessage();
70 70
         // Add user and search ID to view data
71
-        $message->viewData['user_id'] = $notifiable->id;
72
-        $message->viewData['search_id'] = $this->search->id;
71
+        $message->viewData[ 'user_id' ] = $notifiable->id;
72
+        $message->viewData[ 'search_id' ] = $this->search->id;
73 73
         // Update the message and subject
74 74
         $message->subject($count.' job listings found especially for you')
75 75
             ->greeting('Hello,')
Please login to merge, or discard this patch.
app/Models/Search.php 1 patch
Spacing   +4 added lines, -4 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
     }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      */
80 80
     public function scopeWhereUserId($query, $id = null)
81 81
     {
82
-        return $query->whereHas('user', function ($query) use ($id) {
82
+        return $query->whereHas('user', function($query) use ($id) {
83 83
             return $query->where('id', $id);
84 84
         });
85 85
     }
Please login to merge, or discard this patch.
database/migrations/2016_10_22_134445_recruiters.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,14 +13,14 @@  discard block
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('recruiters', function (Blueprint $table) {
16
+        Schema::create('recruiters', function(Blueprint $table) {
17 17
             $table->uuid('id')->primary();
18 18
             $table->string('name')->unique();
19 19
             $table->string('url')->nullable();
20 20
             $table->timestamps();
21 21
         });
22 22
 
23
-        Schema::table('searches', function (Blueprint $table) {
23
+        Schema::table('searches', function(Blueprint $table) {
24 24
             $table->boolean('no_recruiters')->default(false);
25 25
         });
26 26
     }
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      */
33 33
     public function down()
34 34
     {
35
-        Schema::table('searches', function (Blueprint $table) {
35
+        Schema::table('searches', function(Blueprint $table) {
36 36
             $table->dropColumn('no_recruiters');
37 37
         });
38 38
 
Please login to merge, or discard this patch.
app/Jobs/SearchAndNotifyUser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
     /**
21 21
      * @var array Jobs collected from providers.
22 22
      */
23
-    protected $jobs = [];
23
+    protected $jobs = [ ];
24 24
 
25 25
     /**
26 26
      * @var Recruiter recruiter model
Please login to merge, or discard this patch.
app/Models/Recruiter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     {
31 31
         parent::boot();
32 32
 
33
-        static::creating(function ($model) {
33
+        static::creating(function($model) {
34 34
             $model->{$model->getKeyName()} = Uuid::uuid4();
35 35
         });
36 36
     }
@@ -46,6 +46,6 @@  discard block
 block discarded – undo
46 46
     public function scopeWhereNameLike($query, $name = null)
47 47
     {
48 48
         $where = "to_tsvector('english', name) @@ plainto_tsquery('english', ?)";
49
-        return $query->whereRaw($where, [$name]);
49
+        return $query->whereRaw($where, [ $name ]);
50 50
     }
51 51
 }
Please login to merge, or discard this patch.
app/Filters/RecruiterFilter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     {
23 23
         // Make sure this search wants to filter recruiters
24 24
         if ($search->no_recruiters === true) {
25
-            return array_filter($jobs, function ($job) {
25
+            return array_filter($jobs, function($job) {
26 26
                 // Make sure this job has a company
27 27
                 if (isset($job->company)) {
28 28
                     // Make sure this company is not a recruiter
Please login to merge, or discard this patch.
app/Filters/JobFilter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,14 +9,14 @@
 block discarded – undo
9 9
      *
10 10
      * @return array
11 11
      */
12
-    public function sort($jobs = [], $maxAge = 14, $maxJobs = 50)
12
+    public function sort($jobs = [ ], $maxAge = 14, $maxJobs = 50)
13 13
     {
14 14
         // Sort by date
15
-        usort($jobs, function ($item1, $item2) {
15
+        usort($jobs, function($item1, $item2) {
16 16
             return $item2->datePosted <=> $item1->datePosted;
17 17
         });
18 18
         // Filter any older than max age
19
-        $jobs = array_filter($jobs, function ($job) use ($maxAge) {
19
+        $jobs = array_filter($jobs, function($job) use ($maxAge) {
20 20
             return $job->datePosted > new \DateTime($maxAge.' days ago');
21 21
         });
22 22
         // Truncate to the max number of results
Please login to merge, or discard this patch.
app/Filters/CollectionFilter.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,16 +12,16 @@
 block discarded – undo
12 12
      *
13 13
      * @return array
14 14
      */
15
-    public function getJobsFromCollections($collectionsArray = [], $max = 50)
15
+    public function getJobsFromCollections($collectionsArray = [ ], $max = 50)
16 16
     {
17
-        $jobs = [];
17
+        $jobs = [ ];
18 18
         array_walk_recursive(
19 19
             $collectionsArray,
20
-            function (Collection $collection) use (&$jobs, $max) {
20
+            function(Collection $collection) use (&$jobs, $max) {
21 21
                 $this->logErrorsFromCollection($collection);
22 22
                 $jobListings = array_slice($collection->all(), 0, $max);
23 23
                 foreach ($jobListings as $jobListing) {
24
-                    $jobs[] = $jobListing;
24
+                    $jobs[ ] = $jobListing;
25 25
                 }
26 26
             }
27 27
         );
Please login to merge, or discard this patch.