@@ -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); |
@@ -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': |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | $usersLoop = $this->getUsersToProcess($users, $usersLoop, $filePathUsers); |
24 | 24 | $errors = $imported = 0; |
25 | 25 | |
26 | - foreach($usersLoop as $userToInvite){ |
|
26 | + foreach ($usersLoop as $userToInvite) { |
|
27 | 27 | $validator = $this->validateUserData($userToInvite); |
28 | - if($validator->fails()){ |
|
28 | + if ($validator->fails()) { |
|
29 | 29 | $userToInvite['error'] = 'email.error.syntax'; |
30 | 30 | $usersToProcess['users'][] = $userToInvite; |
31 | 31 | $errors++; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | list($userToInvite, $errors) = $this->checkIfUserAlreadyIn($organizationId, $userToInvite, $errors); |
36 | 36 | |
37 | 37 | $usersToProcess['users'][] = $userToInvite; |
38 | - if(!isset($userToInvite["error"])){ |
|
38 | + if (!isset($userToInvite["error"])) { |
|
39 | 39 | $imported++; |
40 | 40 | } |
41 | 41 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | { |
32 | 32 | $email = $firstname = $lastname = ''; |
33 | 33 | |
34 | - if($request->session()->has('user_to_register')){ |
|
34 | + if ($request->session()->has('user_to_register')) { |
|
35 | 35 | $user = $request->session()->get('user_to_register'); |
36 | 36 | $email = $user['email']; |
37 | 37 | $firstname = $user['firstname']; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | protected function validator(array $data) |
49 | 49 | { |
50 | - if(session()->has('should_attach_to_organization')) { |
|
50 | + if (session()->has('should_attach_to_organization')) { |
|
51 | 51 | session()->reflash(); |
52 | 52 | } |
53 | 53 | return Validator::make($data, [ |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | protected function registered(Request $request, $user) |
70 | 70 | { |
71 | - if($request->session()->has('should_attach_to_organization')){ |
|
71 | + if ($request->session()->has('should_attach_to_organization')) { |
|
72 | 72 | app(AttachUserToAnOrganization::class)->attach($user->uuid, $request->session()->get('should_attach_to_organization')); |
73 | 73 | } |
74 | 74 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | return $request->wantsJson() |
89 | 89 | ? new Response('', 201) |
90 | 90 | : redirect($this->redirectPath()); |
91 | - }catch (ValidationException $e) { |
|
91 | + } catch (ValidationException $e) { |
|
92 | 92 | $attributes = $e->validator->attributes(); |
93 | 93 | $attributes['provider'] = $provider; |
94 | 94 | return redirect()->route('register-social-network') |
@@ -39,23 +39,23 @@ |
||
39 | 39 | $organizationToJoin = $this->organizationRepository->get($organizationId); |
40 | 40 | |
41 | 41 | $currentUser = $this->authGateway->current(); |
42 | - if(isset($currentUser) && $currentUser->email() !== $email){ |
|
42 | + if (isset($currentUser) && $currentUser->email() !== $email) { |
|
43 | 43 | $action = 'logout'; |
44 | 44 | $action .= !isset($user) ? '-register' : '-login'; |
45 | 45 | |
46 | - if($action == 'logout-login') { |
|
46 | + if ($action == 'logout-login') { |
|
47 | 47 | return $this->badUserLoginToAcceptAction($action, $organizationToJoin); |
48 | 48 | } |
49 | 49 | return $this->returnLogoutAction($action, $organizationToJoin, $email, $firstname, $lastname); |
50 | 50 | } |
51 | 51 | |
52 | 52 | |
53 | - if(!isset($user)){ |
|
53 | + if (!isset($user)) { |
|
54 | 54 | return $this->returnRegisterAction($organizationId, $email, $firstname, $lastname); |
55 | 55 | } |
56 | 56 | |
57 | 57 | $currentUser = $this->authGateway->current(); |
58 | - if(!isset($currentUser)){ |
|
58 | + if (!isset($currentUser)) { |
|
59 | 59 | return $this->returnLoginAction($organizationToJoin); |
60 | 60 | } |
61 | 61 |
@@ -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 = init($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')); |
@@ -35,13 +35,13 @@ discard block |
||
35 | 35 | { |
36 | 36 | $this->registerHelpers(); |
37 | 37 | |
38 | - if(config('app.env') === 'testing'){ |
|
38 | + if (config('app.env') === 'testing') { |
|
39 | 39 | $this->tuBinding(); |
40 | 40 | } |
41 | - if(config('app.env') === 'testing-ti'){ |
|
41 | + if (config('app.env') === 'testing-ti') { |
|
42 | 42 | $this->tiBinding(); |
43 | 43 | } |
44 | - if(config('app.env') === 'local' || config('app.env') === 'production'){ |
|
44 | + if (config('app.env') === 'local' || config('app.env') === 'production') { |
|
45 | 45 | $this->prodBinding(); |
46 | 46 | } |
47 | 47 | } |
@@ -51,14 +51,14 @@ discard block |
||
51 | 51 | // Force max key length - @see: https://laravel-news.com/laravel-5-4-key-too-long-error |
52 | 52 | Schema::defaultStringLength(191); |
53 | 53 | |
54 | - if(config('app.env') !== 'testing' && config('app.env') !== 'testing-ti') { |
|
54 | + if (config('app.env') !== 'testing' && config('app.env') !== 'testing-ti') { |
|
55 | 55 | Schema::defaultStringLength(191); |
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
59 | 59 | private function registerHelpers(): void |
60 | 60 | { |
61 | - foreach (glob(app_path() . '/Src/Utils/Helpers/*.php') as $filename) { |
|
61 | + foreach (glob(app_path().'/Src/Utils/Helpers/*.php') as $filename) { |
|
62 | 62 | require_once($filename); |
63 | 63 | } |
64 | 64 | } |