Passed
Branch master (3b38dd)
by meta
04:06
created
routes/web.microsoft.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 Route::middleware([config('azure-oath.routes.middleware')])->group(function() {
4
-    Route::get(config('azure-oath.routes.login'   ), 'Metrogistics\AzureSocialite\WebAuthController@redirectToOauthProvider');
4
+    Route::get(config('azure-oath.routes.login'), 'Metrogistics\AzureSocialite\WebAuthController@redirectToOauthProvider');
5 5
     Route::get(config('azure-oath.routes.callback'), 'Metrogistics\AzureSocialite\WebAuthController@handleOauthResponse');
6 6
 
7 7
     // This handles a situation where a route with the NAME of login does not exist, we define it to keep from breaking framework redirects hard coded
8
-    if (! \Route::has('login') ) {
8
+    if (!\Route::has('login')) {
9 9
         Route::get('login', 'Metrogistics\AzureSocialite\AuthController@loginOrRegister')->name('login');
10 10
     }
11
-    if (! \Route::has('register') ) {
11
+    if (!\Route::has('register')) {
12 12
         Route::get('register', 'Metrogistics\AzureSocialite\AuthController@loginOrRegister')->name('register');
13 13
     }
14 14
 });
Please login to merge, or discard this patch.
database/migrations/2018_02_19_152839_alter_users_table_for_azure_ad.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::table('users', function (Blueprint $table) {
16
+        Schema::table('users', function(Blueprint $table) {
17 17
             // Users must be able to support blank passwords for external identity
18 18
             $table->string('password')->nullable()->change();
19 19
             // We need a new string field to store the oauth provider unique id in
Please login to merge, or discard this patch.
publish/routes/swagger.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 
7 7
     // Redirect requests to /api to the swagger documentation
8 8
     //$api->any('', function (Illuminate\Http\Request $request) {
9
-    $api->any('', function () {
9
+    $api->any('', function() {
10 10
         return redirect('api/documentation/');
11 11
     });
12 12
 
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
      * )
19 19
      **/
20 20
 
21
-    $api->any('/api/hello', function () {
21
+    $api->any('/api/hello', function() {
22 22
         return 'hello world';
23 23
     });
24 24
 
Please login to merge, or discard this patch.
publish/routes/api.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
  * )
26 26
  **/
27 27
 
28
-Route::middleware('api')->get('/hello', function (Request $request) {
28
+Route::middleware('api')->get('/hello', function(Request $request) {
29 29
     return 'hello world';
30 30
 });
31 31
 
Please login to merge, or discard this patch.
src/UserFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,13 +22,13 @@  discard block
 block discarded – undo
22 22
         $new_user->$id_field = $azure_user->id;
23 23
         //$new_user->password = bcrypt('');
24 24
 
25
-        foreach($user_map as $azure_field => $user_field){
25
+        foreach ($user_map as $azure_field => $user_field) {
26 26
             $new_user->$user_field = $azure_user->$azure_field;
27 27
         }
28 28
 
29 29
         $callback = static::$user_callback;
30 30
 
31
-        if($callback && is_callable($callback)){
31
+        if ($callback && is_callable($callback)) {
32 32
             $callback($new_user);
33 33
         }
34 34
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
     public static function userCallback($callback)
41 41
     {
42
-        if(! is_callable($callback)){
42
+        if (!is_callable($callback)) {
43 43
             throw new \Exception("Must provide a callable.");
44 44
         }
45 45
 
Please login to merge, or discard this patch.
src/Middleware/Authenticate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
      */
57 57
     public function user()
58 58
     {
59
-        if($this->user){
59
+        if ($this->user) {
60 60
             return $this->user;
61 61
         }
62 62
 
Please login to merge, or discard this patch.
src/OauthTokenGuard.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      */
57 57
     public function check()
58 58
     {
59
-        return ! is_null($this->user());
59
+        return !is_null($this->user());
60 60
     }
61 61
 
62 62
     /**
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      */
67 67
     public function guest()
68 68
     {
69
-        return ! $this->check();
69
+        return !$this->check();
70 70
     }
71 71
 
72 72
     /**
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      */
77 77
     public function user()
78 78
     {
79
-        if (! is_null($this->user)) {
79
+        if (!is_null($this->user)) {
80 80
             return $this->user;
81 81
         }
82 82
     }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
      *
112 112
      * @return bool
113 113
      */
114
-    public function validate(Array $credentials=[])
114
+    public function validate(Array $credentials = [])
115 115
     {
116 116
         return is_null($this->user);
117 117
     }
Please login to merge, or discard this patch.
src/AzureOauthProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
             $azureadgroups = $this->getUserGroupsByToken($token);
61 61
             // only proceed if we got a good response with group info
62 62
             if (isset($azureadgroups['value']) && count($azureadgroups['value'])) {
63
-                foreach($azureadgroups['value'] as $group) {
63
+                foreach ($azureadgroups['value'] as $group) {
64 64
                     $groups[] = $group['displayName'];
65 65
                 }
66 66
             }
Please login to merge, or discard this patch.
src/ServiceProvider.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,19 +26,19 @@  discard block
 block discarded – undo
26 26
 
27 27
         // Actually I have my own oauth token cache based authentication guard now lol
28 28
         config(['auth.guards.api.driver' => 'oauthtoken']);
29
-        Auth::extend('oauthtoken', function ($app, $name, array $config) {
29
+        Auth::extend('oauthtoken', function($app, $name, array $config) {
30 30
             return new OauthTokenGuard(Auth::createUserProvider($config['provider']), $app->make('request'));
31 31
         });
32 32
 
33 33
         // Make sure that this vendor dir and the routes dir are in any scanned paths for swagger documentation
34 34
         $swaggerScanPaths = config('l5-swagger.paths.annotations');
35
-        if(! is_array($swaggerScanPaths)) {
35
+        if (!is_array($swaggerScanPaths)) {
36 36
             $swaggerScanPaths = [$swaggerScanPaths];
37 37
         }
38
-        if (! in_array(base_path('routes'), $swaggerScanPaths)) {
38
+        if (!in_array(base_path('routes'), $swaggerScanPaths)) {
39 39
             $swaggerScanPaths[] = base_path('routes');
40 40
         }
41
-        if (! in_array(__DIR__.'/../routes/', $swaggerScanPaths)) {
41
+        if (!in_array(__DIR__.'/../routes/', $swaggerScanPaths)) {
42 42
             $swaggerScanPaths[] = __DIR__.'/../routes/';
43 43
         }
44 44
         config(['l5-swagger.paths.annotations' => $swaggerScanPaths]);
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             __DIR__.'/../publish/config/azure-oath.php', 'azure-oath'
55 55
         );
56 56
 
57
-        $this->app['Laravel\Socialite\Contracts\Factory']->extend('azure-oauth', function($app){
57
+        $this->app['Laravel\Socialite\Contracts\Factory']->extend('azure-oauth', function($app) {
58 58
             return $app['Laravel\Socialite\Contracts\Factory']->buildProvider(
59 59
                 'Metrogistics\AzureSocialite\AzureOauthProvider',
60 60
                 config('azure-oath.credentials')
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
         // If the routes files for the swagger oauth config is NOT present, and we have all the right info, then generate it really quick
68 68
         $swaggerAzureadFile = __DIR__.'/../routes/swagger.azuread.php';
69
-        if (!file_exists($swaggerAzureadFile) && env('AZURE_AD_CLIENT_ID') && env('AZURE_AD_OPENID_URL') ){
69
+        if (!file_exists($swaggerAzureadFile) && env('AZURE_AD_CLIENT_ID') && env('AZURE_AD_OPENID_URL')) {
70 70
             $openidConfig = $this->getOpenidConfiguration(env('AZURE_AD_OPENID_URL'));
71 71
             $authorizationUrl = $openidConfig['authorization_endpoint'];
72 72
             if (!$authorizationUrl) {
Please login to merge, or discard this patch.