@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | * Functions |
11 | 11 | * @return array |
12 | 12 | */ |
13 | - public function getFunctions(): array |
|
13 | + public function getFunctions (): array |
|
14 | 14 | { |
15 | 15 | return [ |
16 | - new Twig_SimpleFunction('handleNullState', [$this, 'handleNullState']), |
|
16 | + new Twig_SimpleFunction ('handleNullState', [$this, 'handleNullState']), |
|
17 | 17 | ]; |
18 | 18 | } |
19 | 19 | |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @return void |
29 | 29 | */ |
30 | - public function handleNullState($output, $outputHtml, string $nullStateHtml): void |
|
30 | + public function handleNullState ($output, $outputHtml, string $nullStateHtml): void |
|
31 | 31 | { |
32 | 32 | if (!empty($output) && !empty($outputHtml)) { |
33 | 33 | echo $outputHtml; |
@@ -58,21 +58,21 @@ discard block |
||
58 | 58 | * @param \Exception $exception |
59 | 59 | * @return void |
60 | 60 | */ |
61 | - public function report(Exception $exception) |
|
61 | + public function report (Exception $exception) |
|
62 | 62 | { |
63 | 63 | if ($exception instanceof TokenMismatchException) { |
64 | 64 | $logData = [ |
65 | - 'requestToken' => request()->header('x-csrf-token'), |
|
66 | - 'sessionToken' => session()->token(), |
|
67 | - 'session' => session()->all(), |
|
68 | - 'user' => request()->user(), |
|
69 | - 'requestUrl' => request()->url() |
|
65 | + 'requestToken' => request ()->header ('x-csrf-token'), |
|
66 | + 'sessionToken' => session ()->token (), |
|
67 | + 'session' => session ()->all (), |
|
68 | + 'user' => request ()->user (), |
|
69 | + 'requestUrl' => request ()->url () |
|
70 | 70 | ]; |
71 | - $message = '419 CSRF Token Mismatch. ' . collect($logData)->toJson(); |
|
72 | - Log::debug($message); |
|
71 | + $message = '419 CSRF Token Mismatch. '.collect ($logData)->toJson (); |
|
72 | + Log::debug ($message); |
|
73 | 73 | } |
74 | 74 | |
75 | - parent::report($exception); |
|
75 | + parent::report ($exception); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -81,15 +81,15 @@ discard block |
||
81 | 81 | * |
82 | 82 | * @return array |
83 | 83 | */ |
84 | - protected function context() |
|
84 | + protected function context () |
|
85 | 85 | { |
86 | 86 | try { |
87 | - return array_filter([ |
|
88 | - 'userId' => Auth::id(), |
|
87 | + return array_filter ([ |
|
88 | + 'userId' => Auth::id (), |
|
89 | 89 | // 'email' => optional(Auth::user())->email, |
90 | - 'url' => Request::path(), |
|
91 | - 'method' => Request::method(), |
|
92 | - 'referer' => Request::header('referer', '') |
|
90 | + 'url' => Request::path (), |
|
91 | + 'method' => Request::method (), |
|
92 | + 'referer' => Request::header ('referer', '') |
|
93 | 93 | ]); |
94 | 94 | } catch (Throwable $e) { |
95 | 95 | return []; |
@@ -103,17 +103,17 @@ discard block |
||
103 | 103 | * @param \Exception $exception |
104 | 104 | * @return \Illuminate\Http\Response |
105 | 105 | */ |
106 | - public function render($request, Exception $exception) |
|
106 | + public function render ($request, Exception $exception) |
|
107 | 107 | { |
108 | 108 | if ($exception instanceof AdminException) { |
109 | - return $exception->render($request); |
|
109 | + return $exception->render ($request); |
|
110 | 110 | } |
111 | 111 | if ($exception instanceof TokenMismatchException) { |
112 | - $newMessage = $exception->getMessage() . ' ' . Lang::get('errors.refresh_page'); |
|
113 | - $modifiedException = new TokenMismatchException($newMessage, $exception->getCode(), $exception); |
|
114 | - return parent::render($request, $modifiedException); |
|
112 | + $newMessage = $exception->getMessage ().' '.Lang::get ('errors.refresh_page'); |
|
113 | + $modifiedException = new TokenMismatchException ($newMessage, $exception->getCode (), $exception); |
|
114 | + return parent::render ($request, $modifiedException); |
|
115 | 115 | } |
116 | - return parent::render($request, $exception); |
|
116 | + return parent::render ($request, $exception); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
@@ -123,17 +123,17 @@ discard block |
||
123 | 123 | * @param \Illuminate\Auth\AuthenticationException $exception |
124 | 124 | * @return \Illuminate\Http\Response |
125 | 125 | */ |
126 | - protected function unauthenticated($request, AuthenticationException $exception) |
|
126 | + protected function unauthenticated ($request, AuthenticationException $exception) |
|
127 | 127 | { |
128 | - if ($request->expectsJson()) { |
|
129 | - return response()->json(['error' => 'Unauthenticated.'], 401); |
|
128 | + if ($request->expectsJson ()) { |
|
129 | + return response ()->json (['error' => 'Unauthenticated.'], 401); |
|
130 | 130 | } |
131 | - if (WhichPortal::isManagerPortal()) { |
|
132 | - $loginRoute = route('manager.login'); |
|
131 | + if (WhichPortal::isManagerPortal ()) { |
|
132 | + $loginRoute = route ('manager.login'); |
|
133 | 133 | } else { |
134 | - $loginRoute = route('login'); |
|
134 | + $loginRoute = route ('login'); |
|
135 | 135 | } |
136 | - return redirect()->guest($loginRoute); |
|
136 | + return redirect ()->guest ($loginRoute); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
@@ -143,18 +143,18 @@ discard block |
||
143 | 143 | * @param \Symfony\Component\HttpKernel\Exception\HttpExceptionInterface $e |
144 | 144 | * @return \Symfony\Component\HttpFoundation\Response |
145 | 145 | */ |
146 | - protected function renderHttpException(HttpExceptionInterface $e) |
|
146 | + protected function renderHttpException (HttpExceptionInterface $e) |
|
147 | 147 | { |
148 | - if (!view()->exists("errors.{$e->getStatusCode()}")) { |
|
149 | - return response()->view('errors.default', [ |
|
148 | + if (!view ()->exists ("errors.{$e->getStatusCode ()}")) { |
|
149 | + return response ()->view ('errors.default', [ |
|
150 | 150 | 'exception' => $e, |
151 | - 'goc' => Lang::get('common/goc'), |
|
152 | - 'alert' => Lang::get('common/alert'), |
|
151 | + 'goc' => Lang::get ('common/goc'), |
|
152 | + 'alert' => Lang::get ('common/alert'), |
|
153 | 153 | 'error' => [ |
154 | 154 | 'title' => 'Error' |
155 | 155 | ] |
156 | - ], $e->getStatusCode(), $e->getHeaders()); |
|
156 | + ], $e->getStatusCode (), $e->getHeaders ()); |
|
157 | 157 | } |
158 | - return parent::renderHttpException($e); |
|
158 | + return parent::renderHttpException ($e); |
|
159 | 159 | } |
160 | 160 | } |
@@ -22,10 +22,10 @@ discard block |
||
22 | 22 | * |
23 | 23 | * @return void |
24 | 24 | */ |
25 | - public function __construct(string $message, int $code, ?\Throwable $previous = null, array $links = null) |
|
25 | + public function __construct (string $message, int $code, ?\Throwable $previous = null, array $links = null) |
|
26 | 26 | { |
27 | 27 | $this->links = $links; |
28 | - parent::__construct($message, $code, $previous); |
|
28 | + parent::__construct ($message, $code, $previous); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -34,9 +34,9 @@ discard block |
||
34 | 34 | * @param \Illuminate\Http\Request $request Incoming request object. |
35 | 35 | * @return \Illuminate\Http\Response|\Illuminate\Contracts\Routing\ResponseFactory |
36 | 36 | */ |
37 | - public function render(\Illuminate\Http\Request $request) |
|
37 | + public function render (\Illuminate\Http\Request $request) |
|
38 | 38 | { |
39 | - return response()->view( |
|
39 | + return response ()->view ( |
|
40 | 40 | 'errors/admin', |
41 | 41 | [ |
42 | 42 | 'exception' => $this, |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * |
55 | 55 | * @return mixed |
56 | 56 | */ |
57 | - public function getStatusCode() |
|
57 | + public function getStatusCode () |
|
58 | 58 | { |
59 | 59 | return 500; |
60 | 60 | } |
@@ -24,11 +24,11 @@ discard block |
||
24 | 24 | * |
25 | 25 | * @return void |
26 | 26 | */ |
27 | - public function boot() |
|
27 | + public function boot () |
|
28 | 28 | { |
29 | 29 | // |
30 | 30 | |
31 | - parent::boot(); |
|
31 | + parent::boot (); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -36,11 +36,11 @@ discard block |
||
36 | 36 | * |
37 | 37 | * @return void |
38 | 38 | */ |
39 | - public function map() |
|
39 | + public function map () |
|
40 | 40 | { |
41 | - $this->mapApiRoutes(); |
|
41 | + $this->mapApiRoutes (); |
|
42 | 42 | |
43 | - $this->mapWebRoutes(); |
|
43 | + $this->mapWebRoutes (); |
|
44 | 44 | |
45 | 45 | // |
46 | 46 | } |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | * |
53 | 53 | * @return void |
54 | 54 | */ |
55 | - protected function mapWebRoutes() |
|
55 | + protected function mapWebRoutes () |
|
56 | 56 | { |
57 | - Route::middleware('web') |
|
58 | - ->namespace($this->namespace) |
|
59 | - ->group(base_path('routes/web.php')); |
|
57 | + Route::middleware ('web') |
|
58 | + ->namespace ($this->namespace) |
|
59 | + ->group (base_path ('routes/web.php')); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @return void |
68 | 68 | */ |
69 | - protected function mapApiRoutes() |
|
69 | + protected function mapApiRoutes () |
|
70 | 70 | { |
71 | - Route::prefix('api') |
|
72 | - ->middleware('api') |
|
73 | - ->namespace($this->namespace) |
|
74 | - ->group(base_path('routes/api.php')); |
|
71 | + Route::prefix ('api') |
|
72 | + ->middleware ('api') |
|
73 | + ->namespace ($this->namespace) |
|
74 | + ->group (base_path ('routes/api.php')); |
|
75 | 75 | } |
76 | 76 | } |
@@ -12,10 +12,10 @@ |
||
12 | 12 | * |
13 | 13 | * @return void |
14 | 14 | */ |
15 | - public function boot() |
|
15 | + public function boot () |
|
16 | 16 | { |
17 | - Broadcast::routes(); |
|
17 | + Broadcast::routes (); |
|
18 | 18 | |
19 | - require base_path('routes/channels.php'); |
|
19 | + require base_path ('routes/channels.php'); |
|
20 | 20 | } |
21 | 21 | } |
@@ -63,15 +63,15 @@ discard block |
||
63 | 63 | * |
64 | 64 | * @return void |
65 | 65 | */ |
66 | - protected function defineGates(): void |
|
66 | + protected function defineGates (): void |
|
67 | 67 | { |
68 | - Gate::define('view-assessment-plan', function ($user, $jobPoster) { |
|
69 | - return $user->isAdmin() || |
|
70 | - $user->isManager() && $jobPoster->manager->user_id === $user->id; |
|
68 | + Gate::define ('view-assessment-plan', function ($user, $jobPoster) { |
|
69 | + return $user->isAdmin () || |
|
70 | + $user->isManager () && $jobPoster->manager->user_id === $user->id; |
|
71 | 71 | }); |
72 | 72 | } |
73 | 73 | |
74 | - public function register(): void |
|
74 | + public function register (): void |
|
75 | 75 | { |
76 | 76 | } |
77 | 77 | |
@@ -80,10 +80,10 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @return void |
82 | 82 | */ |
83 | - public function boot(): void |
|
83 | + public function boot (): void |
|
84 | 84 | { |
85 | - $this->registerPolicies(); |
|
85 | + $this->registerPolicies (); |
|
86 | 86 | |
87 | - $this->defineGates(); |
|
87 | + $this->defineGates (); |
|
88 | 88 | } |
89 | 89 | } |
@@ -13,92 +13,92 @@ discard block |
||
13 | 13 | * |
14 | 14 | * @return void |
15 | 15 | */ |
16 | - public function boot() |
|
16 | + public function boot () |
|
17 | 17 | { |
18 | 18 | // Site Under Construction header bar. |
19 | - View::composer( |
|
19 | + View::composer ( |
|
20 | 20 | 'common/alert', |
21 | 21 | 'App\Http\ViewComposers\AlertComposer' |
22 | 22 | ); |
23 | 23 | |
24 | 24 | // Pass App locale to all views. |
25 | - View::share('appLocale', App::getLocale()); |
|
25 | + View::share ('appLocale', App::getLocale ()); |
|
26 | 26 | |
27 | 27 | // Governement of Canada header bar. |
28 | - View::composer( |
|
28 | + View::composer ( |
|
29 | 29 | 'common/goc', |
30 | 30 | 'App\Http\ViewComposers\GocComposer' |
31 | 31 | ); |
32 | 32 | |
33 | 33 | // Nav menu. |
34 | - View::composer( |
|
34 | + View::composer ( |
|
35 | 35 | '*', |
36 | 36 | 'App\Http\ViewComposers\MenuComposer' |
37 | 37 | ); |
38 | 38 | |
39 | 39 | // Sitewide Footer. |
40 | - View::composer( |
|
40 | + View::composer ( |
|
41 | 41 | 'common/footer', |
42 | 42 | 'App\Http\ViewComposers\FooterComposer' |
43 | 43 | ); |
44 | 44 | |
45 | - View::composer( |
|
45 | + View::composer ( |
|
46 | 46 | 'applicant/profile/menu', |
47 | 47 | 'App\Http\ViewComposers\ApplicantProfileMenuComposer' |
48 | 48 | ); |
49 | 49 | |
50 | - View::composer( |
|
50 | + View::composer ( |
|
51 | 51 | ['common/skill', 'common/relatives', 'applicant/job_post/criteria', 'common/modals/skills_need_help'], |
52 | 52 | 'App\Http\ViewComposers\SkillComposer' |
53 | 53 | ); |
54 | 54 | |
55 | - View::composer( |
|
55 | + View::composer ( |
|
56 | 56 | ['common/reference', 'common/modals/create_reference'], |
57 | 57 | 'App\Http\ViewComposers\ReferenceComposer' |
58 | 58 | ); |
59 | 59 | |
60 | - View::composer( |
|
60 | + View::composer ( |
|
61 | 61 | ['common/sample', 'common/modals/create_sample'], |
62 | 62 | 'App\Http\ViewComposers\WorkSampleComposer' |
63 | 63 | ); |
64 | 64 | |
65 | - View::composer( |
|
66 | - ['common/relatives','common/reference','common/relatives-projects', |
|
65 | + View::composer ( |
|
66 | + ['common/relatives', 'common/reference', 'common/relatives-projects', |
|
67 | 67 | 'common/sample', 'common/skill', 'common/modals/create_reference'], |
68 | 68 | 'App\Http\ViewComposers\RelativeComposer' |
69 | 69 | ); |
70 | 70 | |
71 | - View::composer( |
|
71 | + View::composer ( |
|
72 | 72 | 'common/lang_menu', |
73 | 73 | 'App\Http\ViewComposers\LangMenuComposer' |
74 | 74 | ); |
75 | 75 | |
76 | - View::composer( |
|
76 | + View::composer ( |
|
77 | 77 | ['applicant/application_post/common/tracker', 'applicant/application_post/common/tracker-ajax'], |
78 | 78 | 'App\Http\ViewComposers\ApplicationTrackerComposer' |
79 | 79 | ); |
80 | 80 | |
81 | - View::composer( |
|
81 | + View::composer ( |
|
82 | 82 | 'common/degree', |
83 | 83 | 'App\Http\ViewComposers\DegreeComposer' |
84 | 84 | ); |
85 | 85 | |
86 | - View::composer( |
|
86 | + View::composer ( |
|
87 | 87 | 'common/course', |
88 | 88 | 'App\Http\ViewComposers\CourseComposer' |
89 | 89 | ); |
90 | 90 | |
91 | - View::composer( |
|
91 | + View::composer ( |
|
92 | 92 | 'common/work', |
93 | 93 | 'App\Http\ViewComposers\WorkExperienceComposer' |
94 | 94 | ); |
95 | 95 | |
96 | - View::composer( |
|
96 | + View::composer ( |
|
97 | 97 | 'manager/notification', |
98 | 98 | 'App\Http\ViewComposers\DemoNotificationComposer' |
99 | 99 | ); |
100 | 100 | |
101 | - View::composer( |
|
101 | + View::composer ( |
|
102 | 102 | 'manager/*', |
103 | 103 | 'App\Http\ViewComposers\ManagerPortalComposer' |
104 | 104 | ); |
@@ -109,12 +109,12 @@ discard block |
||
109 | 109 | * |
110 | 110 | * @return void |
111 | 111 | */ |
112 | - public function register() : void |
|
112 | + public function register () : void |
|
113 | 113 | { |
114 | - $this->app->singleton(\App\Http\ViewComposers\CourseComposer::class); |
|
115 | - $this->app->singleton(\App\Http\ViewComposers\DegreeComposer::class); |
|
116 | - $this->app->singleton(\App\Http\ViewComposers\ReferenceComposer::class); |
|
117 | - $this->app->singleton(\App\Http\ViewComposers\SkillComposer::class); |
|
118 | - $this->app->singleton(\App\Http\ViewComposers\WorkSampleComposer::class); |
|
114 | + $this->app->singleton (\App\Http\ViewComposers\CourseComposer::class); |
|
115 | + $this->app->singleton (\App\Http\ViewComposers\DegreeComposer::class); |
|
116 | + $this->app->singleton (\App\Http\ViewComposers\ReferenceComposer::class); |
|
117 | + $this->app->singleton (\App\Http\ViewComposers\SkillComposer::class); |
|
118 | + $this->app->singleton (\App\Http\ViewComposers\WorkSampleComposer::class); |
|
119 | 119 | } |
120 | 120 | } |
@@ -39,9 +39,9 @@ |
||
39 | 39 | * |
40 | 40 | * @return void |
41 | 41 | */ |
42 | - public function boot(): void |
|
42 | + public function boot (): void |
|
43 | 43 | { |
44 | - parent::boot(); |
|
44 | + parent::boot (); |
|
45 | 45 | |
46 | 46 | // |
47 | 47 | } |
@@ -19,21 +19,21 @@ |
||
19 | 19 | * |
20 | 20 | * @return boolean |
21 | 21 | */ |
22 | - public static function isColumnNullable(string $column_name) : bool |
|
22 | + public static function isColumnNullable (string $column_name) : bool |
|
23 | 23 | { |
24 | 24 | // create an instance of the model to be able to get the table name |
25 | 25 | $instance = new static(); |
26 | - $conn = DB::connection($instance->getConnectionName()); |
|
27 | - $table = Config::get('database.connections.'.Config::get('database.default').'.pr e fix').$instance->getTable(); |
|
26 | + $conn = DB::connection ($instance->getConnectionName ()); |
|
27 | + $table = Config::get ('database.connections.'.Config::get ('database.default').'.pr e fix').$instance->getTable (); |
|
28 | 28 | // MongoDB columns are alway nullable |
29 | - if ($conn->getConfig()['driver'] === 'mongodb') { |
|
29 | + if ($conn->getConfig ()['driver'] === 'mongodb') { |
|
30 | 30 | return true; |
31 | 31 | } |
32 | 32 | // register the enum, json, jsonb, and citext column types, because Doctrine doesn't support it |
33 | - $conn->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string'); |
|
34 | - $conn->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('json', 'json_array'); |
|
35 | - $conn->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('jsonb', 'json_array'); |
|
36 | - $conn->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('citext', 'string'); |
|
37 | - return !$conn->getDoctrineColumn($table, $column_name)->getNotnull(); |
|
33 | + $conn->getDoctrineSchemaManager ()->getDatabasePlatform ()->registerDoctrineTypeMapping ('enum', 'string'); |
|
34 | + $conn->getDoctrineSchemaManager ()->getDatabasePlatform ()->registerDoctrineTypeMapping ('json', 'json_array'); |
|
35 | + $conn->getDoctrineSchemaManager ()->getDatabasePlatform ()->registerDoctrineTypeMapping ('jsonb', 'json_array'); |
|
36 | + $conn->getDoctrineSchemaManager ()->getDatabasePlatform ()->registerDoctrineTypeMapping ('citext', 'string'); |
|
37 | + return !$conn->getDoctrineColumn ($table, $column_name)->getNotnull (); |
|
38 | 38 | } |
39 | 39 | } |