Passed
Push — develop ( 44d758...b434f0 )
by Adam
18:36 queued 10:29
created
app/Console/Commands/ImportOldData.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -50,14 +50,14 @@  discard block
 block discarded – undo
50 50
         $tenant = Tenant::find($tenantId);
51 51
 
52 52
         if (!$tenant) {
53
-            throw new RuntimeException('Tenant with ID = '.$tenantId.' does not exist.');
53
+            throw new RuntimeException('Tenant with ID = ' . $tenantId . ' does not exist.');
54 54
         }
55 55
 
56 56
         if (!$this->confirm('Do you REALLY WANT to run import legacy data?')) {
57 57
             return;
58 58
         }
59 59
 
60
-        if (!$this->confirm('It will ERASE ALL current data for ::'.$tenant->subdomain.':: tenant. Are you sure?')) {
60
+        if (!$this->confirm('It will ERASE ALL current data for ::' . $tenant->subdomain . ':: tenant. Are you sure?')) {
61 61
             return;
62 62
         }
63 63
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         DB::connection('tenant')->delete('DELETE FROM user_invitations');
77 77
         DB::connection('tenant')->delete('DELETE FROM users');
78 78
 
79
-        DB::connection()->delete('DELETE FROM tenant_users WHERE tenant_id='.$tenant->id);
79
+        DB::connection()->delete('DELETE FROM tenant_users WHERE tenant_id=' . $tenant->id);
80 80
 
81 81
         DB::connection('tenant')->statement('ALTER TABLE sources AUTO_INCREMENT = 1;');
82 82
         DB::connection('tenant')->statement('ALTER TABLE notes AUTO_INCREMENT = 1;');
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
                 $stageId++;
205 205
             }
206 206
 
207
-            $fields = json_decode(file_get_contents(base_path().'/database/seeds/form_fields.json'), true);
207
+            $fields = json_decode(file_get_contents(base_path() . '/database/seeds/form_fields.json'), true);
208 208
             $now = \Carbon\Carbon::now()->toDateTimeString();
209 209
 
210 210
             foreach ($fields as $field) {
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
                 ]);
222 222
             }
223 223
 
224
-            $messages = json_decode(file_get_contents(base_path().'/database/seeds/predefined_messages.json'), true);
224
+            $messages = json_decode(file_get_contents(base_path() . '/database/seeds/predefined_messages.json'), true);
225 225
 
226 226
             foreach ($messages as $message) {
227 227
                 $from_stage_id = null;
@@ -270,10 +270,10 @@  discard block
 block discarded – undo
270 270
 
271 271
         $candidates = DB::connection('legacy')->select('SELECT * FROM candidates');
272 272
         foreach ($candidates as $candidate) {
273
-            $customFields = '[{"id": 0, "label": "Informacje dodatkowe", "value": '.json_encode($candidate->additional_info).'}]';
273
+            $customFields = '[{"id": 0, "label": "Informacje dodatkowe", "value": ' . json_encode($candidate->additional_info) . '}]';
274 274
             $seenAt = $candidate->stage_id != 1 ? $candidate->created_at : null;
275 275
 
276
-            $pathToCV = 'kissdigital/'.$candidate->path_to_cv;
276
+            $pathToCV = 'kissdigital/' . $candidate->path_to_cv;
277 277
 
278 278
             $stageId = 0;
279 279
 
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
                     $candidate->id,
324 324
                     $candidate->created_at,
325 325
                     $candidate->updated_at,
326
-                    $candidate->first_name.' '.$candidate->last_name,
326
+                    $candidate->first_name . ' ' . $candidate->last_name,
327 327
                     $candidate->email,
328 328
                     $candidate->phone_number,
329 329
                     $candidate->future_agreement,
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 
374 374
         $messages = DB::connection('legacy')->select('SELECT * FROM messages');
375 375
         foreach ($messages as $message) {
376
-            $candidate = DB::connection('tenant')->select('SELECT * FROM candidates WHERE `id`='.$message->candidate_id);
376
+            $candidate = DB::connection('tenant')->select('SELECT * FROM candidates WHERE `id`=' . $message->candidate_id);
377 377
             DB::connection('tenant')->insert(
378 378
                 'INSERT INTO messages (id, created_at, updated_at, `type`, candidate_id,
379 379
                 `subject`, `body`, `scheduled_for`, `sent_at`, `to`)
@@ -393,6 +393,6 @@  discard block
 block discarded – undo
393 393
             );
394 394
         }
395 395
 
396
-        $this->info('Legacy data have been imported for tenant with subdomain \''.$tenant->subdomain.'\'.');
396
+        $this->info('Legacy data have been imported for tenant with subdomain \'' . $tenant->subdomain . '\'.');
397 397
     }
398 398
 }
Please login to merge, or discard this patch.
app/Console/Commands/CreateTenantUser.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
         $tenant = Tenant::find($tenantId);
54 54
 
55 55
         if (!$tenant) {
56
-            throw new RuntimeException('Tenant with ID = '.$tenantId.' does not exist.');
56
+            throw new RuntimeException('Tenant with ID = ' . $tenantId . ' does not exist.');
57 57
         }
