@@ -12,7 +12,7 @@ |
||
| 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'); |
@@ -43,7 +43,7 @@ discard block |
||
| 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 |
||
| 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,') |
@@ -33,7 +33,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -13,14 +13,14 @@ discard block |
||
| 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 |
||
| 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 | |
@@ -20,7 +20,7 @@ |
||
| 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 |
@@ -30,7 +30,7 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -22,7 +22,7 @@ |
||
| 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 |
@@ -9,14 +9,14 @@ |
||
| 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 |
@@ -12,16 +12,16 @@ |
||
| 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 | ); |