@@ -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')); |
@@ -36,31 +36,31 @@ |
||
36 | 36 | { |
37 | 37 | $this->registerHelpers(); |
38 | 38 | |
39 | - if(config('app.env') === 'testing'){ |
|
39 | + if (config('app.env') === 'testing') { |
|
40 | 40 | $this->tuBinding(); |
41 | 41 | } |
42 | - if(config('app.env') === 'testing-ti'){ |
|
42 | + if (config('app.env') === 'testing-ti') { |
|
43 | 43 | $this->tiBinding(); |
44 | 44 | } |
45 | - if(config('app.env') === 'local' || config('app.env') === 'production'){ |
|
45 | + if (config('app.env') === 'local' || config('app.env') === 'production') { |
|
46 | 46 | $this->prodBinding(); |
47 | 47 | } |
48 | 48 | } |
49 | 49 | |
50 | 50 | public function boot() |
51 | 51 | { |
52 | - if(config('app.env') !== 'testing' && config('app.env') !== 'testing-ti') { |
|
52 | + if (config('app.env') !== 'testing' && config('app.env') !== 'testing-ti') { |
|
53 | 53 | Schema::defaultStringLength(191); |
54 | 54 | } |
55 | 55 | |
56 | - if(config('app.env') === 'local' || config('app.env') === 'production'){ |
|
56 | + if (config('app.env') === 'local' || config('app.env') === 'production') { |
|
57 | 57 | URL::forceScheme('https'); |
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
61 | 61 | private function registerHelpers(): void |
62 | 62 | { |
63 | - foreach (glob(app_path() . '/Src/Utils/Helpers/*.php') as $filename) { |
|
63 | + foreach (glob(app_path().'/Src/Utils/Helpers/*.php') as $filename) { |
|
64 | 64 | require_once($filename); |
65 | 65 | } |
66 | 66 | } |
@@ -27,7 +27,7 @@ |
||
27 | 27 | return $this->providerId; |
28 | 28 | } |
29 | 29 | |
30 | - public function email():? string |
|
30 | + public function email(): ? string |
|
31 | 31 | { |
32 | 32 | return $this->email; |
33 | 33 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | // need to show to the user. Finally, we'll send out a proper response. |
39 | 39 | $response = $this->broker()->sendResetLink( |
40 | 40 | $this->credentials($request), |
41 | - function ($user, $token){ |
|
41 | + function($user, $token) { |
|
42 | 42 | Mail::to($user->email) |
43 | 43 | ->send(new PasswordResetLink($user, $token)); |
44 | 44 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | public function register(string $provider, SocialiteUser $socialiteUser) |
30 | 30 | { |
31 | 31 | $user = $this->userRepository->getByProvider($provider, $socialiteUser->providerId()); |
32 | - if(isset($user)){ |
|
32 | + if (isset($user)) { |
|
33 | 33 | return [ |
34 | 34 | 'user_id' => $user->id(), |
35 | 35 | 'provider_id' => $socialiteUser->providerId(), |
@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | ]; |
38 | 38 | } |
39 | 39 | |
40 | - if($socialiteUser->email() !== null && $socialiteUser->email() != "") { |
|
40 | + if ($socialiteUser->email() !== null && $socialiteUser->email() != "") { |
|
41 | 41 | $user = $this->userRepository->getByEmail($socialiteUser->email()); |
42 | 42 | } |
43 | - if(isset($user)){ |
|
43 | + if (isset($user)) { |
|
44 | 44 | $user->addProvider($provider, $socialiteUser->providerId()); |
45 | 45 | return [ |
46 | 46 | 'user_id' => $user->id(), |
@@ -22,17 +22,17 @@ |
||
22 | 22 | { |
23 | 23 | $relativePath = $newPath; |
24 | 24 | $finalNewPath = storage_path().'/'.$newPath; |
25 | - if(isset($this->ext)){ |
|
25 | + if (isset($this->ext)) { |
|
26 | 26 | $finalNewPath = storage_path().'/'.$newPath.'.'.$this->ext; |
27 | 27 | $relativePath = $newPath.'.'.$this->ext; |
28 | 28 | } |
29 | - if(app(PictureHandler::class)->width($this->path) > 600) { |
|
29 | + if (app(PictureHandler::class)->width($this->path) > 600) { |
|
30 | 30 | app(PictureHandler::class)->widen($this->path, $finalNewPath, 600); |
31 | 31 | $this->relativePath = $relativePath; |
32 | 32 | return; |
33 | 33 | } |
34 | 34 | |
35 | - if(app(PictureHandler::class)->height($this->path) > 400) { |
|
35 | + if (app(PictureHandler::class)->height($this->path) > 400) { |
|
36 | 36 | app(PictureHandler::class)->heighten($this->path, $finalNewPath, 400); |
37 | 37 | $this->relativePath = $relativePath; |
38 | 38 | return; |
@@ -23,10 +23,10 @@ |
||
23 | 23 | $this->authGateway = $authGateway; |
24 | 24 | } |
25 | 25 | |
26 | - public function execute():?string |
|
26 | + public function execute(): ?string |
|
27 | 27 | { |
28 | 28 | $currentUser = $this->authGateway->current(); |
29 | - if(!isset($currentUser)){ |
|
29 | + if (!isset($currentUser)) { |
|
30 | 30 | return 'nothing_to_do'; |
31 | 31 | } |
32 | 32 | $anonymousUser = new AnonymousUser($this->authGateway->wikiSessionId()); |
@@ -11,7 +11,7 @@ |
||
11 | 11 | { |
12 | 12 | public function handle($request, Closure $next) |
13 | 13 | { |
14 | - if($request->input('wiki_session_id')){ |
|
14 | + if ($request->input('wiki_session_id')) { |
|
15 | 15 | Session::put('wiki_session_id', $request->input('wiki_session_id')); |
16 | 16 | } |
17 | 17 | return $next($request); |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | interface AuthGateway |
10 | 10 | { |
11 | - public function current():? User; |
|
11 | + public function current(): ? User; |
|
12 | 12 | public function log(User $u); |
13 | - public function wikiSessionId():?string; |
|
13 | + public function wikiSessionId(): ?string; |
|
14 | 14 | } |