Passed
Pull Request — master (#91)
by
unknown
05:17 queued 46s
created
src/Commands/DeleteTenant.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,14 +54,14 @@  discard block
 block discarded – undo
54 54
     {
55 55
         $tenants = $this->tenants->findByAnyIdentifier($this->argument('tenant'), false);
56 56
 
57
-        if($tenants->isEmpty()) {
57
+        if ($tenants->isEmpty()) {
58 58
             $this->error('Cannot find a matching tenant by "' . $this->argument('tenant') . '" identifier');
59 59
             return;
60 60
         }
61 61
 
62 62
         $this->renderTenants($tenants, 'Found tenant(s)');
63 63
 
64
-        if($tenants->count() > 1) {
64
+        if ($tenants->count() > 1) {
65 65
             $deletingId = $this->ask('We have found several tenants, which one would you like to delete? (enter its ID)');
66 66
         }
67 67
         else {
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
         $tenant = $tenants->firstWhere('id', $deletingId);
72 72
 
73
-        if($this->option('safe')) {
73
+        if ($this->option('safe')) {
74 74
             $tenant->delete();
75 75
 
76 76
             $this->info('The tenant #' . $deletingId . ' safely deleted. To restore it, run:');
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             return;
80 80
         }
81 81
 
82
-        if(!$this->confirm('Would you like to forcely delete the tenant #' . $deletingId . '? It cannot be reverted.')) {
82
+        if (!$this->confirm('Would you like to forcely delete the tenant #' . $deletingId . '? It cannot be reverted.')) {
83 83
             return;
84 84
         }
85 85
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,8 +63,7 @@
 block discarded – undo
63 63
 
64 64
         if($tenants->count() > 1) {
65 65
             $deletingId = $this->ask('We have found several tenants, which one would you like to delete? (enter its ID)');
66
-        }
67
-        else {
66
+        } else {
68 67
             $deletingId = $tenants->first()->id;
69 68
         }
70 69
 
Please login to merge, or discard this patch.
database/migrations/2019_06_24_140207_create_saml2_tenants_table.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::create('saml2_tenants', function (Blueprint $table) {
16
+        Schema::create('saml2_tenants', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->uuid('uuid');
19 19
             $table->string('key')->nullable();
Please login to merge, or discard this patch.
src/Http/Middleware/ResolveTenant.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function handle($request, \Closure $next)
50 50
     {
51
-        if(!$tenant = $this->resolveTenant($request)) {
51
+        if (!$tenant = $this->resolveTenant($request)) {
52 52
             throw new NotFoundHttpException();
53 53
         }
54 54
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      */
79 79
     protected function resolveTenant($request)
80 80
     {
81
-        if(!$uuid = $request->route('uuid')) {
81
+        if (!$uuid = $request->route('uuid')) {
82 82
             if (config('saml2.debug')) {
83 83
                 Log::debug('[Saml2] Tenant UUID is not present in the URL so cannot be resolved', [
84 84
                     'url' => $request->fullUrl()
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
             return null;
89 89
         }
90 90
 
91
-        if(!$tenant = $this->tenants->findByUUID($uuid)) {
91
+        if (!$tenant = $this->tenants->findByUUID($uuid)) {
92 92
             if (config('saml2.debug')) {
93 93
                 Log::debug('[Saml2] Tenant doesn\'t exist', [
94 94
                     'uuid' => $uuid
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
             return null;
99 99
         }
100 100
 
101
-        if($tenant->trashed()) {
101
+        if ($tenant->trashed()) {
102 102
             if (config('saml2.debug')) {
103
-                Log::debug('[Saml2] Tenant #' . $tenant->id. ' resolved but marked as deleted', [
103
+                Log::debug('[Saml2] Tenant #' . $tenant->id . ' resolved but marked as deleted', [
104 104
                     'id' => $tenant->id,
105 105
                     'uuid' => $uuid,
106 106
                     'deleted_at' => $tenant->deleted_at->toDateTimeString()
Please login to merge, or discard this patch.
2020_10_22_140856_add_relay_state_url_column_to_saml2_tenants_table.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('saml2_tenants', function (Blueprint $table) {
16
+        Schema::table('saml2_tenants', function(Blueprint $table) {
17 17
             $table->string('relay_state_url')->nullable();
18 18
         });
19 19
     }
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public function down()
27 27
     {
28
-        Schema::table('saml2_tenants', function (Blueprint $table) {
28
+        Schema::table('saml2_tenants', function(Blueprint $table) {
29 29
             $table->dropColumn('relay_state_url');
30 30
         });
31 31
     }
Please login to merge, or discard this patch.
2020_10_23_072902_add_name_id_format_column_to_saml2_tenants_table.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('saml2_tenants', function (Blueprint $table) {
16
+        Schema::table('saml2_tenants', function(Blueprint $table) {
17 17
             $table->string('name_id_format')->default('persistent');
18 18
         });
19 19
     }
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public function down()
27 27
     {
28
-        Schema::table('saml2_tenants', function (Blueprint $table) {
28
+        Schema::table('saml2_tenants', function(Blueprint $table) {
29 29
             $table->dropColumn('name_id_format');
30 30
         });
31 31
     }
Please login to merge, or discard this patch.
src/OneLoginBuilder.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
             OneLoginUtils::setProxyVars(true);
66 66
         }
67 67
 
68
-        $this->app->singleton('OneLogin_Saml2_Auth', function ($app) {
68
+        $this->app->singleton('OneLogin_Saml2_Auth', function($app) {
69 69
             $config = $app['config']['saml2'];
70 70
 
71 71
             $this->setConfigDefaultValues($config);
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             return new OneLoginAuth($oneLoginConfig);
82 82
         });
83 83
 
84
-        $this->app->singleton('Slides\Saml2\Auth', function ($app) {
84
+        $this->app->singleton('Slides\Saml2\Auth', function($app) {
85 85
             return new \Slides\Saml2\Auth($app['OneLogin_Saml2_Auth'], $this->tenant);
86 86
         });
87 87
     }
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     protected function setConfigDefaultValues(array &$config)
97 97
     {
98 98
         foreach ($this->configDefaultValues() as $key => $default) {
99
-            if(!Arr::get($config, $key)) {
99
+            if (!Arr::get($config, $key)) {
100 100
                 Arr::set($config, $key, $default);
101 101
             }
102 102
         }
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
             case 'unspecified':
134 134
                 return 'urn:oasis:names:tc:SAML:1.1:nameid-format:' . $format;
135 135
             default:
136
-                return 'urn:oasis:names:tc:SAML:2.0:nameid-format:'. $format;
136
+                return 'urn:oasis:names:tc:SAML:2.0:nameid-format:' . $format;
137 137
         }
138 138
     }
139 139
 }
140 140
\ No newline at end of file
Please login to merge, or discard this patch.
src/Repositories/TenantRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
         $class = config('saml2.tenantModel', Tenant::class);
24 24
         $query = $class::query();
25 25
 
26
-        if($withTrashed) {
26
+        if ($withTrashed) {
27 27
             $query->withTrashed();
28 28
         }
29 29
 
Please login to merge, or discard this patch.
src/Commands/RendersTenants.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
                 $columns[] = [$column, $value ?: '(empty)'];
36 36
             }
37 37
 
38
-            if($tenants->last()->id !== $tenant->id) {
38
+            if ($tenants->last()->id !== $tenant->id) {
39 39
                 $columns[] = new \Symfony\Component\Console\Helper\TableSeparator();
40 40
             }
41 41
         }
42 42
 
43
-        if($title) {
43
+        if ($title) {
44 44
             $this->getOutput()->title($title);
45 45
         }
46 46
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             'Relay State URL' => $tenant->relay_state_url,
67 67
             'Name ID format' => $tenant->name_id_format,
68 68
             'x509 cert' => Str::limit($tenant->idp_x509_cert, 50),
69
-            'Metadata' => print_r($tenant->metadata ?: [],1),
69
+            'Metadata' => print_r($tenant->metadata ?: [], 1),
70 70
             'Created' => $tenant->created_at->toDateTimeString(),
71 71
             'Updated' => $tenant->updated_at->toDateTimeString(),
72 72
             'Deleted' => $tenant->deleted_at ? $tenant->deleted_at->toDateTimeString() : null
Please login to merge, or discard this patch.
src/Commands/UpdateTenant.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      */
61 61
     public function handle()
62 62
     {
63
-        if(!$tenant = $this->tenants->findById($this->argument('id'))) {
63
+        if (!$tenant = $this->tenants->findById($this->argument('id'))) {
64 64
             $this->error('Cannot find a tenant #' . $this->argument('id'));
65 65
             return;
66 66
         }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             'metadata' => $metadata,
85 85
         ]));
86 86
 
87
-        if(!$tenant->save()) {
87
+        if (!$tenant->save()) {
88 88
             $this->error('Tenant cannot be saved.');
89 89
             return;
90 90
         }
Please login to merge, or discard this patch.