Passed
Push — feature/hr-portal ( ae4ab3...ab04c7 )
by Chris
12:13 queued 11s
created
app/Http/Controllers/Auth/FirstVisitController.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -21,15 +21,15 @@  discard block
 block discarded – undo
21 21
     public function showFirstVisitManagerForm()
22 22
     {
23 23
         $routes = [
24
-            'return' => route('home'),
25
-            'continue' => route('manager.finish_registration'),
24
+            'return' => route ('home'),
25
+            'continue' => route ('manager.finish_registration'),
26 26
         ];
27 27
 
28
-        return view('auth.first_visit_manager', [
28
+        return view ('auth.first_visit_manager', [
29 29
             'routes' => $routes,
30
-            'first_visit' => Lang::get('common/auth/first_manager_visit'),
31
-            'departments' => Department::all(),
32
-            'not_in_gov_option' => ['value' => 0, 'name' => Lang::get('common/auth/register.not_in_gov')],
30
+            'first_visit' => Lang::get ('common/auth/first_manager_visit'),
31
+            'departments' => Department::all (),
32
+            'not_in_gov_option' => ['value' => 0, 'name' => Lang::get ('common/auth/register.not_in_gov')],
33 33
         ]);
34 34
     }
35 35
 
@@ -41,35 +41,35 @@  discard block
 block discarded – undo
41 41
      */
42 42
     public function finishManagerRegistration(Request $request)
43 43
     {
44
-        $data = $request->all();
45
-        $validator = RegistrationValidator::finalizeManagerValidator($data);
46
-        $validator->validate();
44
+        $data = $request->all ();
45
+        $validator = RegistrationValidator::finalizeManagerValidator ($data);
46
+        $validator->validate ();
47 47
 
48
-        $user = $request->user();
48
+        $user = $request->user ();
49 49
 
50 50
         // Save manager specific fields to user
51
-        $managerDepartment = Department::find($data['department']);
51
+        $managerDepartment = Department::find ($data['department']);
52 52
         $inGovernment = ($managerDepartment !== null);
53 53
         $user->not_in_gov = !$inGovernment;
54 54
         $user->gov_email = $inGovernment ? $data['gov_email'] : null;
55
-        $user->save();
56
-        $user->refresh();
55
+        $user->save ();
56
+        $user->refresh ();
57 57
 
58 58
         // Add (or update) manager profile
59 59
         // NOTE: modifying a field in $user, and saving it, appears to create Manager object. I don't know how. -- Tristan
60 60
         // That means that after setting not_in_gov or gov_email, a manager already exists here. Adding a new one will throw an exception.
61 61
         $department_id = $inGovernment ? $managerDepartment->id : null;
62 62
         if ($user->manager === null) {
63
-            $user->applicant()->save(new Manager());
64
-            $user->refresh();
63
+            $user->applicant ()->save (new Manager ());
64
+            $user->refresh ();
65 65
         }
66 66
         $user->manager->department_id = $department_id;
67
-        $user->manager->save();
67
+        $user->manager->save ();
68 68
 
69
-        $user->refresh();
70
-        $expectedUrl = session()->remove('url.expected');
71
-        session()->remove('url.expected');
72
-        return redirect($expectedUrl);
69
+        $user->refresh ();
70
+        $expectedUrl = session ()->remove ('url.expected');
71
+        session ()->remove ('url.expected');
72
+        return redirect ($expectedUrl);
73 73
     }
74 74
 
75 75
     /**
@@ -80,15 +80,15 @@  discard block
 block discarded – undo
80 80
     public function showFirstVisitHrForm()
81 81
     {
82 82
         $routes = [
83
-            'return' => route('hr_advisor.home'),
84
-            'continue' => route('hr_advisor.finish_registration'),
83
+            'return' => route ('hr_advisor.home'),
84
+            'continue' => route ('hr_advisor.finish_registration'),
85 85
         ];
86 86
 
87
-        return view('auth.first_visit_manager', [
87
+        return view ('auth.first_visit_manager', [
88 88
             'routes' => $routes,
89
-            'first_visit' => Lang::get('common/auth/first_hr_visit'),
90
-            'departments' => Department::all(),
91
-            'not_in_gov_option' => ['value' => 0, 'name' => Lang::get('common/auth/register.not_in_gov')],
89
+            'first_visit' => Lang::get ('common/auth/first_hr_visit'),
90
+            'departments' => Department::all (),
91
+            'not_in_gov_option' => ['value' => 0, 'name' => Lang::get ('common/auth/register.not_in_gov')],
92 92
         ]);
93 93
     }
94 94
 
@@ -100,31 +100,31 @@  discard block
 block discarded – undo
100 100
      */
101 101
     public function finishHrRegistration(Request $request)
102 102
     {
103
-        $data = $request->all();
104
-        $validator = RegistrationValidator::finalizeManagerValidator($data);
105
-        $validator->validate();
103
+        $data = $request->all ();
104
+        $validator = RegistrationValidator::finalizeManagerValidator ($data);
105
+        $validator->validate ();
106 106
 
107
-        $user = $request->user();
107
+        $user = $request->user ();
108 108
 
109 109
         // Save manager specific fields to user
110
-        $hrDepartment = Department::find($data['department']);
110
+        $hrDepartment = Department::find ($data['department']);
111 111
         $inGovernment = ($hrDepartment !== null);
112 112
         $user->not_in_gov = !$inGovernment;
113 113
         $user->gov_email = $inGovernment ? $data['gov_email'] : null;
114 114
 
115
-        $user->save();
116
-        $user->refresh();
115
+        $user->save ();
116
+        $user->refresh ();
117 117
 
118 118
         $department_id = $inGovernment ? $hrDepartment->id : null;
119 119
         if ($user->hr_advisor === null) {
120
-            $user->hr_advisor()->save(new HrAdvisor());
121
-            $user->refresh();
120
+            $user->hr_advisor ()->save (new HrAdvisor ());
121
+            $user->refresh ();
122 122
         }
123 123
         $user->hr_advisor->department_id = $department_id;
124 124
         $user->hr_advisor->user_id === $user->id;
125
-        $user->hr_advisor->save();
125
+        $user->hr_advisor->save ();
126 126
 
127
-        $user->refresh();
128
-        return redirect(route('hr_advisor.home'));
127
+        $user->refresh ();
128
+        return redirect (route ('hr_advisor.home'));
129 129
     }
130 130
 }
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/RegisterController.php 1 patch
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
      */
39 39
     protected function redirectTo()
40 40
     {
41
-        if (WhichPortal::isManagerPortal()) {
42
-            $redirectTo = route('manager.home');
43
-        } elseif (WhichPortal::isHrPortal()) {
44
-            $redirectTo = route('hr_advisor.home');
41
+        if (WhichPortal::isManagerPortal ()) {
42
+            $redirectTo = route ('manager.home');
43
+        } elseif (WhichPortal::isHrPortal ()) {
44
+            $redirectTo = route ('hr_advisor.home');
45 45
         } else {
46
-            $redirectTo = route('home');
46
+            $redirectTo = route ('home');
47 47
         }
48 48
         return $redirectTo;
49 49
     }
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public function __construct()
57 57
     {
58
-        $this->middleware('guest');
58
+        $this->middleware ('guest');
59 59
     }
60 60
 
61 61
     /**
@@ -65,10 +65,10 @@  discard block
 block discarded – undo
65 65
      */
66 66
     public function showRegistrationForm()
67 67
     {
68
-        return view('auth.register', [
69
-            'routes' => $this->auth_routes(),
70
-            'register' => Lang::get('common/auth/register'),
71
-            'home_url' => route('home'),
68
+        return view ('auth.register', [
69
+            'routes' => $this->auth_routes (),
70
+            'register' => Lang::get ('common/auth/register'),
71
+            'home_url' => route ('home'),
72 72
         ]);
73 73
     }
74 74
 
@@ -79,12 +79,12 @@  discard block
 block discarded – undo
79 79
      */
80 80
     public function showManagerRegistrationForm()
81 81
     {
82
-        return view('auth.register_manager', [
83
-            'routes' => $this->auth_routes(),
84
-            'register' => Lang::get('common/auth/register'),
85
-            'not_in_gov_option' => ['value' => 0, 'name' => Lang::get('common/auth/register.not_in_gov')],
86
-            'departments' => Department::all(),
87
-            'home_url' => route('manager.home'),
82
+        return view ('auth.register_manager', [
83
+            'routes' => $this->auth_routes (),
84
+            'register' => Lang::get ('common/auth/register'),
85
+            'not_in_gov_option' => ['value' => 0, 'name' => Lang::get ('common/auth/register.not_in_gov')],
86
+            'departments' => Department::all (),
87
+            'home_url' => route ('manager.home'),
88 88
         ]);
89 89
     }
90 90
 
@@ -95,12 +95,12 @@  discard block
 block discarded – undo
95 95
      */
96 96
     public function showHrRegistrationForm()
97 97
     {
98
-        return view('auth.register_manager', [
99
-            'routes' => $this->auth_routes(),
100
-            'register' => Lang::get('common/auth/register'),
101
-            'not_in_gov_option' => ['value' => 0, 'name' => Lang::get('common/auth/register.not_in_gov')],
102
-            'departments' => Department::all(),
103
-            'home_url' => route('hr_advisor.home'),
98
+        return view ('auth.register_manager', [
99
+            'routes' => $this->auth_routes (),
100
+            'register' => Lang::get ('common/auth/register'),
101
+            'not_in_gov_option' => ['value' => 0, 'name' => Lang::get ('common/auth/register.not_in_gov')],
102
+            'departments' => Department::all (),
103
+            'home_url' => route ('hr_advisor.home'),
104 104
         ]);
105 105
     }
106 106
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      */
114 114
     protected function validator(array $data)
115 115
     {
116
-        return RegistrationValidator::userValidator($data);
116
+        return RegistrationValidator::userValidator ($data);
117 117
     }
118 118
 
119 119
     /**
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
      */
125 125
     protected function managerValidator(array $data)
126 126
     {
127
-        return RegistrationValidator::managerValidator($data);
127
+        return RegistrationValidator::managerValidator ($data);
128 128
     }
129 129
 
130 130
     /**
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
      */
136 136
     protected function hrValidator(array $data)
137 137
     {
138
-        return RegistrationValidator::hrValidator($data);
138
+        return RegistrationValidator::hrValidator ($data);
139 139
     }
140 140
 
141 141
     /**
@@ -146,20 +146,20 @@  discard block
 block discarded – undo
146 146
      */
147 147
     protected function create(array $data)
148 148
     {
149
-        $user = new User();
149
+        $user = new User ();
150 150
         $user->first_name = $data['first_name'];
151 151
         $user->last_name = $data['last_name'];
152 152
         $user->email = $data['email'];
153
-        $user->password = Hash::make($data['password']);
153
+        $user->password = Hash::make ($data['password']);
154 154
 
155 155
         // Default to basic user.
156
-        $user->setRole('basic');
156
+        $user->setRole ('basic');
157 157
 
158
-        $user->save();
158
+        $user->save ();
159 159
 
160
-        $user->applicant()->save(new Applicant());
160
+        $user->applicant ()->save (new Applicant ());
161 161
 
162
-        return $user->fresh();
162
+        return $user->fresh ();
163 163
     }
164 164
 
165 165
     /**
@@ -171,28 +171,28 @@  discard block
 block discarded – undo
171 171
     protected function createManager(array $data)
172 172
     {
173 173
         // Create basic user.
174
-        $user = $this->create($data);
174
+        $user = $this->create ($data);
175 175
 
176 176
         // Save manager specific fields.
177
-        $managerDepartment = Department::find($data['department']);
177
+        $managerDepartment = Department::find ($data['department']);
178 178
         $inGovernment = ($managerDepartment !== null);
179 179
         $user->not_in_gov = !$inGovernment;
180 180
         $user->gov_email = $inGovernment ? $data['gov_email'] : null;
181
-        $user->save();
182
-        $user->refresh();
181
+        $user->save ();
182
+        $user->refresh ();
183 183
 
184 184
         // Add (or update) manager profile.
185 185
         // NOTE: modifying a field in $user, and saving it, appears to create Manager object. I don't know how. -- Tristan
186 186
         // That means that after setting not_in_gov or gov_email, a manager already exists here. Adding a new one will throw an exception.
187 187
         $department_id = $inGovernment ? $managerDepartment->id : null;
188 188
         if ($user->manager === null) {
189
-            $user->applicant()->save(new Manager());
190
-            $user->refresh();
189
+            $user->applicant ()->save (new Manager ());
190
+            $user->refresh ();
191 191
         }
192 192
         $user->manager->department_id = $department_id;
193
-        $user->manager->save();
193
+        $user->manager->save ();
194 194
 
195
-        return $user->fresh();
195
+        return $user->fresh ();
196 196
     }
197 197
 
198 198
     /**
@@ -204,28 +204,28 @@  discard block
 block discarded – undo
204 204
     protected function createHrAdvisor(array $data)
205 205
     {
206 206
         // Create basic user.
207
-        $user = $this->create($data);
207
+        $user = $this->create ($data);
208 208
 
209 209
         // Save hr_advisor specific fields (same as manager).
210
-        $hrDepartment = Department::find($data['department']);
210
+        $hrDepartment = Department::find ($data['department']);
211 211
         $inGovernment = ($hrDepartment !== null);
212 212
         $user->not_in_gov = !$inGovernment;
213 213
         $user->gov_email = $inGovernment ? $data['gov_email'] : null;
214
-        $user->setRole('hr_advisor');
214
+        $user->setRole ('hr_advisor');
215 215
 
216
-        $user->save();
217
-        $user->refresh();
216
+        $user->save ();
217
+        $user->refresh ();
218 218
 
219 219
         $department_id = $inGovernment ? $hrDepartment->id : null;
220 220
         if ($user->hr_advisor === null) {
221
-            $user->hr_advisor()->save(new HrAdvisor());
222
-            $user->refresh();
221
+            $user->hr_advisor ()->save (new HrAdvisor ());
222
+            $user->refresh ();
223 223
         }
224 224
         $user->hr_advisor->department_id = $department_id;
225 225
         $user->hr_advisor->user_id === $user->id;
226
-        $user->hr_advisor->save();
226
+        $user->hr_advisor->save ();
227 227
 
228
-        return $user->fresh();
228
+        return $user->fresh ();
229 229
     }
230 230
 
231 231
     /**
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
      */
239 239
     protected function registered(Request $request, $user)
240 240
     {
241
-        return redirect()->intended($this->redirectTo());
241
+        return redirect ()->intended ($this->redirectTo ());
242 242
     }
243 243
 
244 244
     /**
@@ -250,14 +250,14 @@  discard block
 block discarded – undo
250 250
      */
251 251
     public function registerManager(Request $request)
252 252
     {
253
-        $this->managerValidator($request->all())->validate();
253
+        $this->managerValidator ($request->all ())->validate ();
254 254
 
255
-        event(new Registered($user = $this->createManager($request->all())));
255
+        event (new Registered ($user = $this->createManager ($request->all ())));
256 256
 
257
-        $this->guard()->login($user);
257
+        $this->guard ()->login ($user);
258 258
 
259
-        return $this->registered($request, $user)
260
-            ?: redirect($this->redirectPath());
259
+        return $this->registered ($request, $user)
260
+            ?: redirect ($this->redirectPath ());
261 261
     }
262 262
 
263 263
     /**
@@ -269,12 +269,12 @@  discard block
 block discarded – undo
269 269
      */
270 270
     public function registerHrAdvisor(Request $request)
271 271
     {
272
-        $this->hrValidator($request->all())->validate();
272
+        $this->hrValidator ($request->all ())->validate ();
273 273
 
274
-        event(new Registered($user = $this->createHrAdvisor($request->all())));
274
+        event (new Registered ($user = $this->createHrAdvisor ($request->all ())));
275 275
 
276
-        $this->guard()->login($user);
276
+        $this->guard ()->login ($user);
277 277
 
278
-        return redirect(route('hr_advisor.home'));
278
+        return redirect (route ('hr_advisor.home'));
279 279
     }
280 280
 }
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/LoginController.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
      */
45 45
     protected function redirectTo()
46 46
     {
47
-        if (WhichPortal::isManagerPortal()) {
48
-            $redirectTo = route('manager.home');
49
-        } elseif (WhichPortal::isHrPortal()) {
50
-            $redirectTo = route('hr_advisor.home');
47
+        if (WhichPortal::isManagerPortal ()) {
48
+            $redirectTo = route ('manager.home');
49
+        } elseif (WhichPortal::isHrPortal ()) {
50
+            $redirectTo = route ('hr_advisor.home');
51 51
         } else {
52
-            $redirectTo = route('home');
52
+            $redirectTo = route ('home');
53 53
         }
54 54
         return $redirectTo;
55 55
     }
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public function __construct()
63 63
     {
64
-        $this->middleware('guest')->except('logout');
64
+        $this->middleware ('guest')->except ('logout');
65 65
     }
66 66
 
67 67
     /**
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
      */
73 73
     public function showLoginForm()
74 74
     {
75
-        $home_url = WhichPortal::isManagerPortal() ? route('manager.home') : route('home');
75
+        $home_url = WhichPortal::isManagerPortal () ? route('manager.home') : route ('home');
76 76
 
77
-        return view('auth/login', [
78
-            'routes' => $this->auth_routes(),
79
-            'login' => Lang::get('common/auth/login'),
77
+        return view ('auth/login', [
78
+            'routes' => $this->auth_routes (),
79
+            'login' => Lang::get ('common/auth/login'),
80 80
             'home_url' => $home_url,
81 81
         ]);
82 82
     }
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
      */
91 91
     public function logout(Request $request)
92 92
     {
93
-        $this->guard()->logout();
93
+        $this->guard ()->logout ();
94 94
 
95
-        $request->session()->invalidate();
95
+        $request->session ()->invalidate ();
96 96
 
97 97
         // This causes logout to redirect to the same page as login.
98
-        return redirect($this->redirectPath());
98
+        return redirect ($this->redirectPath ());
99 99
     }
100 100
 }
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/ResetPasswordController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
      */
32 32
     protected function redirectTo()
33 33
     {
34
-        if (WhichPortal::isManagerPortal()) {
35
-            $redirectTo = route('manager.home');
36
-        } elseif (WhichPortal::isHrPortal()) {
37
-            $redirectTo = route('hr_advisor.home');
34
+        if (WhichPortal::isManagerPortal ()) {
35
+            $redirectTo = route ('manager.home');
36
+        } elseif (WhichPortal::isHrPortal ()) {
37
+            $redirectTo = route ('hr_advisor.home');
38 38
         } else {
39
-            $redirectTo = route('home');
39
+            $redirectTo = route ('home');
40 40
         }
41 41
         return $redirectTo;
42 42
     }
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function __construct()
50 50
     {
51
-        $this->middleware('guest');
51
+        $this->middleware ('guest');
52 52
     }
53 53
 
54 54
     /**
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
      */
63 63
     public function showResetForm(Request $request, $token = null)
64 64
     {
65
-        return view('auth.passwords.reset')->with([
65
+        return view ('auth.passwords.reset')->with ([
66 66
             'token' => $token,
67 67
             'email' => $request->email,
68
-            'routes' => $this->auth_routes(),
69
-            'reset_password' => Lang::get('common/auth/reset_password'),
68
+            'routes' => $this->auth_routes (),
69
+            'reset_password' => Lang::get ('common/auth/reset_password'),
70 70
         ]);
71 71
     }
72 72
 
Please login to merge, or discard this patch.
app/Http/Controllers/JobController.php 1 patch
Spacing   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -23,26 +23,26 @@  discard block
 block discarded – undo
23 23
      */
24 24
     public function index()
25 25
     {
26
-        $now = Carbon::now();
26
+        $now = Carbon::now ();
27 27
 
28 28
         // Find published jobs that are currently open for applications.
29 29
         // Eager load required relationships: Department, Province, JobTerm.
30 30
         // Eager load the count of submitted applications, to prevent the relationship
31 31
         // from being actually loaded and firing off events.
32
-        $jobs = JobPoster::where('open_date_time', '<=', $now)
33
-            ->where('close_date_time', '>=', $now)
34
-            ->where('published', true)
35
-            ->with([
32
+        $jobs = JobPoster::where ('open_date_time', '<=', $now)
33
+            ->where ('close_date_time', '>=', $now)
34
+            ->where ('published', true)
35
+            ->with ([
36 36
                 'department',
37 37
                 'province',
38 38
                 'job_term',
39 39
             ])
40
-            ->withCount([
40
+            ->withCount ([
41 41
                 'submitted_applications',
42 42
             ])
43
-            ->get();
44
-        return view('applicant/job_index', [
45
-            'job_index' => Lang::get('applicant/job_index'),
43
+            ->get ();
44
+        return view ('applicant/job_index', [
45
+            'job_index' => Lang::get ('applicant/job_index'),
46 46
             'jobs' => $jobs
47 47
         ]);
48 48
     }
@@ -54,31 +54,31 @@  discard block
 block discarded – undo
54 54
      */
55 55
     public function managerIndex()
56 56
     {
57
-        $manager = Auth::user()->manager;
57
+        $manager = Auth::user ()->manager;
58 58
 
59
-        $jobs = JobPoster::where('manager_id', $manager->id)
60
-            ->with('classification')
61
-            ->withCount('submitted_applications')
62
-            ->get();
59
+        $jobs = JobPoster::where ('manager_id', $manager->id)
60
+            ->with ('classification')
61
+            ->withCount ('submitted_applications')
62
+            ->get ();
63 63
 
64 64
         foreach ($jobs as &$job) {
65 65
             $chosen_lang = $job->chosen_lang;
66 66
 
67 67
             // Show chosen lang title if current title is empty.
68 68
             if (empty($job->title)) {
69
-                $job->title = $job->translate($chosen_lang)->title;
69
+                $job->title = $job->translate ($chosen_lang)->title;
70 70
                 $job->trans_required = true;
71 71
             }
72 72
 
73 73
             // Always preview and edit in the chosen language.
74
-            $job->preview_link = LaravelLocalization::getLocalizedURL($chosen_lang, route('manager.jobs.show', $job));
75
-            $job->edit_link = LaravelLocalization::getLocalizedURL($chosen_lang, route('manager.jobs.edit', $job));
74
+            $job->preview_link = LaravelLocalization::getLocalizedURL ($chosen_lang, route ('manager.jobs.show', $job));
75
+            $job->edit_link = LaravelLocalization::getLocalizedURL ($chosen_lang, route ('manager.jobs.edit', $job));
76 76
         }
77 77
 
78 78
 
79
-        return view('manager/job_index', [
79
+        return view ('manager/job_index', [
80 80
             // Localization Strings.
81
-            'jobs_l10n' => Lang::get('manager/job_index'),
81
+            'jobs_l10n' => Lang::get ('manager/job_index'),
82 82
             // Data.
83 83
             'jobs' => $jobs,
84 84
         ]);
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
      */
94 94
     public function destroy(Request $request, JobPoster $jobPoster)
95 95
     {
96
-        $jobPoster->delete();
96
+        $jobPoster->delete ();
97 97
     }
98 98
 
99 99
     /**
@@ -105,14 +105,14 @@  discard block
 block discarded – undo
105 105
      */
106 106
     public function show(Request $request, JobPoster $jobPoster)
107 107
     {
108
-        $jobPoster->load([
108
+        $jobPoster->load ([
109 109
             'department',
110 110
             'criteria.skill.skill_type',
111 111
             'manager.team_culture',
112 112
             'manager.work_environment'
113 113
         ]);
114 114
 
115
-        $user = Auth::user();
115
+        $user = Auth::user ();
116 116
 
117 117
         // TODO: Improve workplace photos, and reference them in template direction from WorkEnvironment model.
118 118
         $workplacePhotos = [];
@@ -125,36 +125,36 @@  discard block
 block discarded – undo
125 125
 
126 126
         // TODO: replace route('manager.show',manager.id) in templates with link using slug.
127 127
         $criteria = [
128
-            'essential' => $jobPoster->criteria->filter(
129
-                function ($value, $key) {
128
+            'essential' => $jobPoster->criteria->filter (
129
+                function ($value, $key){
130 130
                     return $value->criteria_type->name == 'essential';
131 131
                 }
132 132
             ),
133
-            'asset' => $jobPoster->criteria->filter(
134
-                function ($value, $key) {
133
+            'asset' => $jobPoster->criteria->filter (
134
+                function ($value, $key){
135 135
                     return $value->criteria_type->name == 'asset';
136 136
                 }
137 137
             ),
138 138
         ];
139 139
 
140
-        $jobLang = Lang::get('applicant/job_post');
140
+        $jobLang = Lang::get ('applicant/job_post');
141 141
 
142 142
         $applyButton = [];
143
-        if (!$jobPoster->published && $this->authorize('update', $jobPoster)) {
143
+        if (!$jobPoster->published && $this->authorize ('update', $jobPoster)) {
144 144
             $applyButton = [
145
-                'href' => route('manager.jobs.edit', $jobPoster->id),
145
+                'href' => route ('manager.jobs.edit', $jobPoster->id),
146 146
                 'title' => $jobLang['apply']['edit_link_title'],
147 147
                 'text' => $jobLang['apply']['edit_link_label'],
148 148
             ];
149
-        } elseif (Auth::check() && $jobPoster->isOpen()) {
149
+        } elseif (Auth::check () && $jobPoster->isOpen ()) {
150 150
             $applyButton = [
151
-                'href' => route('job.application.edit.1', $jobPoster->id),
151
+                'href' => route ('job.application.edit.1', $jobPoster->id),
152 152
                 'title' => $jobLang['apply']['apply_link_title'],
153 153
                 'text' => $jobLang['apply']['apply_link_label'],
154 154
             ];
155
-        } elseif (Auth::guest() && $jobPoster->isOpen()) {
155
+        } elseif (Auth::guest () && $jobPoster->isOpen ()) {
156 156
             $applyButton = [
157
-                'href' => route('job.application.edit.1', $jobPoster->id),
157
+                'href' => route ('job.application.edit.1', $jobPoster->id),
158 158
                 'title' => $jobLang['apply']['login_link_title'],
159 159
                 'text' => $jobLang['apply']['login_link_label'],
160 160
             ];
@@ -166,19 +166,19 @@  discard block
 block discarded – undo
166 166
             ];
167 167
         }
168 168
 
169
-        $jpb_release_date = strtotime('2019-08-21 16:18:17');
170
-        $job_created_at = strtotime($jobPoster->created_at);
169
+        $jpb_release_date = strtotime ('2019-08-21 16:18:17');
170
+        $job_created_at = strtotime ($jobPoster->created_at);
171 171
 
172 172
         // If the job poster is created after the release of the JPB.
173 173
         // Then, render with updated poster template.
174 174
         // Else, render with old poster template.
175 175
         if ($job_created_at > $jpb_release_date) {
176 176
             // Updated job poster (JPB).
177
-            return view(
177
+            return view (
178 178
                 'applicant/jpb_job_post',
179 179
                 [
180 180
                     'job_post' => $jobLang,
181
-                    'skill_template' => Lang::get('common/skills'),
181
+                    'skill_template' => Lang::get ('common/skills'),
182 182
                     'job' => $jobPoster,
183 183
                     'manager' => $jobPoster->manager,
184 184
                     'criteria' => $criteria,
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
             );
188 188
         } else {
189 189
             // Old job poster.
190
-            return view(
190
+            return view (
191 191
                 'applicant/job_post',
192 192
                 [
193 193
                     'job_post' => $jobLang,
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
                     'job' => $jobPoster,
200 200
                     'criteria' => $criteria,
201 201
                     'apply_button' => $applyButton,
202
-                    'skill_template' => Lang::get('common/skills'),
202
+                    'skill_template' => Lang::get ('common/skills'),
203 203
                 ]
204 204
             );
205 205
         }
@@ -217,20 +217,20 @@  discard block
 block discarded – undo
217 217
     {
218 218
         $manager = $jobPoster->manager;
219 219
 
220
-        if ($jobPoster->job_poster_questions === null || $jobPoster->job_poster_questions->count() === 0) {
221
-            $jobPoster->job_poster_questions()->saveMany($this->populateDefaultQuestions());
222
-            $jobPoster->refresh();
220
+        if ($jobPoster->job_poster_questions === null || $jobPoster->job_poster_questions->count () === 0) {
221
+            $jobPoster->job_poster_questions ()->saveMany ($this->populateDefaultQuestions ());
222
+            $jobPoster->refresh ();
223 223
         }
224 224
 
225
-        return view(
225
+        return view (
226 226
             'manager/job_create',
227 227
             [
228 228
                 // Localization Strings.
229
-                'job_l10n' => Lang::get('manager/job_edit'),
229
+                'job_l10n' => Lang::get ('manager/job_edit'),
230 230
                 // Data.
231 231
                 'manager' => $manager,
232 232
                 'job' => $jobPoster,
233
-                'form_action_url' => route('admin.jobs.update', $jobPoster),
233
+                'form_action_url' => route ('admin.jobs.update', $jobPoster),
234 234
             ]
235 235
         );
236 236
     }
@@ -243,21 +243,21 @@  discard block
 block discarded – undo
243 243
      */
244 244
     public function createAsManager(Manager $manager)
245 245
     {
246
-        $jobPoster = new JobPoster();
246
+        $jobPoster = new JobPoster ();
247 247
         $jobPoster->manager_id = $manager->id;
248 248
 
249 249
         // Save manager-specific info to the job poster - equivalent to the intro step of the JPB
250
-        $divisionEn = $manager->translate('en') !== null ? $manager->translate('en')->division : null;
251
-        $divisionFr = $manager->translate('fr') !== null ? $manager->translate('fr')->division : null;
252
-        $jobPoster->fill([
250
+        $divisionEn = $manager->translate ('en') !== null ? $manager->translate ('en')->division : null;
251
+        $divisionFr = $manager->translate ('fr') !== null ? $manager->translate ('fr')->division : null;
252
+        $jobPoster->fill ([
253 253
             'department_id' => $manager->department_id,
254 254
             'en' => ['division' => $divisionEn],
255 255
             'fr' => ['division' => $divisionFr],
256 256
         ]);
257 257
 
258
-        $jobPoster->save();
258
+        $jobPoster->save ();
259 259
 
260
-        return redirect()->route('manager.jobs.edit', $jobPoster->id);
260
+        return redirect ()->route ('manager.jobs.edit', $jobPoster->id);
261 261
     }
262 262
 
263 263
     /**
@@ -272,19 +272,19 @@  discard block
 block discarded – undo
272 272
     {
273 273
         // Don't allow edits for published Job Posters
274 274
         // Also check auth while we're at it.
275
-        $this->authorize('update', $jobPoster);
276
-        JobPosterValidator::validateUnpublished($jobPoster);
275
+        $this->authorize ('update', $jobPoster);
276
+        JobPosterValidator::validateUnpublished ($jobPoster);
277 277
 
278
-        $input = $request->input();
278
+        $input = $request->input ();
279 279
 
280 280
         if ($jobPoster->manager_id == null) {
281
-            $jobPoster->manager_id = $request->user()->manager->id;
282
-            $jobPoster->save();
281
+            $jobPoster->manager_id = $request->user ()->manager->id;
282
+            $jobPoster->save ();
283 283
         }
284 284
 
285
-        $this->fillAndSaveJobPosterQuestions($input, $jobPoster, true);
285
+        $this->fillAndSaveJobPosterQuestions ($input, $jobPoster, true);
286 286
 
287
-        return redirect(route('manager.jobs.show', $jobPoster->id));
287
+        return redirect (route ('manager.jobs.show', $jobPoster->id));
288 288
     }
289 289
 
290 290
     /**
@@ -298,17 +298,17 @@  discard block
 block discarded – undo
298 298
     protected function fillAndSaveJobPosterQuestions(array $input, JobPoster $jobPoster, bool $replace) : void
299 299
     {
300 300
         if ($replace) {
301
-            $jobPoster->job_poster_questions()->delete();
301
+            $jobPoster->job_poster_questions ()->delete ();
302 302
         }
303 303
 
304
-        if (!array_key_exists('question', $input) || !is_array($input['question'])) {
304
+        if (!array_key_exists ('question', $input) || !is_array ($input['question'])) {
305 305
             return;
306 306
         }
307 307
 
308 308
         foreach ($input['question'] as $question) {
309
-            $jobQuestion = new JobPosterQuestion();
309
+            $jobQuestion = new JobPosterQuestion ();
310 310
             $jobQuestion->job_poster_id = $jobPoster->id;
311
-            $jobQuestion->fill(
311
+            $jobQuestion->fill (
312 312
                 [
313 313
                     'en' => [
314 314
                         'question' => $question['question']['en'],
@@ -320,8 +320,8 @@  discard block
 block discarded – undo
320 320
                     ]
321 321
                 ]
322 322
             );
323
-            $jobPoster->save();
324
-            $jobQuestion->save();
323
+            $jobPoster->save ();
324
+            $jobQuestion->save ();
325 325
         }
326 326
     }
327 327
 
@@ -333,20 +333,20 @@  discard block
 block discarded – undo
333 333
     protected function populateDefaultQuestions()
334 334
     {
335 335
         $defaultQuestions = [
336
-            'en' => array_values(Lang::get('manager/job_create', [], 'en')['questions']),
337
-            'fr' => array_values(Lang::get('manager/job_create', [], 'fr')['questions']),
336
+            'en' => array_values (Lang::get ('manager/job_create', [], 'en')['questions']),
337
+            'fr' => array_values (Lang::get ('manager/job_create', [], 'fr')['questions']),
338 338
         ];
339 339
 
340
-        if (count($defaultQuestions['en']) !== count($defaultQuestions['fr'])) {
341
-            Log::warning('There must be the same number of French and English default questions for a Job Poster.');
340
+        if (count ($defaultQuestions['en']) !== count ($defaultQuestions['fr'])) {
341
+            Log::warning ('There must be the same number of French and English default questions for a Job Poster.');
342 342
             return;
343 343
         }
344 344
 
345 345
         $jobQuestions = [];
346 346
 
347
-        for ($i = 0; $i < count($defaultQuestions['en']); $i++) {
348
-            $jobQuestion = new JobPosterQuestion();
349
-            $jobQuestion->fill(
347
+        for ($i = 0; $i < count ($defaultQuestions['en']); $i++) {
348
+            $jobQuestion = new JobPosterQuestion ();
349
+            $jobQuestion->fill (
350 350
                 [
351 351
                     'en' => [
352 352
                         'question' => $defaultQuestions['en'][$i],
Please login to merge, or discard this patch.
app/Http/Controllers/ManagerProfileController.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      */
27 27
     public function show(Request $request, Manager $manager)
28 28
     {
29
-        $manager_profile = Lang::get('applicant/manager_profile');
29
+        $manager_profile = Lang::get ('applicant/manager_profile');
30 30
 
31 31
         $manager_profile_sections = [
32 32
             [
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
             ]
66 66
         ];
67 67
 
68
-        return view('applicant/manager', [
68
+        return view ('applicant/manager', [
69 69
             'manager_profile' => $manager_profile,
70
-            'urls' => Lang::get('common/urls'),
70
+            'urls' => Lang::get ('common/urls'),
71 71
             'manager' => $manager,
72 72
             'manager_profile_photo_url' => '/images/user.png', // TODO get real photo.
73 73
             'manager_profile_sections' => $manager_profile_sections,
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
      */
84 84
     public function editAuthenticated(Request $request)
85 85
     {
86
-        $manager = $request->user()->manager;
87
-        return redirect(route('manager.profile.edit', $manager));
86
+        $manager = $request->user ()->manager;
87
+        return redirect (route ('manager.profile.edit', $manager));
88 88
     }
89 89
 
90 90
     /**
@@ -99,25 +99,25 @@  discard block
 block discarded – undo
99 99
         // TODO: Improve workplace photos, and reference them in template direction from WorkEnvironment model.
100 100
         $workplacePhotos = [];
101 101
 
102
-        $frequencies = Frequency::all();
102
+        $frequencies = Frequency::all ();
103 103
         $linkedInUrlPattern = LinkedInUrlRule::PATTERN;
104 104
         $twitterHandlePattern = TwitterHandleRule::PATTERN;
105 105
 
106
-        return view('manager/profile', [
106
+        return view ('manager/profile', [
107 107
             // Localization.
108
-            'profile_l10n' => Lang::get('manager/profile'),
108
+            'profile_l10n' => Lang::get ('manager/profile'),
109 109
             // Data.
110
-            'urls' => Lang::get('common/urls'),
110
+            'urls' => Lang::get ('common/urls'),
111 111
             'user' => $manager->user,
112 112
             'manager' => $manager,
113 113
             'manager_profile_photo_url' => '/images/user.png', // TODO get real photo.
114 114
             'workplace_photos' => $workplacePhotos,
115
-            'departments' => Department::all(),
115
+            'departments' => Department::all (),
116 116
             'telework_options' => $frequencies,
117 117
             'flex_hour_options' => $frequencies,
118 118
             'radio_options' => $frequencies,
119
-            'managerEN' => $manager->translate('en'),
120
-            'managerFR' => $manager->translate('fr'),
119
+            'managerEN' => $manager->translate ('en'),
120
+            'managerFR' => $manager->translate ('fr'),
121 121
             'linkedInUrlPattern' => $linkedInUrlPattern,
122 122
             'twitterHandlePattern' => $twitterHandlePattern,
123 123
         ]);
@@ -134,27 +134,27 @@  discard block
 block discarded – undo
134 134
     {
135 135
         // TODO: save workplace Photos.
136 136
         // TODO: remove control of name in production.
137
-        $input = $request->input();
137
+        $input = $request->input ();
138 138
 
139 139
         // redirect to error messages element if validation fails
140
-        if (isset($request->validator) && $request->validator->fails()) {
140
+        if (isset($request->validator) && $request->validator->fails ()) {
141 141
             $hash = '#managerProfileFormErrors';
142
-            return redirect(route('manager.profile.edit', $manager).$hash)
143
-                        ->withErrors($request->validator)
144
-                        ->withInput();
142
+            return redirect (route ('manager.profile.edit', $manager).$hash)
143
+                        ->withErrors ($request->validator)
144
+                        ->withInput ();
145 145
         }
146 146
 
147
-        $validated = $request->validated();
147
+        $validated = $request->validated ();
148 148
 
149 149
         $user = $manager->user;
150
-        $user->fill($validated);
150
+        $user->fill ($validated);
151 151
         if (!empty($input['new_password'])) {
152
-            $user->password = Hash::make($input['new_password']);
152
+            $user->password = Hash::make ($input['new_password']);
153 153
         }
154
-        $user->save();
154
+        $user->save ();
155 155
 
156
-        $manager->fill($validated);
157
-        $manager->save();
156
+        $manager->fill ($validated);
157
+        $manager->save ();
158 158
 
159 159
         // Use the button that was clicked to decide which element to redirect to.
160 160
         switch ($input['submit']) {
@@ -172,18 +172,18 @@  discard block
 block discarded – undo
172 172
                 break;
173 173
         }
174 174
 
175
-        return redirect(route('manager.profile.edit', $manager).$hash);
175
+        return redirect (route ('manager.profile.edit', $manager).$hash);
176 176
     }
177 177
 
178 178
     public function faq(Request $request)
179 179
     {
180
-        $show_demo_notification = $request->user() && $request->user()->isDemoManager();
180
+        $show_demo_notification = $request->user () && $request->user ()->isDemoManager ();
181 181
 
182
-        return view(
182
+        return view (
183 183
             'applicant/static_faq',
184 184
             [
185
-                'breadcrumb_home' => route('manager.home'),
186
-                'faq' => Lang::get('applicant/faq'),
185
+                'breadcrumb_home' => route ('manager.home'),
186
+                'faq' => Lang::get ('applicant/faq'),
187 187
                 'manager_sidebar_active' => 'active',
188 188
                 'show_demo_notification' => $show_demo_notification,
189 189
             ]
Please login to merge, or discard this patch.
app/Http/Controllers/Api/JobTaskController.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -17,14 +17,14 @@  discard block
 block discarded – undo
17 17
      */
18 18
     public function toApiArray(JobPosterKeyTask $model)
19 19
     {
20
-        return array_merge($model->toArray(), $model->getTranslationsArray());
20
+        return array_merge ($model->toArray (), $model->getTranslationsArray ());
21 21
     }
22 22
 
23 23
     public function indexByJob(JobPoster $jobPoster)
24 24
     {
25 25
         $toApiArray = array($this, 'toApiArray');
26
-        $taskArray = JobPosterKeyTask::where('job_poster_id', $jobPoster->id)->get()->map($toApiArray);
27
-        return response()->json($taskArray);
26
+        $taskArray = JobPosterKeyTask::where ('job_poster_id', $jobPoster->id)->get ()->map ($toApiArray);
27
+        return response ()->json ($taskArray);
28 28
     }
29 29
 
30 30
     /**
@@ -38,35 +38,35 @@  discard block
 block discarded – undo
38 38
     {
39 39
         $toApiArray = array($this, 'toApiArray');
40 40
 
41
-        $newTasks = collect($request->validated()); // Collection of JobPosterKeyTasks.
41
+        $newTasks = collect ($request->validated ()); // Collection of JobPosterKeyTasks.
42 42
         $oldTasks = $jobPoster->job_poster_key_tasks;
43 43
 
44 44
         $savedNewTaskIds = [];
45 45
 
46 46
         // First, delete old tasks that weren't resubmitted, and update those that were.
47 47
         foreach ($oldTasks as $task) {
48
-            $newTask = $newTasks->firstWhere('id', $task['id']);
48
+            $newTask = $newTasks->firstWhere ('id', $task['id']);
49 49
             if ($newTask) {
50 50
                 $savedNewTaskIds[] = $newTask['id'];
51
-                $task->fill(collect($newTask)->only(['en', 'fr'])->toArray());
52
-                $task->save();
51
+                $task->fill (collect ($newTask)->only (['en', 'fr'])->toArray ());
52
+                $task->save ();
53 53
             } else {
54
-                $task->delete();
54
+                $task->delete ();
55 55
             }
56 56
         }
57 57
 
58 58
         // Now, save any new tasks that remain.
59 59
         foreach ($newTasks as $task) {
60
-            if ($this->isUnsaved($task, $savedNewTaskIds)) {
61
-                $jobPosterTask = new JobPosterKeyTask();
60
+            if ($this->isUnsaved ($task, $savedNewTaskIds)) {
61
+                $jobPosterTask = new JobPosterKeyTask ();
62 62
                 $jobPosterTask->job_poster_id = $jobPoster->id;
63
-                $jobPosterTask->fill(collect($task)->only(['en', 'fr'])->toArray());
64
-                $jobPosterTask->save();
63
+                $jobPosterTask->fill (collect ($task)->only (['en', 'fr'])->toArray ());
64
+                $jobPosterTask->save ();
65 65
             }
66 66
         }
67 67
 
68
-        $taskArray = $jobPoster->fresh()->job_poster_key_tasks->map($toApiArray);
69
-        return response()->json($taskArray);
68
+        $taskArray = $jobPoster->fresh ()->job_poster_key_tasks->map ($toApiArray);
69
+        return response ()->json ($taskArray);
70 70
     }
71 71
 
72 72
     /**
@@ -78,6 +78,6 @@  discard block
 block discarded – undo
78 78
      */
79 79
     private function isUnsaved($task, array $savedTaskIds): bool
80 80
     {
81
-        return !array_key_exists('id', $task) || !in_array($task['id'], $savedTaskIds);
81
+        return !array_key_exists ('id', $task) || !in_array ($task['id'], $savedTaskIds);
82 82
     }
83 83
 }
Please login to merge, or discard this patch.
app/Http/Controllers/Api/ClaimJobApiController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
      */
28 28
     public function store(Request $request, JobPoster $job)
29 29
     {
30
-        $this->claimJob($request->user()->hr_advisor, $job);
30
+        $this->claimJob ($request->user ()->hr_advisor, $job);
31 31
 
32
-        return response()->json(['status' => 'ok']);
32
+        return response ()->json (['status' => 'ok']);
33 33
     }
34 34
 
35 35
     /**
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
      */
63 63
     public function destroy(Request $request, JobPoster $job)
64 64
     {
65
-        $this->unclaimJob($request->user()->hr_advisor, $job);
65
+        $this->unclaimJob ($request->user ()->hr_advisor, $job);
66 66
 
67
-        return response()->json(['status' => 'ok']);
67
+        return response ()->json (['status' => 'ok']);
68 68
     }
69 69
 
70 70
     /**
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      */
77 77
     public function claimJob(HrAdvisor $hrAdvisor, JobPoster $job)
78 78
     {
79
-        $hrAdvisor->claimed_jobs()->attach($job);
79
+        $hrAdvisor->claimed_jobs ()->attach ($job);
80 80
     }
81 81
 
82 82
     /**
@@ -88,6 +88,6 @@  discard block
 block discarded – undo
88 88
      */
89 89
     public function unclaimJob(HrAdvisor $hrAdvisor, JobPoster $job)
90 90
     {
91
-        $hrAdvisor->claimed_jobs()->detach($job);
91
+        $hrAdvisor->claimed_jobs ()->detach ($job);
92 92
     }
93 93
 }
Please login to merge, or discard this patch.
app/Http/Controllers/Api/HrAdvisorController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,6 +15,6 @@
 block discarded – undo
15 15
      */
16 16
     public function show(HrAdvisor $hrAdvisor)
17 17
     {
18
-        return response()->json($hrAdvisor->toArray());
18
+        return response ()->json ($hrAdvisor->toArray ());
19 19
     }
20 20
 }
Please login to merge, or discard this patch.