@@ -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 |
@@ -1,20 +1,20 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (! empty($greeting)) { |
|
| 3 | +if (!empty($greeting)) { |
|
| 4 | 4 | echo $greeting, "\n\n"; |
| 5 | 5 | } else { |
| 6 | 6 | echo $level == 'error' ? 'Whoops!' : 'Hello!', "\n\n"; |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -if (! empty($introLines)) { |
|
| 9 | +if (!empty($introLines)) { |
|
| 10 | 10 | echo implode("\n", $introLines), "\n\n"; |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | if (isset($jobListings)) { |
| 14 | 14 | foreach ($jobListings as $listing) { |
| 15 | - echo $listing['title'].$listing['company'].$listing['location'].": ".$listing['link'], "\n"; |
|
| 16 | - if ($listing['date']) { |
|
| 17 | - echo "Posted on {$listing['date']}", "\n\n"; |
|
| 15 | + echo $listing[ 'title' ].$listing[ 'company' ].$listing[ 'location' ].": ".$listing[ 'link' ], "\n"; |
|
| 16 | + if ($listing[ 'date' ]) { |
|
| 17 | + echo "Posted on {$listing[ 'date' ]}", "\n\n"; |
|
| 18 | 18 | } |
| 19 | 19 | } |
| 20 | 20 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | echo "{$actionText}: {$actionUrl}", "\n\n"; |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | -if (! empty($outroLines)) { |
|
| 26 | +if (!empty($outroLines)) { |
|
| 27 | 27 | echo implode("\n", $outroLines), "\n\n"; |
| 28 | 28 | } |
| 29 | 29 | |
@@ -3,10 +3,10 @@ discard block |
||
| 3 | 3 | /** |
| 4 | 4 | * Makes a best guess at the server's IP defaulting to localhost. |
| 5 | 5 | */ |
| 6 | -if (isset($_SERVER['REMOTE_ADDR'])) { |
|
| 7 | - $currentIp = $_SERVER['REMOTE_ADDR']; |
|
| 8 | -} elseif (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) { |
|
| 9 | - $ipAddresses = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); |
|
| 6 | +if (isset($_SERVER[ 'REMOTE_ADDR' ])) { |
|
| 7 | + $currentIp = $_SERVER[ 'REMOTE_ADDR' ]; |
|
| 8 | +} elseif (isset($_SERVER[ "HTTP_X_FORWARDED_FOR" ])) { |
|
| 9 | + $ipAddresses = explode(',', $_SERVER[ 'HTTP_X_FORWARDED_FOR' ]); |
|
| 10 | 10 | $currentIp = trim(end($ipAddresses)); |
| 11 | 11 | } else { |
| 12 | 12 | $currentIp = '127.0.0.1'; |
@@ -15,18 +15,17 @@ discard block |
||
| 15 | 15 | /** |
| 16 | 16 | * Makes a best guess at the user agent making this request |
| 17 | 17 | */ |
| 18 | -$userAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : |
|
| 19 | - 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36'; |
|
| 18 | +$userAgent = isset($_SERVER[ 'HTTP_USER_AGENT' ]) ? $_SERVER[ 'HTTP_USER_AGENT' ] : 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36'; |
|
| 20 | 19 | |
| 21 | 20 | /** |
| 22 | 21 | * Default job boards that require no API key permissions |
| 23 | 22 | */ |
| 24 | 23 | $jobboards = [ |
| 25 | - 'Careercast' => [], |
|
| 26 | - 'Dice' => [], |
|
| 27 | - 'Github' => [], |
|
| 28 | - 'Govt' => [], |
|
| 29 | - 'Jobinventory' => [], |
|
| 24 | + 'Careercast' => [ ], |
|
| 25 | + 'Dice' => [ ], |
|
| 26 | + 'Github' => [ ], |
|
| 27 | + 'Govt' => [ ], |
|
| 28 | + 'Jobinventory' => [ ], |
|
| 30 | 29 | ]; |
| 31 | 30 | |
| 32 | 31 | /** |
@@ -34,7 +33,7 @@ discard block |
||
| 34 | 33 | * http://developer.careerbuilder.com/ |
| 35 | 34 | */ |
| 36 | 35 | if (env("CAREERBUILDER_KEY")) { |
| 37 | - $jobboards['Careerbuilder'] = [ |
|
| 36 | + $jobboards[ 'Careerbuilder' ] = [ |
|
| 38 | 37 | 'DeveloperKey' => env("CAREERBUILDER_KEY"), |
| 39 | 38 | ]; |
| 40 | 39 | } |
@@ -43,7 +42,7 @@ discard block |
||
| 43 | 42 | * http://www.indeed.com/publisher |
| 44 | 43 | */ |
| 45 | 44 | if (env("INDEED_KEY")) { |
| 46 | - $jobboards['Indeed'] = [ |
|
| 45 | + $jobboards[ 'Indeed' ] = [ |
|
| 47 | 46 | 'publisher' => env("INDEED_KEY"), |
| 48 | 47 | 'userip' => $currentIp, |
| 49 | 48 | 'useragent' => $userAgent, |
@@ -54,7 +53,7 @@ discard block |
||
| 54 | 53 | * https://developer.usajobs.gov/Search-API/Overview |
| 55 | 54 | */ |
| 56 | 55 | if (env("USAJOBS_KEY")) { |
| 57 | - $jobboards['Usajobs'] = [ |
|
| 56 | + $jobboards[ 'Usajobs' ] = [ |
|
| 58 | 57 | 'AuthorizationKey' => env("USAJOBS_KEY"), |
| 59 | 58 | ]; |
| 60 | 59 | } |
@@ -63,7 +62,7 @@ discard block |
||
| 63 | 62 | * http://www.juju.com/publisher/spec/ |
| 64 | 63 | */ |
| 65 | 64 | if (env("JUJU_KEY")) { |
| 66 | - $jobboards['Juju'] = [ |
|
| 65 | + $jobboards[ 'Juju' ] = [ |
|
| 67 | 66 | 'partnerid' => env("JUJU_KEY"), |
| 68 | 67 | 'ipaddress' => $currentIp, |
| 69 | 68 | 'useragent' => $userAgent, |
@@ -75,7 +74,7 @@ discard block |
||
| 75 | 74 | * https://www.ziprecruiter.com/publishers |
| 76 | 75 | */ |
| 77 | 76 | if (env("ZIPRECRUITER_KEY")) { |
| 78 | - $jobboards['Ziprecruiter'] = [ |
|
| 77 | + $jobboards[ 'Ziprecruiter' ] = [ |
|
| 79 | 78 | 'api_key' => env("ZIPRECRUITER_KEY"), |
| 80 | 79 | ]; |
| 81 | 80 | } |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php namespace JobApis\JobsToMail\Http\Controllers; |
| 2 | 2 | |
| 3 | +use Illuminate\Foundation\Validation\ValidatesRequests; |
|
| 3 | 4 | use Illuminate\Http\Request; |
| 4 | 5 | use Illuminate\Routing\Controller as BaseController; |
| 5 | -use Illuminate\Foundation\Validation\ValidatesRequests; |
|
| 6 | 6 | use JobApis\JobsToMail\Http\Requests\CreateUser; |
| 7 | 7 | use JobApis\JobsToMail\Repositories\Contracts\UserRepositoryInterface; |
| 8 | 8 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public function login(LoginUser $request) |
| 35 | 35 | { |
| 36 | - $email = $request->only('email')['email']; |
|
| 36 | + $email = $request->only('email')[ 'email' ]; |
|
| 37 | 37 | |
| 38 | 38 | $message = $this->dispatchNow(new SendLoginMessage($email)); |
| 39 | 39 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | public function postConfirm(Request $request) |
| 61 | 61 | { |
| 62 | - return $this->confirm($request, $request->only('token')['token']); |
|
| 62 | + return $this->confirm($request, $request->only('token')[ 'token' ]); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
@@ -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 | { |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php namespace JobApis\JobsToMail\Notifications; |
| 2 | 2 | |
| 3 | 3 | use Illuminate\Bus\Queueable; |
| 4 | -use Illuminate\Notifications\Notification; |
|
| 5 | 4 | use Illuminate\Contracts\Queue\ShouldQueue; |
| 6 | 5 | use Illuminate\Notifications\Messages\MailMessage; |
| 6 | +use Illuminate\Notifications\Notification; |
|
| 7 | 7 | use JobApis\JobsToMail\Models\Token; |
| 8 | 8 | |
| 9 | 9 | class TokenGenerated extends Notification implements ShouldQueue |
@@ -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.') |
@@ -1,12 +1,12 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | // Homepage |
| 4 | -Route::get('/', function () { |
|
| 4 | +Route::get('/', function() { |
|
| 5 | 5 | return view('users.index'); |
| 6 | 6 | }); |
| 7 | 7 | |
| 8 | 8 | // Terms page |
| 9 | -Route::get('/terms', function () { |
|
| 9 | +Route::get('/terms', function() { |
|
| 10 | 10 | return view('static.terms'); |
| 11 | 11 | }); |
| 12 | 12 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | // Current User Account page |
| 23 | 23 | Route::get('/searches', 'SearchesController@index')->middleware('auth'); |
| 24 | 24 | |
| 25 | -Route::group(['prefix' => 'auth'], function () { |
|
| 25 | +Route::group([ 'prefix' => 'auth' ], function() { |
|
| 26 | 26 | |
| 27 | 27 | // Submit login form (part 1 of login) |
| 28 | 28 | Route::post('/login', 'AuthController@login'); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | Route::get('/confirm/{token}', 'AuthController@confirm'); |
| 35 | 35 | }); |
| 36 | 36 | |
| 37 | -Route::group(['prefix' => 'users'], function () { |
|
| 37 | +Route::group([ 'prefix' => 'users' ], function() { |
|
| 38 | 38 | |
| 39 | 39 | // Create new user |
| 40 | 40 | Route::post('/', 'UsersController@create'); |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | Route::get('/{userId}/searches', 'SearchesController@index'); |
| 47 | 47 | }); |
| 48 | 48 | |
| 49 | -Route::group(['prefix' => 'searches'], function () { |
|
| 49 | +Route::group([ 'prefix' => 'searches' ], function() { |
|
| 50 | 50 | |
| 51 | 51 | // Unsubscribe by ID |
| 52 | 52 | Route::get('/{searchId}/unsubscribe', 'SearchesController@unsubscribe'); |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | $results = $this->dispatchNow(new GetUserSearches($userId)); |
| 69 | 69 | |
| 70 | 70 | if (!$results->isEmpty()) { |
| 71 | - return view('searches.index', ['searches' => $results]); |
|
| 71 | + return view('searches.index', [ 'searches' => $results ]); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | return redirect('/'); |