@@ -100,7 +100,6 @@ |
||
| 100 | 100 | /** |
| 101 | 101 | * Logs all the errors attached to a collection |
| 102 | 102 | * |
| 103 | - * @param array $jobsByProvider |
|
| 104 | 103 | * |
| 105 | 104 | * @return void |
| 106 | 105 | */ |
@@ -77,12 +77,12 @@ discard block |
||
| 77 | 77 | * |
| 78 | 78 | * @return array |
| 79 | 79 | */ |
| 80 | - protected function getJobsFromCollections($collectionsArray = []) |
|
| 80 | + protected function getJobsFromCollections($collectionsArray = [ ]) |
|
| 81 | 81 | { |
| 82 | - $jobs = []; |
|
| 82 | + $jobs = [ ]; |
|
| 83 | 83 | array_walk_recursive( |
| 84 | 84 | $collectionsArray, |
| 85 | - function (Collection $collection) use (&$jobs) { |
|
| 85 | + function(Collection $collection) use (&$jobs) { |
|
| 86 | 86 | $this->logErrorsFromCollection($collection); |
| 87 | 87 | $jobListings = array_slice( |
| 88 | 88 | $collection->all(), |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | self::MAX_JOBS_FROM_PROVIDER |
| 91 | 91 | ); |
| 92 | 92 | foreach ($jobListings as $jobListing) { |
| 93 | - $jobs[] = $jobListing; |
|
| 93 | + $jobs[ ] = $jobListing; |
|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | ); |
@@ -120,14 +120,14 @@ discard block |
||
| 120 | 120 | * |
| 121 | 121 | * @return array |
| 122 | 122 | */ |
| 123 | - protected function sortJobs($jobs = []) |
|
| 123 | + protected function sortJobs($jobs = [ ]) |
|
| 124 | 124 | { |
| 125 | 125 | // Sort by date |
| 126 | - usort($jobs, function ($item1, $item2) { |
|
| 126 | + usort($jobs, function($item1, $item2) { |
|
| 127 | 127 | return $item2->datePosted <=> $item1->datePosted; |
| 128 | 128 | }); |
| 129 | 129 | // Filter any older than max age |
| 130 | - $jobs = array_filter($jobs, function ($job) { |
|
| 130 | + $jobs = array_filter($jobs, function($job) { |
|
| 131 | 131 | return $job->datePosted > new \DateTime(self::MAX_DAYS_OLD.' days ago'); |
| 132 | 132 | }); |
| 133 | 133 | // Truncate to the max number of results |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | use Faker\Factory as Faker; |
| 4 | 4 | use Illuminate\Database\Seeder; |
| 5 | -use JobApis\JobsToMail\Models\User; |
|
| 6 | 5 | use JobApis\JobsToMail\Models\Token; |
| 6 | +use JobApis\JobsToMail\Models\User; |
|
| 7 | 7 | |
| 8 | 8 | class TestingDatabaseSeeder extends Seeder |
| 9 | 9 | { |
@@ -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,17 +15,16 @@ 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' => [], |
|
| 24 | + 'Careercast' => [ ], |
|
| 25 | + 'Dice' => [ ], |
|
| 26 | + 'Github' => [ ], |
|
| 27 | + 'Govt' => [ ], |
|
| 29 | 28 | ]; |
| 30 | 29 | |
| 31 | 30 | /** |
@@ -33,7 +32,7 @@ discard block |
||
| 33 | 32 | * http://developer.careerbuilder.com/ |
| 34 | 33 | */ |
| 35 | 34 | if (env("CAREERBUILDER_KEY")) { |
| 36 | - $jobboards['Careerbuilder'] = [ |
|
| 35 | + $jobboards[ 'Careerbuilder' ] = [ |
|
| 37 | 36 | 'DeveloperKey' => env("CAREERBUILDER_KEY"), |
| 38 | 37 | ]; |
| 39 | 38 | } |
@@ -42,7 +41,7 @@ discard block |
||
| 42 | 41 | * http://www.indeed.com/publisher |
| 43 | 42 | */ |
| 44 | 43 | if (env("INDEED_KEY")) { |
| 45 | - $jobboards['Indeed'] = [ |
|
| 44 | + $jobboards[ 'Indeed' ] = [ |
|
| 46 | 45 | 'publisher' => env("INDEED_KEY"), |
| 47 | 46 | 'userip' => $currentIp, |
| 48 | 47 | 'useragent' => $userAgent, |
@@ -53,7 +52,7 @@ discard block |
||
| 53 | 52 | * https://developer.usajobs.gov/Search-API/Overview |
| 54 | 53 | */ |
| 55 | 54 | if (env("USAJOBS_KEY")) { |
| 56 | - $jobboards['Usajobs'] = [ |
|
| 55 | + $jobboards[ 'Usajobs' ] = [ |
|
| 57 | 56 | 'AuthorizationKey' => env("USAJOBS_KEY"), |
| 58 | 57 | ]; |
| 59 | 58 | } |
@@ -62,7 +61,7 @@ discard block |
||
| 62 | 61 | * http://www.juju.com/publisher/spec/ |
| 63 | 62 | */ |
| 64 | 63 | if (env("JUJU_KEY")) { |
| 65 | - $jobboards['Juju'] = [ |
|
| 64 | + $jobboards[ 'Juju' ] = [ |
|
| 66 | 65 | 'partnerid' => env("JUJU_KEY"), |
| 67 | 66 | 'ipaddress' => $currentIp, |
| 68 | 67 | 'useragent' => $userAgent, |
@@ -74,7 +73,7 @@ discard block |
||
| 74 | 73 | * https://www.ziprecruiter.com/publishers |
| 75 | 74 | */ |
| 76 | 75 | if (env("ZIPRECRUITER_KEY")) { |
| 77 | - $jobboards['Ziprecruiter'] = [ |
|
| 76 | + $jobboards[ 'Ziprecruiter' ] = [ |
|
| 78 | 77 | 'api_key' => env("ZIPRECRUITER_KEY"), |
| 79 | 78 | ]; |
| 80 | 79 | } |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | |-------------------------------------------------------------------------- |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -$factory->define(\JobApis\JobsToMail\Models\Token::class, function (Faker\Generator $faker) { |
|
| 9 | +$factory->define(\JobApis\JobsToMail\Models\Token::class, function(Faker\Generator $faker) { |
|
| 10 | 10 | return [ |
| 11 | 11 | 'user_id' => null, |
| 12 | 12 | 'type' => 'confirm', |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | |-------------------------------------------------------------------------- |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -$factory->define(\JobApis\JobsToMail\Models\User::class, function (Faker\Generator $faker) { |
|
| 9 | +$factory->define(\JobApis\JobsToMail\Models\User::class, function(Faker\Generator $faker) { |
|
| 10 | 10 | return [ |
| 11 | 11 | 'email' => $faker->safeEmail(), |
| 12 | 12 | 'keyword' => $faker->word(), |
@@ -14,12 +14,12 @@ discard block |
||
| 14 | 14 | 'confirmed_at' => null, |
| 15 | 15 | ]; |
| 16 | 16 | }); |
| 17 | -$factory->state(\JobApis\JobsToMail\Models\User::class, 'active', function (Faker\Generator $faker) { |
|
| 17 | +$factory->state(\JobApis\JobsToMail\Models\User::class, 'active', function(Faker\Generator $faker) { |
|
| 18 | 18 | return [ |
| 19 | 19 | 'confirmed_at' => $faker->dateTimeThisYear(), |
| 20 | 20 | ]; |
| 21 | 21 | }); |
| 22 | -$factory->state(\JobApis\JobsToMail\Models\User::class, 'deleted', function (Faker\Generator $faker) { |
|
| 22 | +$factory->state(\JobApis\JobsToMail\Models\User::class, 'deleted', function(Faker\Generator $faker) { |
|
| 23 | 23 | return [ |
| 24 | 24 | 'deleted_at' => $faker->dateTimeThisYear(), |
| 25 | 25 | ]; |