@@ -8,9 +8,9 @@ |
||
| 8 | 8 | use Rector\Set\ValueObject\SetList; |
| 9 | 9 | use RectorLaravel\Set\LaravelSetList; |
| 10 | 10 | |
| 11 | -return static function (RectorConfig $rectorConfig): void { |
|
| 11 | +return static function(RectorConfig $rectorConfig): void { |
|
| 12 | 12 | $rectorConfig->paths([ |
| 13 | - __DIR__ . '/src', |
|
| 13 | + __DIR__.'/src', |
|
| 14 | 14 | ]); |
| 15 | 15 | |
| 16 | 16 | // register a single rule |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | public function getCanReapplyAttribute($query) |
| 38 | 38 | { |
| 39 | 39 | // if corporation does not have any applications, allow user to apply without further verif |
| 40 | - if($this->applications()->count() < 1) { |
|
| 40 | + if ($this->applications()->count() < 1) { |
|
| 41 | 41 | return true; |
| 42 | 42 | } |
| 43 | 43 | // get user's profile id and check if their last (based on created_at) app allows re-apply |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $applications = $this->applications()->where('profile_id', $profile_id)->latest('created_at'); |
| 46 | 46 | |
| 47 | 47 | // if user does not have any applications, return true |
| 48 | - if($applications->count() < 1) { |
|
| 48 | + if ($applications->count() < 1) { |
|
| 49 | 49 | return true; |
| 50 | 50 | } |
| 51 | 51 | |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | |
| 7 | 7 | class SeatHrProfile extends Model |
| 8 | 8 | { |
| 9 | - protected $fillable = [ 'user_id', 'probation']; |
|
| 9 | + protected $fillable = ['user_id', 'probation']; |
|
| 10 | 10 | protected $casts = [ |
| 11 | 11 | 'probation' => 'boolean', |
| 12 | 12 | ]; |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | Route::group([ |
| 18 | 18 | 'namespace' => 'user', |
| 19 | 19 | 'prefix' => 'user', |
| 20 | - ], function (): void { |
|
| 20 | + ], function(): void { |
|
| 21 | 21 | Route::get('/{character?}', [ |
| 22 | 22 | 'uses' => 'UserController@index', |
| 23 | 23 | 'as' => 'seat-hr.profile', |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | Route::group([ |
| 39 | 39 | 'prefix' => '/{character}/applications', |
| 40 | - ], function (): void { |
|
| 40 | + ], function(): void { |
|
| 41 | 41 | |
| 42 | 42 | // TODO: fix middleware permissions to use seat-hr permissions |
| 43 | 43 | Route::get('/', [ |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | 'middleware' => 'can:character.sheet,character', |
| 47 | 47 | ]); |
| 48 | 48 | |
| 49 | - Route::match([ 'get', 'post' ], '/apply/{corporation?}', [ |
|
| 49 | + Route::match(['get', 'post'], '/apply/{corporation?}', [ |
|
| 50 | 50 | 'uses' => 'ApplicationController@apply', |
| 51 | 51 | 'as' => 'seat-hr.profile.applications.apply', |
| 52 | 52 | 'middleware' => 'can:character.sheet,character', |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | Route::group([ |
| 65 | 65 | 'prefix' => '/{character}/blacklist', |
| 66 | 66 | 'middleware' => 'can:seat-hr.officer', |
| 67 | - ], function (): void{ |
|
| 67 | + ], function(): void{ |
|
| 68 | 68 | Route::get('/', [ |
| 69 | 69 | 'uses' => 'BlackListController@index', |
| 70 | 70 | 'as' => 'seat-hr.profile.blacklist', |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | Route::group([ |
| 90 | 90 | 'prefix' => '/{character}/kickhistory', |
| 91 | 91 | 'middleware' => 'can:seat-hr.officer', |
| 92 | - ], function (): void{ |
|
| 92 | + ], function(): void{ |
|
| 93 | 93 | Route::get('/', [ |
| 94 | 94 | 'uses' => 'KickHistoryController@index', |
| 95 | 95 | 'as' => 'seat-hr.profile.kickhistory', |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | Route::group([ |
| 115 | 115 | 'prefix' => '/{character}/notes', |
| 116 | 116 | 'middleware' => 'can:seat-hr.officer', |
| 117 | - ], function (): void{ |
|
| 117 | + ], function(): void{ |
|
| 118 | 118 | Route::get('/', [ |
| 119 | 119 | 'uses' => 'NoteController@index', |
| 120 | 120 | 'as' => 'seat-hr.profile.note', |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | 'namespace' => 'review', |
| 143 | 143 | 'prefix' => '/review', |
| 144 | 144 | 'middleware' => 'can:seat-hr.officer', |
| 145 | - ], function (): void { |
|
| 145 | + ], function(): void { |
|
| 146 | 146 | Route::get('/', [ |
| 147 | 147 | 'uses' => 'ReviewController@index', |
| 148 | 148 | 'as' => 'seat-hr.review.index' |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | Route::group([ |
| 166 | 166 | 'prefix' => '/applications/{application}', |
| 167 | - ], function (): void { |
|
| 167 | + ], function(): void { |
|
| 168 | 168 | Route::match(['get', 'post'], '/review', [ |
| 169 | 169 | 'uses' => 'ReviewController@application_review', |
| 170 | 170 | 'as' => 'seat-hr.review.application.review', |
@@ -204,28 +204,28 @@ discard block |
||
| 204 | 204 | 'namespace' => 'configuration', |
| 205 | 205 | 'prefix' => 'config', |
| 206 | 206 | 'middleware' => 'can:seat-hr.admin', |
| 207 | - ], function (): void { |
|
| 207 | + ], function(): void { |
|
| 208 | 208 | |
| 209 | 209 | Route::group([ |
| 210 | 210 | 'prefix' => 'corp', |
| 211 | - ], function (): void { |
|
| 211 | + ], function(): void { |
|
| 212 | 212 | |
| 213 | 213 | Route::get('/', [ |
| 214 | 214 | 'uses' => 'CorporationController@view', |
| 215 | 215 | 'as' => 'seat-hr.config.corp.view', |
| 216 | 216 | ]); |
| 217 | 217 | |
| 218 | - Route::match([ 'get', 'post' ], '/create', [ |
|
| 218 | + Route::match(['get', 'post'], '/create', [ |
|
| 219 | 219 | 'uses' => 'CorporationController@create', |
| 220 | 220 | 'as' => 'seat-hr.config.corp.create', |
| 221 | 221 | ]); |
| 222 | 222 | |
| 223 | - Route::match([ 'get', 'post' ], '/edit/{id}', [ |
|
| 223 | + Route::match(['get', 'post'], '/edit/{id}', [ |
|
| 224 | 224 | 'uses' => 'CorporationController@edit', |
| 225 | 225 | 'as' => 'seat-hr.config.corp.edit', |
| 226 | 226 | ]); |
| 227 | 227 | |
| 228 | - Route::match([ 'get', 'post' ], '/delete/{id}', [ |
|
| 228 | + Route::match(['get', 'post'], '/delete/{id}', [ |
|
| 229 | 229 | 'uses' => 'CorporationController@delete', |
| 230 | 230 | 'as' => 'seat-hr.config.corp.delete', |
| 231 | 231 | ]); |
@@ -234,19 +234,19 @@ discard block |
||
| 234 | 234 | |
| 235 | 235 | Route::group([ |
| 236 | 236 | 'prefix' => 'question', |
| 237 | - ], function (): void { |
|
| 237 | + ], function(): void { |
|
| 238 | 238 | |
| 239 | 239 | Route::get('/', [ |
| 240 | 240 | 'uses' => 'QuestionController@view', |
| 241 | 241 | 'as' => 'seat-hr.config.question.view', |
| 242 | 242 | ]); |
| 243 | 243 | |
| 244 | - Route::match([ 'get', 'post' ], '/create', [ |
|
| 244 | + Route::match(['get', 'post'], '/create', [ |
|
| 245 | 245 | 'uses' => 'QuestionController@create', |
| 246 | 246 | 'as' => 'seat-hr.config.question.create', |
| 247 | 247 | ]); |
| 248 | 248 | |
| 249 | - Route::match([ 'get', 'post' ], '/edit/{id}', [ |
|
| 249 | + Route::match(['get', 'post'], '/edit/{id}', [ |
|
| 250 | 250 | 'uses' => 'QuestionController@edit', |
| 251 | 251 | 'as' => 'seat-hr.config.question.edit', |
| 252 | 252 | ]); |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | |
| 261 | 261 | Route::group([ |
| 262 | 262 | 'prefix' => 'corporation-question', |
| 263 | - ], function (): void { |
|
| 263 | + ], function(): void { |
|
| 264 | 264 | Route::get('/{id}', [ |
| 265 | 265 | 'uses' => 'CorporationQuestionController@view', |
| 266 | 266 | 'as' => 'seat-hr.config.corporation-question.view', |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | $question->fill($data); |
| 67 | - if(!$question->isDirty()) |
|
| 67 | + if (!$question->isDirty()) |
|
| 68 | 68 | { |
| 69 | 69 | return redirect()->route('seat-hr.config.question.view') |
| 70 | 70 | ->with('info', 'No changes found; question not updated.'); |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | $corporation->fill($data); |
| 73 | - if(!$corporation->isDirty()){ |
|
| 73 | + if (!$corporation->isDirty()) { |
|
| 74 | 74 | return redirect()->route('seat-hr.config.corp.view') |
| 75 | 75 | ->with('info', 'No changes found; corporation not updated.'); |
| 76 | 76 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | public function application_review(SeatHrCorporation $corporation, SeatHrApplication $application) |
| 36 | 36 | { |
| 37 | - if($application->currentStatus->status_id === 2) { |
|
| 37 | + if ($application->currentStatus->status_id === 2) { |
|
| 38 | 38 | return redirect()->back()->withErrors('Application is already in review.'); |
| 39 | 39 | } |
| 40 | 40 | $application->status()->update(['active' => false]); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | public function application_approve(SeatHrCorporation $corporation, SeatHrApplication $application) |
| 52 | 52 | { |
| 53 | - if($application->currentStatus->status_id === 3) { |
|
| 53 | + if ($application->currentStatus->status_id === 3) { |
|
| 54 | 54 | return redirect()->back()->withErrors('Application is already approved.'); |
| 55 | 55 | } |
| 56 | 56 | $application->status()->update(['active' => false]); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | public function application_cancel(SeatHrCorporation $corporation, SeatHrApplication $application) |
| 68 | 68 | { |
| 69 | - if($application->currentStatus->status_id === 4) { |
|
| 69 | + if ($application->currentStatus->status_id === 4) { |
|
| 70 | 70 | return redirect()->back()->withErrors('Application is already cancelled.'); |
| 71 | 71 | } |
| 72 | 72 | $application->status()->update(['active' => false]); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | public function application_reject(SeatHrCorporation $corporation, SeatHrApplication $application) |
| 84 | 84 | { |
| 85 | - if($application->currentStatus->status_id === 5) { |
|
| 85 | + if ($application->currentStatus->status_id === 5) { |
|
| 86 | 86 | return redirect()->back()->withErrors('Application is already rejected.'); |
| 87 | 87 | } |
| 88 | 88 | $application->status()->update(['active' => false]); |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | public function application_toggle_reapply(SeatHrCorporation $corporation, SeatHrApplication $application) |
| 100 | 100 | { |
| 101 | - if($application->currentStatus->status_id < 3) { |
|
| 101 | + if ($application->currentStatus->status_id < 3) { |
|
| 102 | 102 | return redirect()->back()->withErrors('Application needs to have a decision before allowing to re-apply.'); |
| 103 | 103 | } |
| 104 | 104 | |
@@ -26,15 +26,15 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | public function apply(Request $request, CharacterInfo $character, SeatHrCorporation $corporation = null) { |
| 28 | 28 | // POST, process submitted application |
| 29 | - if($request->isMethod('POST')) { |
|
| 30 | - if(!$corporation instanceof \Cryocaustik\SeatHr\models\SeatHrCorporation) { |
|
| 29 | + if ($request->isMethod('POST')) { |
|
| 30 | + if (!$corporation instanceof \Cryocaustik\SeatHr\models\SeatHrCorporation) { |
|
| 31 | 31 | return redirect()->back()->withErrors('Invalid or missing corporation Id'); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | $available_questions = $corporation->questions()->active()->get(); |
| 35 | 35 | // because validator will literally reindex and overwrite your object keys if you use integers!!! |
| 36 | 36 | $question_ids = array_map( |
| 37 | - fn($v): string => 'id-' . $v, |
|
| 37 | + fn($v): string => 'id-'.$v, |
|
| 38 | 38 | $available_questions->pluck('question_id')->toArray() |
| 39 | 39 | ); |
| 40 | 40 | |
@@ -42,15 +42,15 @@ discard block |
||
| 42 | 42 | $rules = []; |
| 43 | 43 | $attributes = []; |
| 44 | 44 | |
| 45 | - foreach($available_questions as $q) { |
|
| 46 | - $id = 'id-'. $q->question_id; |
|
| 45 | + foreach ($available_questions as $q) { |
|
| 46 | + $id = 'id-'.$q->question_id; |
|
| 47 | 47 | $type = $q->question->type; |
| 48 | 48 | |
| 49 | 49 | // validator does not have rules for type text |
| 50 | - if($type == 'text'){ $type = 'string'; } |
|
| 50 | + if ($type == 'text') { $type = 'string'; } |
|
| 51 | 51 | |
| 52 | 52 | // validator does not have a rule for datetime specifically |
| 53 | - if($type == 'datetime') { $type = 'date'; } |
|
| 53 | + if ($type == 'datetime') { $type = 'date'; } |
|
| 54 | 54 | |
| 55 | 55 | $rules[$id] = ['required', $type]; |
| 56 | 56 | $attributes[$id] = $q->question->name; |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | return back()->withErrors($validator->errors()); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - $profile = SeatHrProfile::firstOrCreate([ 'user_id' => $character->user->id ]); |
|
| 64 | + $profile = SeatHrProfile::firstOrCreate(['user_id' => $character->user->id]); |
|
| 65 | 65 | $application = SeatHrApplication::create([ |
| 66 | 66 | 'corporation_id' => $corporation->id, |
| 67 | 67 | 'profile_id' => $profile->id, |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | // no corporation specified, return list of recruiting corps |
| 86 | - if(!$corporation instanceof \Cryocaustik\SeatHr\models\SeatHrCorporation) { |
|
| 86 | + if (!$corporation instanceof \Cryocaustik\SeatHr\models\SeatHrCorporation) { |
|
| 87 | 87 | $recruiting_corps = SeatHrCorporation::recruiting()->get(); |
| 88 | 88 | return view('seat-hr::user.applications.apply', ['recruiting_corps' => $recruiting_corps]); |
| 89 | 89 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | public function create(Request $request, CharacterInfo $character) |
| 19 | 19 | { |
| 20 | - if($request->isMethod('post')) |
|
| 20 | + if ($request->isMethod('post')) |
|
| 21 | 21 | { |
| 22 | 22 | $data = $request->only([ |
| 23 | 23 | 'kicked_by', |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | return back()->withErrors($validator->errors()); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - $profile = SeatHrProfile::firstOrCreate([ 'user_id' => $character->user->id ]); |
|
| 38 | + $profile = SeatHrProfile::firstOrCreate(['user_id' => $character->user->id]); |
|
| 39 | 39 | $data['profile_id'] = $profile->id; |
| 40 | 40 | $data['created_by'] = auth()->user()->id; |
| 41 | 41 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | public function edit(Request $request, CharacterInfo $character, SeatHrKickHistory $kickhistory) |
| 52 | 52 | { |
| 53 | - if($request->isMethod('post')) |
|
| 53 | + if ($request->isMethod('post')) |
|
| 54 | 54 | { |
| 55 | 55 | $data = $request->only([ |
| 56 | 56 | 'kicked_by', |