@@ -13,7 +13,7 @@ |
||
13 | 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 |
@@ -13,7 +13,7 @@ |
||
13 | 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 |
@@ -28,8 +28,8 @@ |
||
28 | 28 | * @property string $level_description The localized description of the skill level (accounts for skill type). |
29 | 29 | * |
30 | 30 | * Localized Properties: |
31 | - * @property string $description |
|
32 | - * @property string $specificity |
|
31 | + * @property string $description |
|
32 | + * @property string $specificity |
|
33 | 33 | */ |
34 | 34 | class Criteria extends BaseModel |
35 | 35 | { |
@@ -65,27 +65,27 @@ discard block |
||
65 | 65 | |
66 | 66 | public function criteria_type() //phpcs:ignore |
67 | 67 | { |
68 | - return $this->belongsTo(\App\Models\Lookup\CriteriaType::class); |
|
68 | + return $this->belongsTo (\App\Models\Lookup\CriteriaType::class); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | public function job_poster() //phpcs:ignore |
72 | 72 | { |
73 | - return $this->belongsTo(\App\Models\JobPoster::class); |
|
73 | + return $this->belongsTo (\App\Models\JobPoster::class); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | public function skill() |
77 | 77 | { |
78 | - return $this->belongsTo(\App\Models\Skill::class); |
|
78 | + return $this->belongsTo (\App\Models\Skill::class); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | public function skill_level() //phpcs:ignore |
82 | 82 | { |
83 | - return $this->belongsTo(\App\Models\Lookup\SkillLevel::class); |
|
83 | + return $this->belongsTo (\App\Models\Lookup\SkillLevel::class); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | public function criteria_translations() //phpcs:ignore |
87 | 87 | { |
88 | - return $this->hasMany(\App\Models\Lookup\CriteriaTypeTranslation::class); |
|
88 | + return $this->hasMany (\App\Models\Lookup\CriteriaTypeTranslation::class); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function assessments() // phpcs:ignore |
97 | 97 | { |
98 | - return $this->hasMany(\App\Models\Assessment::class, 'criterion_id'); |
|
98 | + return $this->hasMany (\App\Models\Assessment::class, 'criterion_id'); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | { |
108 | 108 | $level = $this->skill_level->name; |
109 | 109 | $type = $this->skill->skill_type->name; |
110 | - return Lang::get("common/lookup/skill_level.$level.$type.name"); |
|
110 | + return Lang::get ("common/lookup/skill_level.$level.$type.name"); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -119,6 +119,6 @@ discard block |
||
119 | 119 | { |
120 | 120 | $level = $this->skill_level->name; |
121 | 121 | $type = $this->skill->skill_type->name; |
122 | - return Lang::get("common/lookup/skill_level.$level.$type.description"); |
|
122 | + return Lang::get ("common/lookup/skill_level.$level.$type.description"); |
|
123 | 123 | } |
124 | 124 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | * @property \Jenssegers\Date\Date $created_at |
13 | 13 | * @property \Jenssegers\Date\Date $updated_at |
14 | 14 | */ |
15 | -class Frequency extends BaseModel { |
|
15 | +class Frequency extends BaseModel{ |
|
16 | 16 | |
17 | 17 | protected $fillable = []; |
18 | 18 |
@@ -12,11 +12,11 @@ |
||
12 | 12 | class CriteriaController extends Controller |
13 | 13 | { |
14 | 14 | /** |
15 | - * Converts a Criteria to the shape sent and recieved by the api. |
|
16 | - * |
|
17 | - * @param Criteria $model |
|
18 | - * @return void |
|
19 | - */ |
|
15 | + * Converts a Criteria to the shape sent and recieved by the api. |
|
16 | + * |
|
17 | + * @param Criteria $model |
|
18 | + * @return void |
|
19 | + */ |
|
20 | 20 | public function toApiArray(Criteria $model) |
21 | 21 | { |
22 | 22 | return array_merge($model->toArray(), $model->getTranslationsArray()); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public function toApiArray(Criteria $model) |
21 | 21 | { |
22 | - return array_merge($model->toArray(), $model->getTranslationsArray()); |
|
22 | + return array_merge ($model->toArray (), $model->getTranslationsArray ()); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | public function indexByJob(JobPoster $jobPoster) |
32 | 32 | { |
33 | 33 | $toApiArray = array($this, 'toApiArray'); |
34 | - $criteriaAray = Criteria::where('job_poster_id', $jobPoster->id)->get()->map($toApiArray); |
|
35 | - return response()->json($criteriaAray); |
|
34 | + $criteriaAray = Criteria::where ('job_poster_id', $jobPoster->id)->get ()->map ($toApiArray); |
|
35 | + return response ()->json ($criteriaAray); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -46,39 +46,39 @@ discard block |
||
46 | 46 | { |
47 | 47 | $toApiArray = array($this, 'toApiArray'); |
48 | 48 | |
49 | - $newCriteria = collect($request->input()); // TODO: switch to validated |
|
49 | + $newCriteria = collect ($request->input ()); // TODO: switch to validated |
|
50 | 50 | $oldCriteria = $jobPoster->criteria; |
51 | 51 | |
52 | 52 | $updatedIds = []; |
53 | 53 | |
54 | 54 | // First, delete old criteria that weren't resubmitted, and update those that were |
55 | 55 | foreach ($oldCriteria as $criteria) { |
56 | - $newData = $newCriteria->firstWhere('id', $criteria['id']); |
|
56 | + $newData = $newCriteria->firstWhere ('id', $criteria['id']); |
|
57 | 57 | if ($newData) { |
58 | 58 | $updatedIds[] = $criteria->id; |
59 | - $this->updateCriteria($criteria, $newData); |
|
59 | + $this->updateCriteria ($criteria, $newData); |
|
60 | 60 | } else { |
61 | - $this->deleteCriteria($criteria); |
|
61 | + $this->deleteCriteria ($criteria); |
|
62 | 62 | } |
63 | 63 | } |
64 | 64 | |
65 | 65 | $isUnsaved = function ($criteria, $savedIds): bool { |
66 | - return !array_key_exists('id', $criteria) || !in_array($criteria['id'], $savedIds); |
|
66 | + return !array_key_exists ('id', $criteria) || !in_array ($criteria['id'], $savedIds); |
|
67 | 67 | }; |
68 | 68 | |
69 | 69 | // Now, save any new criteria that remain |
70 | 70 | foreach ($newCriteria as $criteriaData) { |
71 | - if ($isUnsaved($criteriaData, $updatedIds)) { |
|
72 | - $criteria = new Criteria(); |
|
71 | + if ($isUnsaved ($criteriaData, $updatedIds)) { |
|
72 | + $criteria = new Criteria (); |
|
73 | 73 | $criteria->job_poster_id = $jobPoster->id; |
74 | - $fillableData = collect($criteriaData)->except(['id', 'job_poster_id'])->toArray(); |
|
75 | - $criteria->fill($fillableData); |
|
76 | - $this->createCriteria($criteria); |
|
74 | + $fillableData = collect ($criteriaData)->except (['id', 'job_poster_id'])->toArray (); |
|
75 | + $criteria->fill ($fillableData); |
|
76 | + $this->createCriteria ($criteria); |
|
77 | 77 | } |
78 | 78 | } |
79 | 79 | |
80 | - $criteriaAray = Criteria::where('job_poster_id', $jobPoster->id)->get()->map($toApiArray); |
|
81 | - return response()->json($criteriaAray); |
|
80 | + $criteriaAray = Criteria::where ('job_poster_id', $jobPoster->id)->get ()->map ($toApiArray); |
|
81 | + return response ()->json ($criteriaAray); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -89,13 +89,13 @@ discard block |
||
89 | 89 | */ |
90 | 90 | protected function createCriteria(Criteria $criteria) |
91 | 91 | { |
92 | - $criteria->save(); |
|
92 | + $criteria->save (); |
|
93 | 93 | |
94 | - $notification = $this->makeAssessmentPlanNotification( |
|
94 | + $notification = $this->makeAssessmentPlanNotification ( |
|
95 | 95 | 'CREATE', |
96 | 96 | $criteria |
97 | 97 | ); |
98 | - $notification->save(); |
|
98 | + $notification->save (); |
|
99 | 99 | |
100 | 100 | return $criteria; |
101 | 101 | } |
@@ -113,19 +113,19 @@ discard block |
||
113 | 113 | if ($oldCriteria->skill_level_id != $newData['skill_level_id'] |
114 | 114 | || $oldCriteria->skill_id != $newData['skill_id'] |
115 | 115 | ) { |
116 | - $notification = $this->makeAssessmentPlanNotification( |
|
116 | + $notification = $this->makeAssessmentPlanNotification ( |
|
117 | 117 | 'UPDATE', |
118 | 118 | $oldCriteria, |
119 | 119 | $newData['skill_id'], |
120 | 120 | $newData['skill_level_id'], |
121 | 121 | $newData['criteria_type_id'] |
122 | 122 | ); |
123 | - $notification->save(); |
|
123 | + $notification->save (); |
|
124 | 124 | } |
125 | 125 | // Get just the data that can be changed |
126 | - $fillableData = collect($newData)->except(['id', 'job_poster_id'])->toArray(); |
|
127 | - $oldCriteria->fill($fillableData); |
|
128 | - $oldCriteria->save(); |
|
126 | + $fillableData = collect ($newData)->except (['id', 'job_poster_id'])->toArray (); |
|
127 | + $oldCriteria->fill ($fillableData); |
|
128 | + $oldCriteria->save (); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -136,15 +136,15 @@ discard block |
||
136 | 136 | */ |
137 | 137 | protected function deleteCriteria(Criteria $criteria): void |
138 | 138 | { |
139 | - $notification = $notification = $this->makeAssessmentPlanNotification( |
|
139 | + $notification = $notification = $this->makeAssessmentPlanNotification ( |
|
140 | 140 | 'DELETE', |
141 | 141 | $criteria |
142 | 142 | ); |
143 | - $notification->save(); |
|
143 | + $notification->save (); |
|
144 | 144 | |
145 | 145 | // Delete assessments related to this criteria. |
146 | - Assessment::where('criterion_id', $criteria->id)->delete(); |
|
147 | - $criteria->delete(); |
|
146 | + Assessment::where ('criterion_id', $criteria->id)->delete (); |
|
147 | + $criteria->delete (); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -163,8 +163,8 @@ discard block |
||
163 | 163 | $newSkillId = null, |
164 | 164 | $newSkillLevelId = null, |
165 | 165 | $newCriteriaTypeId = null |
166 | - ) { |
|
167 | - $notification = new AssessmentPlanNotification(); |
|
166 | + ){ |
|
167 | + $notification = new AssessmentPlanNotification (); |
|
168 | 168 | $notification->job_poster_id = $criteria->job_poster_id; |
169 | 169 | $notification->type = $type; |
170 | 170 | $notification->criteria_id = $criteria->id; |
@@ -5,16 +5,16 @@ |
||
5 | 5 | // -------------------------- |
6 | 6 | // This route file is loaded automatically by Backpack\Base. |
7 | 7 | // Routes you generate using Backpack\Generators will be placed here. |
8 | -Route::group([ |
|
9 | - 'prefix' => config('backpack.base.route_prefix', 'admin'), |
|
10 | - 'middleware' => ['web', config('backpack.base.middleware_key', 'admin')], |
|
8 | +Route::group ([ |
|
9 | + 'prefix' => config ('backpack.base.route_prefix', 'admin'), |
|
10 | + 'middleware' => ['web', config ('backpack.base.middleware_key', 'admin')], |
|
11 | 11 | 'namespace' => 'App\Http\Controllers\Admin', |
12 | 12 | ], function () : void { |
13 | 13 | // Custom admin routes. |
14 | - Route::crud('skill', 'SkillCrudController'); |
|
15 | - Route::crud('job-poster', 'JobPosterCrudController'); |
|
16 | - Route::crud('user', 'UserCrudController'); |
|
17 | - Route::crud('manager', 'ManagerCrudController'); |
|
18 | - Route::crud('department', 'DepartmentCrudController'); |
|
19 | - Route::crud('classification', 'ClassificationCrudController'); |
|
14 | + Route::crud ('skill', 'SkillCrudController'); |
|
15 | + Route::crud ('job-poster', 'JobPosterCrudController'); |
|
16 | + Route::crud ('user', 'UserCrudController'); |
|
17 | + Route::crud ('manager', 'ManagerCrudController'); |
|
18 | + Route::crud ('department', 'DepartmentCrudController'); |
|
19 | + Route::crud ('classification', 'ClassificationCrudController'); |
|
20 | 20 | }); |
@@ -57,11 +57,11 @@ |
||
57 | 57 | public function toMail($notifiable) |
58 | 58 | { |
59 | 59 | return (new MailMessage) |
60 | - ->subject(Lang::get('common/notifications/password_reset.subject')) |
|
61 | - ->greeting(Lang::get('common/notifications/password_reset.greeting')) |
|
62 | - ->line(Lang::get('common/notifications/password_reset.line_1')) |
|
63 | - ->action(Lang::get('common/notifications/password_reset.action'), url(route('password.reset', $this->token, false))) |
|
64 | - ->line(Lang::get('common/notifications/password_reset.line_2')) |
|
65 | - ->salutation(Lang::get('common/notifications/password_reset.salutation', ['name' => config('mail.from.name')])); |
|
60 | + ->subject (Lang::get ('common/notifications/password_reset.subject')) |
|
61 | + ->greeting (Lang::get ('common/notifications/password_reset.greeting')) |
|
62 | + ->line (Lang::get ('common/notifications/password_reset.line_1')) |
|
63 | + ->action (Lang::get ('common/notifications/password_reset.action'), url (route ('password.reset', $this->token, false))) |
|
64 | + ->line (Lang::get ('common/notifications/password_reset.line_2')) |
|
65 | + ->salutation (Lang::get ('common/notifications/password_reset.salutation', ['name' => config ('mail.from.name')])); |
|
66 | 66 | } |
67 | 67 | } |
@@ -23,17 +23,17 @@ |
||
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 | } |
@@ -30,18 +30,18 @@ |
||
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 | |
36 | 36 | //Don't bother logging when an applicant views their own application |
37 | 37 | if ($application->applicant->user->id != $user->id) { |
38 | 38 | $applicationText = "{id=$application->id}"; |
39 | 39 | $userText = "{id=$user->id, email=$user->email}"; |
40 | - Log::notice("Application viewed: application $applicationText viewed by user $userText."); |
|
40 | + Log::notice ("Application viewed: application $applicationText viewed by user $userText."); |
|
41 | 41 | } |
42 | 42 | } else { |
43 | 43 | $applicationText = "{id=$application->id}"; |
44 | - Log::notice("Application retrieved: application $applicationText retrieved with no user logged in."); |
|
44 | + Log::notice ("Application retrieved: application $applicationText retrieved with no user logged in."); |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 | } |
@@ -29,6 +29,6 @@ |
||
29 | 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 | } |