@@ -28,11 +28,11 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | $this->dbWiki->table('user') |
| 30 | 30 | ->orderBy('user.user_id', 'desc') |
| 31 | - ->chunk(200, function ($records){ |
|
| 31 | + ->chunk(200, function($records) { |
|
| 32 | 32 | foreach ($records as $record) { |
| 33 | 33 | |
| 34 | 34 | $user = $this->userRepository->getByEmail($record->user_email); |
| 35 | - if(!isset($user)){ |
|
| 35 | + if (!isset($user)) { |
|
| 36 | 36 | continue; |
| 37 | 37 | } |
| 38 | 38 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $editsOnWiki = $this->getEditsOnWikiNumber($record->user_id); |
| 43 | 43 | |
| 44 | 44 | |
| 45 | - $numberContributions = $questions + $answers + $votes + $editsOnWiki; |
|
| 45 | + $numberContributions = $questions+$answers+$votes+$editsOnWiki; |
|
| 46 | 46 | $fields = [ |
| 47 | 47 | 'number_contributions' => $numberContributions, |
| 48 | 48 | 'number_questions' => $questions, |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | public function showLoginForm(Request $request) |
| 26 | 26 | { |
| 27 | 27 | session()->reflash(); |
| 28 | - if($request->has('wiki_callback')){ |
|
| 28 | + if ($request->has('wiki_callback')) { |
|
| 29 | 29 | session()->flash('wiki_callback', $request->input('wiki_callback')); |
| 30 | 30 | session()->flash('wiki_token', $request->input('wiki_token')); |
| 31 | 31 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | public function logout(Request $request) |
| 36 | 36 | { |
| 37 | - if($request->session()->has('should_attach_to_organization')) { |
|
| 37 | + if ($request->session()->has('should_attach_to_organization')) { |
|
| 38 | 38 | $shouldAttach = $request->session()->get('should_attach_to_organization'); |
| 39 | 39 | $shouldAttachToken = $request->session()->get('should_attach_to_organization_token'); |
| 40 | 40 | $linkToRedirect = $request->session()->get('should_attach_to_organization_redirect'); |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | $request->session()->regenerateToken(); |
| 48 | 48 | |
| 49 | - if(isset($shouldAttach)){ |
|
| 49 | + if (isset($shouldAttach)) { |
|
| 50 | 50 | $request->session()->flash('should_attach_to_organization', $shouldAttach); |
| 51 | 51 | $request->session()->flash('should_attach_to_organization_token', $shouldAttachToken); |
| 52 | 52 | $request->session()->flash('should_attach_to_organization_redirect', $linkToRedirect); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | protected function loggedOut(Request $request) |
| 65 | 65 | { |
| 66 | 66 | $request->session()->reflash(); |
| 67 | - if($request->session()->has('should_attach_to_organization')){ |
|
| 67 | + if ($request->session()->has('should_attach_to_organization')) { |
|
| 68 | 68 | $linkToRedirect = $request->session()->get('should_attach_to_organization_redirect'); |
| 69 | 69 | return $request->wantsJson() |
| 70 | 70 | ? new Response('', 204) |
@@ -74,14 +74,14 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | protected function authenticated(Request $request, $user) |
| 76 | 76 | { |
| 77 | - if($request->session()->has('wiki_callback')){ |
|
| 77 | + if ($request->session()->has('wiki_callback')) { |
|
| 78 | 78 | $user = Auth::user(); |
| 79 | 79 | $user->wiki_token = $request->session()->get('wiki_token'); |
| 80 | 80 | $user->save(); |
| 81 | 81 | $callback = urldecode($request->session()->get('wiki_callback')); |
| 82 | 82 | return redirect($callback); |
| 83 | 83 | } |
| 84 | - if($request->session()->has('should_attach_to_organization') && $request->session()->get('should_attach_to_organization') !== null){ |
|
| 84 | + if ($request->session()->has('should_attach_to_organization') && $request->session()->get('should_attach_to_organization') !== null) { |
|
| 85 | 85 | $token = $request->session()->get('should_attach_to_organization_token'); |
| 86 | 86 | $link = route('organization.invite.show').'?&token='.$token; |
| 87 | 87 | return $request->wantsJson() |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | public function redirectToProvider(string $provider) |
| 94 | 94 | { |
| 95 | - if(session()->has('wiki_callback')){ |
|
| 95 | + if (session()->has('wiki_callback')) { |
|
| 96 | 96 | session()->reflash(); |
| 97 | 97 | } |
| 98 | 98 | config(['services.'.$provider.'.redirect' => env(strtoupper($provider).'_CALLBACK_LOGIN')]); |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | { |
| 104 | 104 | config(['services.'.$provider.'.redirect' => env(strtoupper($provider).'_CALLBACK_LOGIN')]); |
| 105 | 105 | $logUserFromSocialNetwork->log($provider); |
| 106 | - if(session()->has('wiki_callback')){ |
|
| 106 | + if (session()->has('wiki_callback')) { |
|
| 107 | 107 | return $this->authenticated(request(), null); |
| 108 | 108 | } |
| 109 | 109 | return redirect()->route('home'); |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | public function handle($request, Closure $next, $guard = null) |
| 20 | 20 | { |
| 21 | - if($request->has('wiki_callback') && Auth::user() !== null){ |
|
| 21 | + if ($request->has('wiki_callback') && Auth::user() !== null) { |
|
| 22 | 22 | return $this->redirectToWiki($request); |
| 23 | 23 | } |
| 24 | 24 | |
@@ -26,12 +26,12 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | public function listUsers(string $organizationId, Request $request, ListUsers $listUsers) |
| 28 | 28 | { |
| 29 | - $page = $request->input('start')/10 + 1; |
|
| 29 | + $page = $request->input('start')/10+1; |
|
| 30 | 30 | |
| 31 | 31 | $users = $listUsers->list($organizationId, $page, 10); |
| 32 | 32 | $total = isset($users['total']) ? $users['total'] : 0; |
| 33 | 33 | $list = []; |
| 34 | - foreach ($users['list'] as $user){ |
|
| 34 | + foreach ($users['list'] as $user) { |
|
| 35 | 35 | $user = $user->toArray(); |
| 36 | 36 | $list[] = [ |
| 37 | 37 | '', |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | public function editShowForm(string $userId, GetUser $getUser, GetOrganization $getOrganization, GetUserStats $getUserStats) |
| 52 | 52 | { |
| 53 | 53 | $user = $getUser->get($userId); |
| 54 | - if($user->organizationId() !== null) { |
|
| 54 | + if ($user->organizationId() !== null) { |
|
| 55 | 55 | $organization = $getOrganization->get($user->organizationId()); |
| 56 | 56 | } |
| 57 | 57 | $stats = $getUserStats->get($userId); |
@@ -88,11 +88,11 @@ discard block |
||
| 88 | 88 | public function delete(string $userId, Request $request, DeleteUser $deleteUser) |
| 89 | 89 | { |
| 90 | 90 | $redirect = 'back'; |
| 91 | - if($userId === Auth::id()){ |
|
| 91 | + if ($userId === Auth::id()) { |
|
| 92 | 92 | $redirect = 'login'; |
| 93 | 93 | } |
| 94 | 94 | $deleteUser->delete($userId); |
| 95 | - if($redirect === 'login') { |
|
| 95 | + if ($redirect === 'login') { |
|
| 96 | 96 | return redirect()->route('login'); |
| 97 | 97 | } |
| 98 | 98 | $request->session()->flash('notif_msg', __('users.message.user.deleted')); |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | public function showEditProfile(GetUser $getUser, GetOrganization $getOrganization, GetUserStats $getUserStats) |
| 18 | 18 | { |
| 19 | 19 | $user = $getUser->get(Auth::user()->uuid); |
| 20 | - if($user->organizationId() !== null) { |
|
| 20 | + if ($user->organizationId() !== null) { |
|
| 21 | 21 | $organization = $getOrganization->get($user->organizationId()); |
| 22 | 22 | } |
| 23 | 23 | $stats = $getUserStats->get(Auth::user()->uuid); |
@@ -34,13 +34,13 @@ discard block |
||
| 34 | 34 | { |
| 35 | 35 | $this->registerHelpers(); |
| 36 | 36 | |
| 37 | - if(config('app.env') === 'testing'){ |
|
| 37 | + if (config('app.env') === 'testing') { |
|
| 38 | 38 | $this->tuBinding(); |
| 39 | 39 | } |
| 40 | - if(config('app.env') === 'testing-ti'){ |
|
| 40 | + if (config('app.env') === 'testing-ti') { |
|
| 41 | 41 | $this->tiBinding(); |
| 42 | 42 | } |
| 43 | - if(config('app.env') === 'local' || config('app.env') === 'production'){ |
|
| 43 | + if (config('app.env') === 'local' || config('app.env') === 'production') { |
|
| 44 | 44 | $this->prodBinding(); |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | private function registerHelpers(): void |
| 53 | 53 | { |
| 54 | - foreach (glob(app_path() . '/Src/Utils/Helpers/*.php') as $filename) { |
|
| 54 | + foreach (glob(app_path().'/Src/Utils/Helpers/*.php') as $filename) { |
|
| 55 | 55 | require_once($filename); |
| 56 | 56 | } |
| 57 | 57 | } |
@@ -52,11 +52,11 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | public function listOrganizations(Request $request, ListOrganizations $listOrganizations) |
| 54 | 54 | { |
| 55 | - $page = $request->input('start')/10 + 1; |
|
| 55 | + $page = $request->input('start')/10+1; |
|
| 56 | 56 | $organizations = $listOrganizations->list($page, 10); |
| 57 | 57 | $total = isset($organizations['total']) ? $organizations['total'] : 0; |
| 58 | 58 | $list = []; |
| 59 | - foreach ($organizations['list'] as $organization){ |
|
| 59 | + foreach ($organizations['list'] as $organization) { |
|
| 60 | 60 | $org = $organization->toArray(); |
| 61 | 61 | $list[] = [ |
| 62 | 62 | $org['name'], |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | return format($total, $list); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - public function prepareInvitation(Request $request, PrepareInvitationUsersInOrganization $prepareInvitationUsersInOrganization) |
|
| 73 | + public function prepareInvitation(Request $request, PrepareInvitationUsersInOrganization $prepareInvitationUsersInOrganization) |
|
| 74 | 74 | { |
| 75 | 75 | $users = $request->input('users'); |
| 76 | 76 | $users = explode(PHP_EOL, $users); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | public function acceptInvite(Request $request, RespondInvitationToAnOrganization $respondInvitationToAnOrganization) |
| 98 | 98 | { |
| 99 | 99 | $action = $respondInvitationToAnOrganization->respond($token = $request->input('token')); |
| 100 | - switch($action['action']){ |
|
| 100 | + switch ($action['action']) { |
|
| 101 | 101 | case 'register': |
| 102 | 102 | return $this->redirectToRegisterPage($request, $action); |
| 103 | 103 | case 'accept_or_decline': |