Completed
Push — master ( df0683...b52746 )
by Karl
06:54
created
app/Jobs/Notifications/GenerateCsv.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         return $this->createCsv($csv, $jobs, $this->id.'.csv');
54 54
     }
55 55
 
56
-    private function createCsv(Writer $csv, array $items = [], $filename = null)
56
+    private function createCsv(Writer $csv, array $items = [ ], $filename = null)
57 57
     {
58 58
         // Make sure line endings are detected.
59 59
         if (!ini_get("auto_detect_line_endings")) {
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         }
72 72
 
73 73
         // Add header rows
74
-        $csv->insertOne(array_keys($items[0]));
74
+        $csv->insertOne(array_keys($items[ 0 ]));
75 75
 
76 76
         // Add each item as a new line to the CSV
77 77
         $csv->insertAll($items);
Please login to merge, or discard this patch.
app/Repositories/Contracts/SearchRepositoryInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 interface SearchRepositoryInterface
4 4
 {
5
-    public function create($userId = null, $data = []);
5
+    public function create($userId = null, $data = [ ]);
6 6
 
7 7
     public function delete($id = null);
8 8
 
Please login to merge, or discard this patch.
routes/web.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     // Submit login form (part 1 of login)
27 27
     Route::post('/login', 'AuthController@login');
28 28
 
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     Route::get('/confirm/{token}', 'AuthController@confirm');
34 34
 });
35 35
 
