Passed
Branch 1.0 (e2e5b6)
by Artem
09:37
created
database/migrations/2017_08_09_000000_create_tenant_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
      */
13 13
     public function up()
14 14
     {
15
-        Schema::create(config('plugin.tenant'), function (\Illuminate\Database\Schema\Blueprint $blueprint) {
15
+        Schema::create(config('plugin.tenant'), function(\Illuminate\Database\Schema\Blueprint $blueprint) {
16 16
             $blueprint->increments('id');
17 17
             $blueprint->string('addon_key');
18 18
             $blueprint->string('client_key', 36);
Please login to merge, or discard this patch.
src/Listeners/CreateOrUpdateTenant.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
         ]);
48 48
 
49 49
         // If tenant is trashed we need "un-delete" it because add-on installing implies enabling
50
-        if($tenant->trashed()) {
50
+        if ($tenant->trashed()) {
51 51
             $tenant->restore();
52 52
         }
53 53
     }
Please login to merge, or discard this patch.
src/ServiceProvider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      */
65 65
     protected function loadRoutes()
66 66
     {
67
-        if(config('plugin.loadRoutes')) {
67
+        if (config('plugin.loadRoutes')) {
68 68
             $this->loadRoutesFrom(__DIR__ . '/Http/routes.php');
69 69
         }
70 70
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      */
85 85
     protected function loadConsoleCommands()
86 86
     {
87
-        if(!$this->app->runningInConsole()) {
87
+        if (!$this->app->runningInConsole()) {
88 88
             return;
89 89
         }
90 90
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
      */
116 116
     protected function registerJWTGuard()
117 117
     {
118
-        Auth::extend('jwt', function (Application $app, $name, array $config)
118
+        Auth::extend('jwt', function(Application $app, $name, array $config)
119 119
         {
120 120
             return $app->makeWith(JWTGuard::class, [
121 121
                 'provider' => Auth::createUserProvider($config['provider']),
Please login to merge, or discard this patch.
src/Services/TenantService.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             ->findWhere(['client_key' => $attributes['client_key']])
55 55
             ->first();
56 56
 
57
-        if(!$model) {
57
+        if (!$model) {
58 58
             return $this->repository->create($attributes);
59 59
         }
60 60
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      */
102 102
     public function findByClientKeyOrFail($clientKey, $withTrashed = true)
103 103
     {
104
-        if($tenant = $this->findByClientKey($clientKey, $withTrashed)) {
104
+        if ($tenant = $this->findByClientKey($clientKey, $withTrashed)) {
105 105
             return $tenant;
106 106
         }
107 107
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      */
128 128
     public function delete($id)
129 129
     {
130
-        if(config('plugin.safeDelete')) {
130
+        if (config('plugin.safeDelete')) {
131 131
             return $this->repository->delete($id);
132 132
         }
133 133
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
      */
154 154
     public function makeDummy($id)
155 155
     {
156
-        if(!$this->repository->findById($id)) {
156
+        if (!$this->repository->findById($id)) {
157 157
             throw new NotFoundHttpException();
158 158
         }
159 159
 
Please login to merge, or discard this patch.
src/Helpers/JWTHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
     {
21 21
         $parts = explode('.', $token);
22 22
 
23
-        if(count($parts) !== 3) {
23
+        if (count($parts) !== 3) {
24 24
             return null;
25 25
         }
26 26
 
Please login to merge, or discard this patch.
src/Console/DummyCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
         $validator = Validator::make(['value' => $id], ['value' => Rule::in($choices)]);
73 73
 
74
-        if($validator->fails()) {
74
+        if ($validator->fails()) {
75 75
             return $this->error('Invalid ID provided');
76 76
         }
77 77
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     {
93 93
         $tenants = collect($tenants->toArray());
94 94
 
95
-        return $tenants->map(function ($tenant) use ($attributes) {
95
+        return $tenants->map(function($tenant) use ($attributes) {
96 96
 
97 97
             // Make the client key shorter for displaying
98 98
             $tenant['client_key'] = substr($tenant['client_key'], -22);
Please login to merge, or discard this patch.
src/Console/InstallCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
      */
60 60
     protected function createDummyTenant()
61 61
     {
62
-        if(!Schema::hasTable($tableName = config('plugin.tenant'))) {
62
+        if (!Schema::hasTable($tableName = config('plugin.tenant'))) {
63 63
             throw new \Exception('Table ' . $tableName . ' should be exist. Please, run migrations');
64 64
         }
65 65
 
Please login to merge, or discard this patch.
src/Http/Middleware/JWTAuth.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
         // Of course you can provide it if you want. Otherwise request will be signed automatically
44 44
         $jwt = request('jwt', request()->header('Authorization'));
45 45
 
46
-        if(app()->isLocal() && !$jwt) {
47
-            if(!$tenant = $this->tenantService->dummy()) {
46
+        if (app()->isLocal() && !$jwt) {
47
+            if (!$tenant = $this->tenantService->dummy()) {
48 48
                 throw new \Illuminate\Validation\UnauthorizedException(
49 49
                     'You should have at least one dummy tenant to get it working locally'
50 50
                 );
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         }
62 62
 
63 63
         // Authenticate user
64
-        if(!Auth::attempt()) {
64
+        if (!Auth::attempt()) {
65 65
             throw new \Illuminate\Validation\UnauthorizedException();
66 66
         }
67 67
 
Please login to merge, or discard this patch.
src/Http/routes.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-Route::group(['namespace' => 'AtlassianConnectCore\Http\Controllers'], function () {
3
+Route::group(['namespace' => 'AtlassianConnectCore\Http\Controllers'], function() {
4 4
     Route::get('atlassian-connect.json', 'TenantController@descriptor')->name('descriptor');
5 5
 
6 6
     Route::post('installed', 'TenantController@installed')->name('installed');
7 7
     Route::post('disabled', 'TenantController@disabled')->name('disabled');
8 8
 
9
-    Route::group(['middleware' => 'jwt'], function () {
9
+    Route::group(['middleware' => 'jwt'], function() {
10 10
         Route::post('enabled', 'TenantController@enabled')->name('enabled');
11 11
         Route::post('uninstalled', 'TenantController@uninstalled')->name('uninstalled');
12 12
 
Please login to merge, or discard this patch.