Passed
Push — master ( e5e186...2b3765 )
by Bertrand
06:14
created
app/Http/Controllers/Auth/RegisterController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     {
33 33
         $email = $firstname = $lastname = '';
34 34
 
35
-        if($request->session()->has('user_to_register')){
35
+        if ($request->session()->has('user_to_register')) {
36 36
             $user = $request->session()->get('user_to_register');
37 37
             $email = $user['email'];
38 38
             $firstname = $user['firstname'];
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
     protected function validator(array $data)
50 50
     {
51
-        if(session()->has('should_attach_to_organization')) {
51
+        if (session()->has('should_attach_to_organization')) {
52 52
             session()->reflash();
53 53
         }
54 54
         return Validator::make($data, [
@@ -69,11 +69,11 @@  discard block
 block discarded – undo
69 69
 
70 70
     protected function registered(Request $request, $user)
71 71
     {
72
-        if($request->session()->has('should_attach_to_organization')){
72
+        if ($request->session()->has('should_attach_to_organization')) {
73 73
             app(AttachUserToAnOrganization::class)->attach($user->uuid, $request->session()->get('should_attach_to_organization'));
74 74
         }
75 75
 
76
-        if($request->session()->has('wiki_callback')){
76
+        if ($request->session()->has('wiki_callback')) {
77 77
             $user = Auth::user();
78 78
             $user->wiki_token = $request->session()->get('wiki_token');
79 79
             $user->save();
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     public function redirectToProvider(string $provider)
86 86
     {
87 87
         config(['services.'.$provider.'.redirect' => env(strtoupper($provider).'_CALLBACK')]);
88
-        if($provider === 'twitter'){
88
+        if ($provider === 'twitter') {
89 89
             return Socialite::driver($provider)->redirect();
90 90
         }
91 91
         return Socialite::driver($provider)->redirectUrl(config('services.'.$provider.'.redirect'))->redirect();
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             $user = User::where('uuid', $userId)->first();
99 99
             $this->guard()->login($user);
100 100
 
101
-            if($request->session()->has('wiki_callback')){
101
+            if ($request->session()->has('wiki_callback')) {
102 102
                 $user = Auth::user();
103 103
                 $user->wiki_token = $request->session()->get('wiki_token');
104 104
                 $user->save();
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
             return $request->wantsJson()
110 110
                 ? new Response('', 201)
111 111
                 : redirect($this->redirectPath());
112
-        }catch (ValidationException $e) {
112
+        } catch (ValidationException $e) {
113 113
             $attributes = $e->validator->attributes();
114 114
             $attributes['provider'] = $provider;
115 115
             return redirect()->route('register-social-network')
Please login to merge, or discard this patch.
app/Http/Middleware/FlashWikiCallback.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
      */
17 17
     public function handle($request, Closure $next)
18 18
     {
19
-        if(session()->has('wiki_callback')){
19
+        if (session()->has('wiki_callback')) {
20 20
             session()->reflash();
21 21
         }
22 22
         return $next($request);
Please login to merge, or discard this patch.
app/Http/Middleware/CheckRole.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
      */
17 17
     public function handle($request, Closure $next)
18 18
     {
19
-        if(Auth::user() !== null && !Auth::user()->hasRole('admin')){
19
+        if (Auth::user() !== null && !Auth::user()->hasRole('admin')) {
20 20
             return redirect(env('WIKI_URL'));
21 21
         }
22 22
         return $next($request);
Please login to merge, or discard this patch.