@@ -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'); |
@@ -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 |
@@ -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 | ); |
@@ -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 | } |