58 58
 
59
-        $this->comment('Creating new user for tenant with subdomain \''.$tenant->subdomain.'\'.');
59
+        $this->comment('Creating new user for tenant with subdomain \'' . $tenant->subdomain . '\'.');
60 60
 
61 61
         $email = $this->option('email');
62 62
         if (!$email) {
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 
66 66
         $num = TenantUser::where('username', $email)->count();
67 67
         if ($num) {
68
-            throw new RuntimeException('User with email \''.$email.'\' already exists.');
68
+            throw new RuntimeException('User with email \'' . $email . '\' already exists.');
69 69
         }
70 70
 
71 71
         $name = $this->option('name');
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
 
91 91
         $user->assignRole('super-admin');
92 92
 
93
-        DB::transaction(function () use ($tenantUser, $user) {
93
+        DB::transaction(function() use ($tenantUser, $user) {
94 94
             $tenantUser->save();
95 95
             $user->save();
96 96
         });
97 97
 
98
-        $this->comment('Created user with username \''.$user->email.'\'.');
98
+        $this->comment('Created user with username \'' . $user->email . '\'.');
99 99
     }
100 100
 }
Please login to merge, or discard this patch.
app/Console/Commands/ExtractPhotos.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         $tenant = Tenant::find($tenantId);
51 51
 
52 52
         if (!$tenant) {
53
-            throw new RuntimeException('Tenant with ID = '.$tenantId.' does not exist.');
53
+            throw new RuntimeException('Tenant with ID = ' . $tenantId . ' does not exist.');
54 54
         }
55 55
 
56 56
         $this->tenantManager->setTenant($tenant);
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $candidates = Candidate::whereNull('photo_extraction')->where('path_to_cv', '<>', '')->get();
60 60
 
61 61
         foreach ($candidates as $candidate) {
62
-            $this->info('Parsing candidate id '.$candidate->id);
62
+            $this->info('Parsing candidate id ' . $candidate->id);
63 63
             ProcessResume::dispatchNow($candidate);
64 64
             gc_collect_cycles();
65 65
         }
Please login to merge, or discard this patch.
app/Console/Commands/TenantSeed.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         $tenant = Tenant::find($tenantId);
49 49
 
50 50
         if (!$tenant) {
51
-            throw new RuntimeException('Tenant with ID = '.$tenantId.' does not exist.');
51
+            throw new RuntimeException('Tenant with ID = ' . $tenantId . ' does not exist.');
52 52
         }
53 53
 
54 54
         $this->tenantManager->setTenant($tenant);
@@ -57,6 +57,6 @@  discard block
 block discarded – undo
57 57
         $seeder = new \RolesAndPermissionsSeeder('tenant');
58 58
         $seeder->run(null);
59 59
 
60
-        $this->info('Data have been seeded for tenant with subdomain \''.$tenant->subdomain.'\'.');
60
+        $this->info('Data have been seeded for tenant with subdomain \'' . $tenant->subdomain . '\'.');
61 61
     }
62 62
 }
Please login to merge, or discard this patch.
app/Http/Controllers/CandidatesController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
         if (!$user->can('read all recruitments')) {
63 63
             $filtered = $candidates->filter(
64
-                function ($candidate, $key) use ($user) {
64
+                function($candidate, $key) use ($user) {
65 65
                     return $user->can('view', $candidate);
66 66
                 }
67 67
             );
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     {
96 96
         $candidate = CandidateUpdater::updateCandidate($candidate->id, $request);
97 97
 
98
-        return response()->json($candidate, 200, ['Location' => '/candidates/'.$candidate->id]);
98
+        return response()->json($candidate, 200, ['Location' => '/candidates/' . $candidate->id]);
99 99
     }
100 100
 
101 101
     public function delete(CandidateDeleteRequest $request, Candidate $candidate)
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             $candidate->save();
113 113
         }
114 114
 
115
-        return response()->json($candidate, 200, ['Location' => '/candidates/'.$candidate->id]);
115
+        return response()->json($candidate, 200, ['Location' => '/candidates/' . $candidate->id]);
116 116
     }
117 117
 
118 118
     //TODO: route nie chroniony - docelowo zrobić zabezpieczenie z użyciem jednorazowych tokenów, a także nie przekazywać do klienta pola path_to_cv
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
             return response('File not found', 404);
126 126
         }
127 127
 
128
-        $fileName = str_replace(' ', '_', $candidate->name).'-CV.pdf'; //TODO sanitize
128
+        $fileName = str_replace(' ', '_', $candidate->name) . '-CV.pdf'; //TODO sanitize
129 129
 
130 130
         if ($download) {
131 131
             return Storage::disk('s3')->download($candidate->path_to_cv, $fileName);
@@ -138,6 +138,6 @@  discard block
 block discarded – undo
138 138
     {
139 139
         $candidate = StageChanger::changeStage($request);
140 140
 
141
-        return response()->json($candidate, 200, ['Location' => '/candidates/'.$candidate->id]);
141
+        return response()->json($candidate, 200, ['Location' => '/candidates/' . $candidate->id]);
142 142
     }
143 143
 }
Please login to merge, or discard this patch.