Test Failed
Branch master (52949b)
by Artem
05:53
created
src/Helpers/ConsoleHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public static function stringToArray(string $string = null, string $valueDelimiter = ':', string $itemDelimiter = ',')
26 26
     {
27
-        if(is_null($string)) {
27
+        if (is_null($string)) {
28 28
             return [];
29 29
         }
30 30
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
             $key = Arr::get($item, 0);
38 38
             $value = Arr::get($item, 1);
39 39
 
40
-            if(is_null($value)) {
40
+            if (is_null($value)) {
41 41
                 $value = $key;
42 42
                 $key = $index;
43 43
             }
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         $values = [];
64 64
 
65 65
         foreach ($array as $key => $value) {
66
-            if(is_array($value)) {
66
+            if (is_array($value)) {
67 67
                 continue;
68 68
             }
69 69
 
Please login to merge, or discard this patch.
src/helpers.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
     {
17 17
         $target = \Illuminate\Support\Facades\URL::to($path, $parameters, $secure);
18 18
 
19
-        if(!$uuid) {
20
-            if(!$uuid = saml_tenant_uuid()) {
19
+        if (!$uuid) {
20
+            if (!$uuid = saml_tenant_uuid()) {
21 21
                 return $target;
22 22
             }
23 23
         }
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
     {
42 42
         $target = \Illuminate\Support\Facades\URL::route($name, $parameters, true);
43 43
 
44
-        if(!$uuid) {
45
-            if(!$uuid = saml_tenant_uuid()) {
44
+        if (!$uuid) {
45
+            if (!$uuid = saml_tenant_uuid()) {
46 46
                 return $target;
47 47
             }
48 48
         }
Please login to merge, or discard this patch.
src/OneLoginBuilder.php 1 patch
Spacing   +3 added lines, -3 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
         }
Please login to merge, or discard this patch.
src/ServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
      */
38 38
     protected function bootRoutes()
39 39
     {
40
-        if($this->app['config']['saml2.useRoutes'] == true) {
40
+        if ($this->app['config']['saml2.useRoutes'] == true) {
41 41
             include __DIR__ . '/Http/routes.php';
42 42
         }
43 43
     }
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
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     {
23 23
         $query = Tenant::query();
24 24
 
25
-        if($withTrashed) {
25
+        if ($withTrashed) {
26 26
             $query->withTrashed();
27 27
         }
28 28
 
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
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      */
77 77
     protected function resolveTenant($request)
78 78
     {
79
-        if(!$uuid = $request->route('uuid')) {
79
+        if (!$uuid = $request->route('uuid')) {
80 80
             Log::debug('[Saml2] Tenant UUID is not present in the URL so cannot be resolved', [
81 81
                 'url' => $request->fullUrl()
82 82
             ]);
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             return null;
85 85
         }
86 86
 
87
-        if(!$tenant = $this->tenants->findByUUID($uuid)) {
87
+        if (!$tenant = $this->tenants->findByUUID($uuid)) {
88 88
             Log::debug('[Saml2] Tenant doesn\'t exist', [
89 89
                 'uuid' => $uuid
90 90
             ]);
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
             return null;
93 93
         }
94 94
 
95
-        if($tenant->trashed()) {
96
-            Log::debug('[Saml2] Tenant #' . $tenant->id. ' resolved but marked as deleted', [
95
+        if ($tenant->trashed()) {
96
+            Log::debug('[Saml2] Tenant #' . $tenant->id . ' resolved but marked as deleted', [
97 97
                 'id' => $tenant->id,
98 98
                 'uuid' => $uuid,
99 99
                 'deleted_at' => $tenant->deleted_at->toDateTimeString()
Please login to merge, or discard this patch.
src/Http/routes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 Route::group([
4 4
     'prefix' => config('saml2.routesPrefix'),
5 5
     'middleware' => array_merge(['saml2.resolveTenant'], config('saml2.routesMiddleware')),
6
-], function () {
6
+], function() {
7 7
     Route::get('/{uuid}/logout', array(
8 8
         'as' => 'saml.logout',
9 9
         'uses' => 'Slides\Saml2\Http\Controllers\Saml2Controller@logout',
Please login to merge, or discard this patch.
src/Commands/RendersTenants.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,12 +34,12 @@
 block discarded – undo
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
 
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
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.