@@ -34,12 +34,12 @@ |
||
34 | 34 | $columns[] = [$column, $value ?: '(empty)']; |
35 | 35 | } |
36 | 36 | |
37 | - if($tenants->last()->id !== $tenant->id) { |
|
37 | + if ($tenants->last()->id !== $tenant->id) { |
|
38 | 38 | $columns[] = new \Symfony\Component\Console\Helper\TableSeparator(); |
39 | 39 | } |
40 | 40 | } |
41 | 41 | |
42 | - if($title) { |
|
42 | + if ($title) { |
|
43 | 43 | $this->getOutput()->title($title); |
44 | 44 | } |
45 | 45 |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function handle() |
60 | 60 | { |
61 | - if(!$tenant = $this->tenants->findById($this->argument('id'))) { |
|
61 | + if (!$tenant = $this->tenants->findById($this->argument('id'))) { |
|
62 | 62 | $this->error('Cannot find a tenant #' . $this->argument('id')); |
63 | 63 | return; |
64 | 64 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | 'metadata' => ConsoleHelper::stringToArray($this->option('metadata')) |
73 | 73 | ])); |
74 | 74 | |
75 | - if(!$tenant->save()) { |
|
75 | + if (!$tenant->save()) { |
|
76 | 76 | $this->error('Tenant cannot be saved.'); |
77 | 77 | return; |
78 | 78 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $key = $this->option('key'); |
82 | 82 | $metadata = ConsoleHelper::stringToArray($this->option('metadata')); |
83 | 83 | |
84 | - if($key && ($tenant = $this->tenants->findByKey($key))) { |
|
84 | + if ($key && ($tenant = $this->tenants->findByKey($key))) { |
|
85 | 85 | $this->renderTenants($tenant, 'Already found tenant(s) using this key'); |
86 | 86 | $this->error( |
87 | 87 | 'Cannot create a tenant because the key is already being associated with other tenants.' |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | 'metadata' => $metadata, |
102 | 102 | ]); |
103 | 103 | |
104 | - if(!$tenant->save()) { |
|
104 | + if (!$tenant->save()) { |
|
105 | 105 | $this->error('Tenant cannot be saved.'); |
106 | 106 | return; |
107 | 107 | } |
@@ -53,7 +53,7 @@ |
||
53 | 53 | { |
54 | 54 | $tenants = $this->tenants->all(); |
55 | 55 | |
56 | - if($tenants->isEmpty()) { |
|
56 | + if ($tenants->isEmpty()) { |
|
57 | 57 | $this->info('No tenants found'); |
58 | 58 | return; |
59 | 59 | } |
@@ -52,7 +52,7 @@ |
||
52 | 52 | */ |
53 | 53 | public function handle() |
54 | 54 | { |
55 | - if(!$tenant = $this->tenants->findById($this->argument('id'))) { |
|
55 | + if (!$tenant = $this->tenants->findById($this->argument('id'))) { |
|
56 | 56 | $this->error('Cannot find a tenant #' . $this->argument('id')); |
57 | 57 | return; |
58 | 58 | } |
@@ -51,14 +51,14 @@ |
||
51 | 51 | */ |
52 | 52 | public function handle() |
53 | 53 | { |
54 | - if(!$tenant = $this->tenants->findById($this->argument('id'))) { |
|
54 | + if (!$tenant = $this->tenants->findById($this->argument('id'))) { |
|
55 | 55 | $this->error('Cannot find a tenant #' . $this->argument('id')); |
56 | 56 | return; |
57 | 57 | } |
58 | 58 | |
59 | 59 | $this->renderTenants($tenant, 'Found a deleted tenant'); |
60 | 60 | |
61 | - if(!$this->confirm('Would you like to restore it?')) { |
|
61 | + if (!$this->confirm('Would you like to restore it?')) { |
|
62 | 62 | return; |
63 | 63 | } |
64 | 64 |
@@ -54,14 +54,14 @@ discard block |
||
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 |
||
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 |
||
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 |
@@ -63,8 +63,7 @@ |
||
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 |
@@ -13,7 +13,7 @@ |
||
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(); |