@@ -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 | } |
@@ -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 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | * |
15 | 15 | * @return void |
16 | 16 | */ |
17 | - public function __construct() |
|
17 | + public function __construct () |
|
18 | 18 | { |
19 | 19 | } |
20 | 20 | |
@@ -24,15 +24,15 @@ discard block |
||
24 | 24 | * @param JobSaved $event |
25 | 25 | * @return void |
26 | 26 | */ |
27 | - public function handle(JobSaved $event) |
|
27 | + public function handle (JobSaved $event) |
|
28 | 28 | { |
29 | 29 | $job = $event->job; |
30 | 30 | |
31 | 31 | // If job has just been created, log if its being published now |
32 | 32 | // If job is being modified, only want to log when it goes from unpublished to published |
33 | 33 | if (($job->wasRecentlyCreated && $job->published) || |
34 | - (!$job->wasRecentlyCreated && $job->published && !$job->getOriginal('published'))) { |
|
35 | - Log::notice('Job published: job {id='.$job->id.'} published by manager {id='.$job->manager->id.', email='.$job->manager->user->email.'}'); |
|
34 | + (!$job->wasRecentlyCreated && $job->published && !$job->getOriginal ('published'))) { |
|
35 | + Log::notice ('Job published: job {id='.$job->id.'} published by manager {id='.$job->manager->id.', email='.$job->manager->user->email.'}'); |
|
36 | 36 | } |
37 | 37 | } |
38 | 38 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | * |
15 | 15 | * @return void |
16 | 16 | */ |
17 | - public function __construct() |
|
17 | + public function __construct () |
|
18 | 18 | { |
19 | 19 | // |
20 | 20 | } |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | * @param Login $event |
27 | 27 | * @return void |
28 | 28 | */ |
29 | - public function handle(Login $event) |
|
29 | + public function handle (Login $event) |
|
30 | 30 | { |
31 | 31 | $user = $event->user; |
32 | - Log::notice("Login by user {id=".$user->id.", email=".$user->email.", role=".$user->user_role->name."}"); |
|
32 | + Log::notice ("Login by user {id=".$user->id.", email=".$user->email.", role=".$user->user_role->name."}"); |
|
33 | 33 | } |
34 | 34 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | * |
15 | 15 | * @return void |
16 | 16 | */ |
17 | - public function __construct() |
|
17 | + public function __construct () |
|
18 | 18 | { |
19 | 19 | // |
20 | 20 | } |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | * @param UserUpdated $event |
26 | 26 | * @return void |
27 | 27 | */ |
28 | - public function handle(UserUpdated $event) |
|
28 | + public function handle (UserUpdated $event) |
|
29 | 29 | { |
30 | - Log::notice("User updated: ".$event->user); |
|
30 | + Log::notice ("User updated: ".$event->user); |
|
31 | 31 | } |
32 | 32 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * |
13 | 13 | * @return void |
14 | 14 | */ |
15 | - public function __construct() |
|
15 | + public function __construct () |
|
16 | 16 | { |
17 | 17 | } |
18 | 18 | |
@@ -22,16 +22,16 @@ discard block |
||
22 | 22 | * @param UserUpdated $event Fires after successful database update. |
23 | 23 | * @return void |
24 | 24 | */ |
25 | - public function handle(UserUpdated $event) : void |
|
25 | + public function handle (UserUpdated $event) : void |
|
26 | 26 | { |
27 | - if ($event->user->isManager() || |
|
28 | - $event->user->isAdmin() |
|
27 | + if ($event->user->isManager () || |
|
28 | + $event->user->isAdmin () |
|
29 | 29 | ) { |
30 | - $managerProfile = Manager::where('user_id', $event->user->id)->first(); |
|
30 | + $managerProfile = Manager::where ('user_id', $event->user->id)->first (); |
|
31 | 31 | if ($managerProfile === null) { |
32 | - $managerProfile = new Manager(); |
|
32 | + $managerProfile = new Manager (); |
|
33 | 33 | $managerProfile->user_id = $event->user->id; |
34 | - $managerProfile->save(); |
|
34 | + $managerProfile->save (); |
|
35 | 35 | } |
36 | 36 | } |
37 | 37 | } |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * |
16 | 16 | * @return void |
17 | 17 | */ |
18 | - public function __construct() |
|
18 | + public function __construct () |
|
19 | 19 | { |
20 | 20 | // |
21 | 21 | } |
@@ -26,30 +26,30 @@ discard block |
||
26 | 26 | * @param ApplicationSaved $event |
27 | 27 | * @return void |
28 | 28 | */ |
29 | - public function handle(ApplicationSaved $event) |
|
29 | + public function handle (ApplicationSaved $event) |
|
30 | 30 | { |
31 | 31 | $application = $event->application; |
32 | 32 | |
33 | - if (Auth::check()) { |
|
34 | - $user = Auth::user(); |
|
33 | + if (Auth::check ()) { |
|
34 | + $user = Auth::user (); |
|
35 | 35 | $userText = "{id=".$user->id.", email=".$user->email."}"; |
36 | 36 | } else { |
37 | 37 | $userText = "{null}"; |
38 | 38 | } |
39 | 39 | |
40 | 40 | //Log when application is first created |
41 | - if($application->wasRecentlyCreated) { |
|
41 | + if ($application->wasRecentlyCreated) { |
|
42 | 42 | $applicationText = "{id=".$application->id.", status=".$application->application_status->name."}"; |
43 | 43 | |
44 | - Log::notice("Application created: application ".$applicationText." has been created by user ".$userText); |
|
44 | + Log::notice ("Application created: application ".$applicationText." has been created by user ".$userText); |
|
45 | 45 | } |
46 | 46 | //Log if application status has been changed |
47 | - else if ($application->application_status_id != $application->getOriginal('application_status_id')) { |
|
48 | - $freshApplication = $application->fresh(); |
|
47 | + else if ($application->application_status_id != $application->getOriginal ('application_status_id')) { |
|
48 | + $freshApplication = $application->fresh (); |
|
49 | 49 | $applicationText = "{id=".$freshApplication->id."}"; |
50 | 50 | $statusText = "{".$freshApplication->application_status->name."}"; |
51 | 51 | |
52 | - Log::notice("Application status changed: application ".$applicationText." has been changed to ".$statusText." by user ".$userText); |
|
52 | + Log::notice ("Application status changed: application ".$applicationText." has been changed to ".$statusText." by user ".$userText); |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | } |