Completed
Pull Request — master (#70)
by guillaume
07:08
created
app/Http/Middleware/TransformRequestLoginProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,14 +9,14 @@
 block discarded – undo
9 9
     public function handle($request, Closure $next, $guard = null)
10 10
     {
11 11
         $params = $request->all();
12
-        if(isset($params['\code'])) {
12
+        if (isset($params['\code'])) {
13 13
             $request->merge([
14 14
                 '\code' => null,
15 15
                 'code' => $params['\code']
16 16
             ]);
17 17
         }
18 18
 
19
-        if(isset($params['\oauth_token'])) {
19
+        if (isset($params['\oauth_token'])) {
20 20
             $request->merge([
21 21
                 '\oauth_token' => null,
22 22
                 'oauth_token' => $params['\oauth_token']
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Auth/SocialiteUser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Auth/LogUserFromSocialNetwork.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
         $socialiteUser = $this->socialiteGateway->user($provider);
41 41
 
42 42
         $user = $this->userRepository->getByProvider($provider, $socialiteUser->providerId());
43
-        if($user === null){
43
+        if ($user === null) {
44 44
             app(RegisterUserFromSocialNetworkService::class)->register($provider, $socialiteUser);
45 45
             $user = $this->userRepository->getByProvider($provider, $socialiteUser->providerId());
46 46
         }
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/ForgotPasswordController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
app/Src/UseCases/Domain/Users/Dto/GetUserRole.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 {
8 8
     public function get()
9 9
     {
10
-         return collect([
10
+            return collect([
11 11
             new WikiUserRole('advisor'),
12 12
             new WikiUserRole('farmer'),
13 13
             new WikiUserRole('student'),
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/RegisterController.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@
 block discarded – undo
106 106
             }
107 107
 
108 108
             return redirect()->route('wizard.profile');
109
-        }catch (ValidationException $e) {
109
+        } catch (ValidationException $e) {
110 110
             $attributes = $e->validator->attributes();
111 111
             $attributes['provider'] = $provider;
112 112
             return redirect()->route('register-social-network')
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -31,19 +31,19 @@  discard block
 block discarded – undo
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'];
38 38
             $lastname = $user['lastname'];
39 39
         }
40 40
 
41
-        if($request->has('wiki_callback')){
41
+        if ($request->has('wiki_callback')) {
42 42
             session()->flash('wiki_callback', $request->input('wiki_callback'));
43 43
             session()->flash('wiki_token', $request->input('wiki_token'));
44 44
         }
45 45
 
46
-        if(session()->has('should_attach_to_organization')) {
46
+        if (session()->has('should_attach_to_organization')) {
47 47
             session()->reflash();
48 48
         }
49 49
         return view('public.auth.register', [
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
     protected function validator(array $data)
57 57
     {
58
-        if(session()->has('should_attach_to_organization')) {
58
+        if (session()->has('should_attach_to_organization')) {
59 59
             session()->reflash();
60 60
         }
61 61
         return Validator::make($data, [
@@ -79,16 +79,16 @@  discard block
 block discarded – undo
79 79
 
80 80
     protected function registered(Request $request, $user)
81 81
     {
82
-        if($request->session()->has('should_attach_to_organization')){
82
+        if ($request->session()->has('should_attach_to_organization')) {
83 83
             app(AttachUserToAnOrganization::class)->attach($user->uuid, $request->session()->get('should_attach_to_organization'));
84 84
         }
85 85
         $user = Auth::user();
86 86
 
87
-        if($user->context_id === null) {
87
+        if ($user->context_id === null) {
88 88
             return redirect()->route('wizard.profile');
89 89
         }
90 90
 
91
-        if($request->session()->has('wiki_callback')){
91
+        if ($request->session()->has('wiki_callback')) {
92 92
             $user->wiki_token = $request->session()->get('wiki_token');
93 93
             $user->save();
94 94
             $callback = urldecode($request->session()->get('wiki_callback'));
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     public function redirectToProvider(string $provider)
102 102
     {
103 103
         config(['services.'.$provider.'.redirect' => env(strtoupper($provider).'_CALLBACK')]);
104
-        if($provider === 'twitter'){
104
+        if ($provider === 'twitter') {
105 105
             return Socialite::driver($provider)->redirect();
106 106
         }
107 107
         return Socialite::driver($provider)->redirectUrl(config('services.'.$provider.'.redirect'))->redirect();
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
             $user = User::where('uuid', $userId)->first();
115 115
             $this->guard()->login($user);
116 116
 
117
-            if($user->context_id !== null){
117
+            if ($user->context_id !== null) {
118 118
                 $user->wiki_token = $request->session()->get('wiki_token');
119 119
                 $user->save();
120 120
                 $callback = urldecode($request->session()->get('wiki_callback'));
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
             }
123 123
 
124 124
             return redirect()->route('wizard.profile');
125
-        }catch (ValidationException $e) {
125
+        } catch (ValidationException $e) {
126 126
             $attributes = $e->validator->attributes();
127 127
             $attributes['provider'] = $provider;
128 128
             return redirect()->route('register-social-network')
Please login to merge, or discard this patch.
app/Http/Controllers/Profile/WizardProfileController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
         $farmingType = $request->input('farming_type') !== null ? $request->input('farming_type') : [];
40 40
 
41 41
         $fillWikiUserProfile->fill(Auth::user()->uuid, $role, $firstname, $lastname, $email, $postalCode, $farmingType);
42
-        if(session()->has('wiki_callback')){
42
+        if (session()->has('wiki_callback')) {
43 43
             $user = Auth::user();
44 44
             $user->wiki_token = session()->get('wiki_token');
45 45
             $user->save();
Please login to merge, or discard this patch.
Src/UseCases/Domain/Auth/Services/RegisterUserFromSocialNetworkService.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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(),
Please login to merge, or discard this patch.
app/Http/Middleware/IsWizardProfileAvailable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,10 +11,10 @@
 block discarded – undo
11 11
     public function handle($request, \Closure $next)
12 12
     {
13 13
         $user = Auth::user();
14
-        if($user->context_id === null){
14
+        if ($user->context_id === null) {
15 15
             return $next($request);
16 16
         }
17
-        if(session()->has('wiki_callback')){
17
+        if (session()->has('wiki_callback')) {
18 18
             $user->wiki_token = session()->get('wiki_token');
19 19
             $user->save();
20 20
             $callback = urldecode(session()->get('wiki_callback'));
Please login to merge, or discard this patch.