36
-Route::group(['prefix' => 'users'], function () {
36
+Route::group([ 'prefix' => 'users' ], function() {
37 37
     // Create new user
38 38
     Route::post('/', 'UsersController@create');
39 39
 
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
     Route::get('/{userId}/searches', 'SearchesController@index');
45 45
 });
46 46
 
47
-Route::group(['prefix' => 'searches'], function () {
47
+Route::group([ 'prefix' => 'searches' ], function() {
48 48
     // Unsubscribe by ID
49 49
     Route::get('/{searchId}/unsubscribe', 'SearchesController@unsubscribe');
50 50
 });
51 51
 
52
-Route::group(['prefix' => 'notifications'], function () {
52
+Route::group([ 'prefix' => 'notifications' ], function() {
53 53
     // Get a single notification with jobs
54 54
     Route::get('/{id}', 'NotificationsController@single');
55 55
 
Please login to merge, or discard this patch.
app/Filters/RecruiterFilter.php 2 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php namespace JobApis\JobsToMail\Filters;
2 2
 
3
-use JobApis\Jobs\Client\Job;
4 3
 use JobApis\JobsToMail\Models\Recruiter;
5 4
 use JobApis\JobsToMail\Models\Search;
5
+use JobApis\Jobs\Client\Job;
6 6
 
7 7
 class RecruiterFilter
8 8
 {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
      */
22 22
     public function filter(array $jobs, Search $search)
23 23
     {
24
-        return array_filter($jobs, function (Job $job) use ($search) {
24
+        return array_filter($jobs, function(Job $job) use ($search) {
25 25
             // Make sure this job has a company
26 26
             if (isset($job->company) && $job->company) {
27 27
                 // See if this company is not a recruiter
Please login to merge, or discard this patch.
app/Notifications/Messages/JobMailMessage.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 
6 6
 class JobMailMessage extends MailMessage
7 7
 {
8
-    public $jobListings = [];
8
+    public $jobListings = [ ];
9 9
     public $advertisement = null;
10 10
 
11 11
     /**
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
      */
18 18
     public function listing(Job $job)
19 19
     {
20
-        $this->jobListings[] = [
20
+        $this->jobListings[ ] = [
21 21
             'link' => $job->getUrl(),
22 22
             'title' => $this->getTitle($job->getTitle()),
23 23
             'company' => $this->getCompany($job->getCompanyName(), $job->getIndustry()),
Please login to merge, or discard this patch.
app/Http/Controllers/UsersController.php 1 patch
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php namespace JobApis\JobsToMail\Http\Controllers;
2 2
 
3 3
 use Illuminate\Foundation\Bus\DispatchesJobs;
4
+use Illuminate\Foundation\Validation\ValidatesRequests;
4 5
 use Illuminate\Http\Request;
5 6
 use Illuminate\Routing\Controller as BaseController;
6
-use Illuminate\Foundation\Validation\ValidatesRequests;
7 7
 use JobApis\JobsToMail\Http\Requests\CreateUser;
8 8
 use JobApis\JobsToMail\Jobs\Users\CreateUserAndSearch;
9 9
 use JobApis\JobsToMail\Jobs\Users\Delete;
Please login to merge, or discard this patch.
config/jobboards.php 1 patch
Spacing   +19 added lines, -20 removed lines patch added patch discarded remove patch
@@ -3,10 +3,10 @@  discard block
 block discarded – undo
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,20 +15,19 @@  discard block
 block discarded – undo
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
-    'Github' => [],
27
-    'Govt' => [],
28
-    'Ieee' => [],
29
-    'Jobinventory' => [],
30
-    'Monster' => [],
31
-    'Stackoverflow' => [],
24
+    'Careercast' => [ ],
25
+    'Github' => [ ],
26
+    'Govt' => [ ],
27
+    'Ieee' => [ ],
28
+    'Jobinventory' => [ ],
29
+    'Monster' => [ ],
30
+    'Stackoverflow' => [ ],
32 31
 ];
33 32
 
34 33
 /**
@@ -36,7 +35,7 @@  discard block
 block discarded – undo
36 35
  * http://developer.careerbuilder.com/
37 36
  */
38 37
 if (env("CAREERBUILDER_KEY")) {
39
-    $jobboards['Careerbuilder'] = [
38
+    $jobboards[ 'Careerbuilder' ] = [
40 39
         'DeveloperKey' => env("CAREERBUILDER_KEY"),
41 40
     ];
42 41
 }
@@ -45,7 +44,7 @@  discard block
 block discarded – undo
45 44
  * http://www.careerjet.com/partners/
46 45
  */
47 46
 if (env("CAREERJET_KEY")) {
48
-    $jobboards['Careerjet'] = [
47
+    $jobboards[ 'Careerjet' ] = [
49 48
         'affid' => env("CAREERJET_KEY"),
50 49
     ];
51 50
 }
@@ -54,7 +53,7 @@  discard block
 block discarded – undo
54 53
  * http://www.indeed.com/publisher
55 54
  */
56 55
 if (env("INDEED_KEY")) {
57
-    $jobboards['Indeed'] = [
56
+    $jobboards[ 'Indeed' ] = [
58 57
         'publisher' => env("INDEED_KEY"),
59 58
         'userip' => $currentIp,
60 59
         'useragent' => $userAgent,
@@ -65,7 +64,7 @@  discard block
 block discarded – undo
65 64
  * https://developer.usajobs.gov/Search-API/Overview
66 65
  */
67 66
 if (env("USAJOBS_KEY")) {
68
-    $jobboards['Usajobs'] = [
67
+    $jobboards[ 'Usajobs' ] = [
69 68
         'AuthorizationKey' => env("USAJOBS_KEY"),
70 69
     ];
71 70
 }
@@ -74,7 +73,7 @@  discard block
 block discarded – undo
74 73
  * http://www.juju.com/publisher/spec/
75 74
  */
76 75
 if (env("JUJU_KEY")) {
77
-    $jobboards['Juju'] = [
76
+    $jobboards[ 'Juju' ] = [
78 77
         'partnerid' => env("JUJU_KEY"),
79 78
         'ipaddress' => $currentIp,
80 79
         'useragent' => $userAgent,
@@ -86,7 +85,7 @@  discard block
 block discarded – undo
86 85
  * https://www.ziprecruiter.com/publishers
87 86
  */
88 87
 if (env("ZIPRECRUITER_KEY")) {
89
-    $jobboards['Ziprecruiter'] = [
88
+    $jobboards[ 'Ziprecruiter' ] = [
90 89
         'api_key' => env("ZIPRECRUITER_KEY"),
91 90
     ];
92 91
 }
@@ -95,7 +94,7 @@  discard block
 block discarded – undo
95 94
  * https://www2.jobs2careers.com/advertiser.php
96 95
  */
97 96
 if (env("J2C_ID") && env("J2C_PASS")) {
98
-    $jobboards['J2c'] = [
97
+    $jobboards[ 'J2c' ] = [
99 98
         'id' => env("J2C_ID"),
100 99
         'pass' => env("J2C_PASS"),
101 100
     ];
Please login to merge, or discard this patch.
database/migrations/2017_12_30_150223_add_max_searches_to_users.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::table('users', function (Blueprint $table) {
16
+        Schema::table('users', function(Blueprint $table) {
17 17
             $table->integer('max_searches')->default(config('app.max_searches'))->nullable();
18 18
         });
19 19
     }
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public function down()
27 27
     {
28
-        Schema::table('users', function (Blueprint $table) {
28
+        Schema::table('users', function(Blueprint $table) {
29 29
             $table->dropColumn('max_searches');
30 30
         });
31 31
     }
Please login to merge, or discard this patch.
database/factories/NotificationFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 $notificationClass = \JobApis\JobsToMail\Models\CustomDatabaseNotification::class;
9 9
 $dataJson = json_decode('[{"url":"http://example.com/","name":"Technical Workforce Recruiter","query":"DevOps","title":"Technical Workforce Recruiter","skills":null,"source":"Careerjet","company":"AE Business Solutions","endDate":null,"industry":null,"location":"Madison, WI","sourceId":null,"startDate":null,"workHours":null,"baseSalary":null,"datePosted":"2017-12-22","description":" to Have:   Bachelors degree or higher.  Experience recruiting candidates with technical skill sets such as Cloud Architects","jobBenefits":null,"jobLocation":null,"alternateName":null,"maximumSalary":null,"minimumSalary":null,"employmentType":null,"qualifications":null,"salaryCurrency":null,"javascriptAction":null,"responsibilities":null,"hiringOrganization":{"url":null,"logo":null,"name":"AE Business Solutions","email":null,"address":null,"telephone":null,"description":null,"alternateName":null},"javascriptFunction":null,"specialCommitments":null,"occupationalCategory":null,"educationRequirements":null,"incentiveCompensation":null,"experienceRequirements":null}]');
10 10
 
11
-$factory->define($notificationClass, function (Faker\Generator $faker) use ($dataJson) {
11
+$factory->define($notificationClass, function(Faker\Generator $faker) use ($dataJson) {
12 12
     return [
13 13
         'id' => $faker->uuid(),
14 14
         'type' => 'JobApis\JobsToMail\Notifications\JobsCollected',
Please login to merge, or discard this patch.