Passed
Push — master ( 2bfef0...ca1baa )
by Monney
06:08
created
migrations/2018_06_29_155339_add_socialites_columns_to_users.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::table(config('laravel-oauth.users.table'), function (Blueprint $table) {
16
+        Schema::table(config('laravel-oauth.users.table'), function(Blueprint $table) {
17 17
             foreach (config('laravel-oauth.providers') as $provider => $status) {
18 18
                 if ($status === true) {
19 19
                     $table->string($provider.'_id')->nullable();
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
      */
30 30
     public function down()
31 31
     {
32
-        Schema::table(config('laravel-oauth.users.table'), function (Blueprint $table) {
32
+        Schema::table(config('laravel-oauth.users.table'), function(Blueprint $table) {
33 33
             foreach (config('laravel-oauth.providers') as $provider => $status) {
34 34
                 if (Schema::hasColumn(config('laravel-oauth.users.table'), $provider.'_id')) {
35 35
                     $table->dropColumn($provider.'_id');
Please login to merge, or discard this patch.
src/LaravelSocialite.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
                     $buttons .= "<i class='social-{$provider}'></i>";
30 30
                 }
31 31
 
32
-                $buttons .= trans("laravel-oauth::word.{$type}", ['provider' => $provider]);
32
+                $buttons .= trans("laravel-oauth::word.{$type}", [ 'provider' => $provider ]);
33 33
                 $buttons .= '</a>';
34 34
             }
35 35
         }
Please login to merge, or discard this patch.
src/Traits/OAuthSocialite.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
         $provider = strtolower($provider);
20 20
 
21 21
         if ($provider === 'facebook') {
22
-            return Socialite::driver('facebook')->with(['auth_type' => 'rerequest'])->redirect();
22
+            return Socialite::driver('facebook')->with([ 'auth_type' => 'rerequest' ])->redirect();
23 23
         }
24 24
 
25 25
         return Socialite::driver($provider)->redirect();
Please login to merge, or discard this patch.
src/Providers/BladeServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
      */
15 15
     public function boot()
16 16
     {
17
-        Blade::directive('socialite', function ($expression) {
17
+        Blade::directive('socialite', function($expression) {
18 18
             // Check user needs :login or :register text
19 19
             return "<?php echo LaravelSocialite::socialiteButtons($expression); ?>";
20 20
         });
Please login to merge, or discard this patch.
src/Providers/InstagramProvider.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     /**
17 17
      * {@inheritdoc}
18 18
      */
19
-    protected $scopes = ['basic'];
19
+    protected $scopes = [ 'basic' ];
20 20
 
21 21
     /**
22 22
      * {@inheritdoc}
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         ];
48 48
         $signature = $this->generateSignature($endpoint, $query);
49 49
 
50
-        $query['sig'] = $signature;
50
+        $query[ 'sig' ] = $signature;
51 51
         $response = $this->getHttpClient()->get(
52 52
             'https://api.instagram.com/v1/users/self', [
53 53
             'query'   => $query,
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             ],
57 57
         ]);
58 58
 
59
-        return json_decode($response->getBody()->getContents(), true)['data'];
59
+        return json_decode($response->getBody()->getContents(), true)[ 'data' ];
60 60
     }
61 61
 
62 62
     /**
@@ -65,11 +65,11 @@  discard block
 block discarded – undo
65 65
     protected function mapUserToObject(array $user)
66 66
     {
67 67
         return (new User())->setRaw($user)->map([
68
-            'id'     => $user['id'],
69
-            'nickname' => $user['username'],
70
-            'name'   => $user['full_name'],
68
+            'id'     => $user[ 'id' ],
69
+            'nickname' => $user[ 'username' ],
70
+            'name'   => $user[ 'full_name' ],
71 71
             'email' => null,
72
-            'avatar' => $user['profile_picture'],
72
+            'avatar' => $user[ 'profile_picture' ],
73 73
         ]);
74 74
     }
75 75
 
Please login to merge, or discard this patch.
src/Providers/DribbbleProvider.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
     /**
13 13
      * {@inheritdoc}
14 14
      */
15
-    protected $scopes = ['public'];
15
+    protected $scopes = [ 'public' ];
16 16
 
17 17
     /**
18 18
      * Get the authentication URL for the provider.
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
     protected function mapUserToObject(array $user)
62 62
     {
63 63
         return (new User())->setRaw($user)->map([
64
-            'id'     => $user['id'],
65
-            'nickname' => $user['login'],
66
-            'name'   => $user['name'],
64
+            'id'     => $user[ 'id' ],
65
+            'nickname' => $user[ 'login' ],
66
+            'name'   => $user[ 'name' ],
67 67
             'email' => Arr::get($user, 'email'),
68
-            'avatar' => $user['avatar_url'],
68
+            'avatar' => $user[ 'avatar_url' ],
69 69
         ]);
70 70
     }
71 71
 }
Please login to merge, or discard this patch.
src/Providers/PinterestProvider.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     /**
12 12
      * {@inheritdoc}
13 13
      */
14
-    protected $scopes = ['read_public'];
14
+    protected $scopes = [ 'read_public' ];
15 15
 
16 16
     /**
17 17
      * {@inheritdoc}
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     {
40 40
         $response = $this->getHttpClient()->get(
41 41
             'https://api.pinterest.com/v1/me/',
42
-            ['headers' => ['Authorization' => 'Bearer '.$token]]
42
+            [ 'headers' => [ 'Authorization' => 'Bearer '.$token ] ]
43 43
         );
44 44
         $contents = $response->getBody()->getContents();
45 45
 
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
      */
52 52
     protected function mapUserToObject(array $user)
53 53
     {
54
-        preg_match('#https://www.pinterest.com/(.+?)/#', $user['data']['url'], $matches);
55
-        $nickname = $matches[1];
54
+        preg_match('#https://www.pinterest.com/(.+?)/#', $user[ 'data' ][ 'url' ], $matches);
55
+        $nickname = $matches[ 1 ];
56 56
 
57 57
         return (new User())->setRaw($user)->map(
58 58
             [
59
-                'id'       => $user['data']['id'],
59
+                'id'       => $user[ 'data' ][ 'id' ],
60 60
                 'nickname' => $nickname,
61
-                'name'     => $user['data']['first_name'].' '.$user['data']['last_name'],
61
+                'name'     => $user[ 'data' ][ 'first_name' ].' '.$user[ 'data' ][ 'last_name' ],
62 62
             ]
63 63
         );
64 64
     }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     protected function getTokenFields($code)
70 70
     {
71 71
         return array_merge(
72
-            parent::getTokenFields($code), ['grant_type' => 'authorization_code']
72
+            parent::getTokenFields($code), [ 'grant_type' => 'authorization_code' ]
73 73
         );
74 74
     }
75 75
 }
Please login to merge, or discard this patch.
src/LaravelOAuthServiceProvider.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         $loader->alias('Socialite', \Laravel\Socialite\Facades\Socialite::class);
64 64
 
65 65
         // Register the service the package provides.
66
-        $this->app->singleton('laravelsocialite', function ($app) {
66
+        $this->app->singleton('laravelsocialite', function($app) {
67 67
             return new LaravelSocialite;
68 68
         });
69 69
         // Create aliase for the package provider
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     public function provides()
79 79
     {
80
-        return ['laravelsocialite'];
80
+        return [ 'laravelsocialite' ];
81 81
     }
82 82
 
83 83
     private function bootInstagramSocialite()
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
         $socialite = $this->app->make(\Laravel\Socialite\Contracts\Factory::class);
86 86
         $socialite->extend(
87 87
             'instagram',
88
-            function ($app) use ($socialite) {
89
-                $config = $app['config']['services.instagram'];
88
+            function($app) use ($socialite) {
89
+                $config = $app[ 'config' ][ 'services.instagram' ];
90 90
 
91 91
                 return $socialite->buildProvider(InstagramProvider::class, $config);
92 92
             }
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
         $socialite = $this->app->make(\Laravel\Socialite\Contracts\Factory::class);
99 99
         $socialite->extend(
100 100
             'dribbble',
101
-            function ($app) use ($socialite) {
102
-                $config = $app['config']['services.dribbble'];
101
+            function($app) use ($socialite) {
102
+                $config = $app[ 'config' ][ 'services.dribbble' ];
103 103
 
104 104
                 return $socialite->buildProvider(DribbbleProvider::class, $config);
105 105
             }
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
         $socialite = $this->app->make(\Laravel\Socialite\Contracts\Factory::class);
112 112
         $socialite->extend(
113 113
             'pinterest',
114
-            function ($app) use ($socialite) {
115
-                $config = $app['config']['services.pinterest'];
114
+            function($app) use ($socialite) {
115
+                $config = $app[ 'config' ][ 'services.pinterest' ];
116 116
 
117 117
                 return $socialite->buildProvider(PinterestProvider::class, $config);
118 118
             }
@@ -124,8 +124,8 @@  discard block
 block discarded – undo
124 124
         $socialite = $this->app->make(\Laravel\Socialite\Contracts\Factory::class);
125 125
         $socialite->extend(
126 126
             'youtube',
127
-            function ($app) use ($socialite) {
128
-                $config = $app['config']['services.youtube'];
127
+            function($app) use ($socialite) {
128
+                $config = $app[ 'config' ][ 'services.youtube' ];
129 129
 
130 130
                 return $socialite->buildProvider(YoutubeProvider::class, $config);
131 131
             }
Please login to merge, or discard this patch.
src/Providers/YoutubeProvider.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     /**
12 12
      * {@inheritdoc}
13 13
      */
14
-    protected $scopes = ['https://www.googleapis.com/auth/youtube.readonly'];
14
+    protected $scopes = [ 'https://www.googleapis.com/auth/youtube.readonly' ];
15 15
 
16 16
     /**
17 17
      * {@inheritdoc}
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
             ],
49 49
         ]);
50 50
 
51
-        return json_decode($response->getBody()->getContents(), true)['items'][0];
51
+        return json_decode($response->getBody()->getContents(), true)[ 'items' ][ 0 ];
52 52
     }
53 53
 
54 54
     /**
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
     protected function mapUserToObject(array $user)
58 58
     {
59 59
         return (new User())->setRaw($user)->map([
60
-            'id'       => $user['id'],
61
-            'nickname' => $user['snippet']['title'],
60
+            'id'       => $user[ 'id' ],
61
+            'nickname' => $user[ 'snippet' ][ 'title' ],
62 62
             'name'     => null,
63 63
             'email'    => null,
64
-            'avatar'   => $user['snippet']['thumbnails']['high']['url'],
64
+            'avatar'   => $user[ 'snippet' ][ 'thumbnails' ][ 'high' ][ 'url' ],
65 65
         ]);
66 66
     }
67 67
 
Please login to merge, or discard this patch.