@@ -57,7 +57,7 @@ |
||
57 | 57 | /** |
58 | 58 | * Unsubscribe user account |
59 | 59 | * |
60 | - * @return string Json of all users |
|
60 | + * @return \Illuminate\Http\RedirectResponse Json of all users |
|
61 | 61 | */ |
62 | 62 | public function unsubscribe(Request $request, $userId) |
63 | 63 | { |
@@ -33,7 +33,7 @@ |
||
33 | 33 | { |
34 | 34 | $data = $request->only(array_keys($request->rules())); |
35 | 35 | |
36 | - if($user = $this->users->create($data)) { |
|
36 | + if ($user = $this->users->create($data)) { |
|
37 | 37 | $request->session()->flash('alert-success', 'A confirmation email has been sent. Once confirmed, you will start receiving job listings within 24 hours.'); |
38 | 38 | } else { |
39 | 39 | $request->session()->flash('alert-warning', 'Something went wrong and your job search was not created. Please try again or file an issue on Github.'); |
@@ -5,7 +5,6 @@ |
||
5 | 5 | use Illuminate\Queue\InteractsWithQueue; |
6 | 6 | use Illuminate\Contracts\Queue\ShouldQueue; |
7 | 7 | use Illuminate\Support\Facades\Log; |
8 | -use JobApis\Jobs\Client\Collection; |
|
9 | 8 | use JobApis\Jobs\Client\JobsMulti; |
10 | 9 | use JobApis\JobsToMail\Models\User; |
11 | 10 | use JobApis\JobsToMail\Notifications\JobsCollected; |
@@ -53,17 +53,17 @@ |
||
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
56 | - protected function sortJobs($collectionsArray = []) |
|
56 | + protected function sortJobs($collectionsArray = [ ]) |
|
57 | 57 | { |
58 | - $jobs = []; |
|
58 | + $jobs = [ ]; |
|
59 | 59 | // Convert the array of collections to one large array |
60 | 60 | foreach ($collectionsArray as $collection) { |
61 | 61 | foreach (array_slice($collection->all(), 0, 10) as $jobListing) { |
62 | - $jobs[] = $jobListing; |
|
62 | + $jobs[ ] = $jobListing; |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | // Order by date posted, desc |
66 | - usort($jobs, function ($item1, $item2) { |
|
66 | + usort($jobs, function($item1, $item2) { |
|
67 | 67 | return $item2->datePosted <=> $item1->datePosted; |
68 | 68 | }); |
69 | 69 | return $jobs; |
@@ -29,7 +29,7 @@ |
||
29 | 29 | * Get the notification's delivery channels. |
30 | 30 | * |
31 | 31 | * @param mixed $notifiable |
32 | - * @return array |
|
32 | + * @return string[] |
|
33 | 33 | */ |
34 | 34 | public function via($notifiable) |
35 | 35 | { |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * |
21 | 21 | * @return void |
22 | 22 | */ |
23 | - public function __construct($jobs = []) |
|
23 | + public function __construct($jobs = [ ]) |
|
24 | 24 | { |
25 | 25 | $this->jobs = $jobs; |
26 | 26 | } |
@@ -33,7 +33,7 @@ discard block |
||
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 |
||
46 | 46 | { |
47 | 47 | $count = count($this->jobs); |
48 | 48 | $message = new JobMailMessage(); |
49 | - $message->viewData['user_id'] = $notifiable->id; |
|
49 | + $message->viewData[ 'user_id' ] = $notifiable->id; |
|
50 | 50 | $message->subject($count.' job listings found especially for you') |
51 | 51 | ->greeting('Hello,') |
52 | 52 | ->line('We found the following jobs that we think you\'ll be interested in based on your search:'); |
@@ -12,7 +12,6 @@ |
||
12 | 12 | /** |
13 | 13 | * Add a Job listing to the notification |
14 | 14 | * |
15 | - * @param \Illuminate\Notifications\Action|string $line |
|
16 | 15 | * @return $this |
17 | 16 | */ |
18 | 17 | public function listing(Job $job) |
@@ -1,9 +1,7 @@ |
||
1 | 1 | <?php namespace JobApis\JobsToMail\Notifications\Messages; |
2 | 2 | |
3 | -use Illuminate\Contracts\Logging\Log; |
|
4 | 3 | use Illuminate\Notifications\Messages\MailMessage; |
5 | 4 | use JobApis\Jobs\Client\Job; |
6 | -use League\Flysystem\Exception; |
|
7 | 5 | |
8 | 6 | class JobMailMessage extends MailMessage |
9 | 7 | { |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | |
8 | 8 | class JobMailMessage extends MailMessage |
9 | 9 | { |
10 | - public $jobListings = []; |
|
10 | + public $jobListings = [ ]; |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * Add a Job listing to the notification |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $line .= " in {$job->getLocation()}"; |
27 | 27 | } |
28 | 28 | $line .= "."; |
29 | - $this->jobListings[] = [ |
|
29 | + $this->jobListings[ ] = [ |
|
30 | 30 | 'link' => $job->getUrl(), |
31 | 31 | 'text' => $line, |
32 | 32 | ]; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | return array_merge( |
44 | 44 | $this->toArray(), |
45 | 45 | $this->viewData, |
46 | - ['jobListings' => $this->jobListings] |
|
46 | + [ 'jobListings' => $this->jobListings ] |
|
47 | 47 | ); |
48 | 48 | } |
49 | 49 | } |
@@ -29,7 +29,7 @@ |
||
29 | 29 | * Get the notification's delivery channels. |
30 | 30 | * |
31 | 31 | * @param mixed $notifiable |
32 | - * @return array |
|
32 | + * @return string[] |
|
33 | 33 | */ |
34 | 34 | public function via($notifiable) |
35 | 35 | { |
@@ -33,7 +33,7 @@ discard block |
||
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 |
||
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.') |
@@ -20,7 +20,6 @@ |
||
20 | 20 | /** |
21 | 21 | * UserRepository constructor. |
22 | 22 | * |
23 | - * @param User $model |
|
24 | 23 | */ |
25 | 24 | public function __construct(User $users, Token $tokens) |
26 | 25 | { |
@@ -39,7 +39,7 @@ discard block |
||
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 |
||
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 | // Create the user |
59 | 59 | if ($user = $this->users->create($data)) { |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | * |
74 | 74 | * @return \JobApis\JobsToMail\Models\User |
75 | 75 | */ |
76 | - public function getById($id = null, $options = []) |
|
76 | + public function getById($id = null, $options = [ ]) |
|
77 | 77 | { |
78 | 78 | return $this->users->where('id', $id)->first(); |
79 | 79 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * |
97 | 97 | * @return boolean |
98 | 98 | */ |
99 | - public function update($id = null, $data = []) |
|
99 | + public function update($id = null, $data = [ ]) |
|
100 | 100 | { |
101 | 101 | return $this->users->where('id', $id)->update($data); |
102 | 102 | } |
@@ -42,7 +42,7 @@ |
||
42 | 42 | { |
43 | 43 | parent::boot(); |
44 | 44 | |
45 | - static::creating(function ($model) { |
|
45 | + static::creating(function($model) { |
|
46 | 46 | // Generate a secure random token |
47 | 47 | $model->{$model->getKeyName()} = bin2hex(openssl_random_pseudo_bytes(16)); |
48 | 48 | }); |
@@ -34,7 +34,7 @@ |
||
34 | 34 | { |
35 | 35 | parent::boot(); |
36 | 36 | |
37 | - static::creating(function ($model) { |
|
37 | + static::creating(function($model) { |
|
38 | 38 | $model->{$model->getKeyName()} = Uuid::uuid4(); |
39 | 39 | }); |
40 | 40 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | Route::group([ |
53 | 53 | 'middleware' => 'web', |
54 | 54 | 'namespace' => $this->namespace, |
55 | - ], function ($router) { |
|
55 | + ], function($router) { |
|
56 | 56 | require base_path('routes/web.php'); |
57 | 57 | }); |
58 | 58 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | 'middleware' => 'api', |
71 | 71 | 'namespace' => $this->namespace, |
72 | 72 | 'prefix' => 'api', |
73 | - ], function ($router) { |
|
73 | + ], function($router) { |
|
74 | 74 | require base_path('routes/api.php'); |
75 | 75 | }); |
76 | 76 | } |