Passed
Push — master ( 4c3e72...46eb59 )
by Arthur
10:39
created
src/Modules/Telescope/Console/PublishTelescopeAssetsCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
      */
36 36
     public function handle()
37 37
     {
38
-        Artisan::call('vendor:publish',[
38
+        Artisan::call('vendor:publish', [
39 39
             "--tag" => "telescope-assets",
40 40
             "--force" => true
41 41
         ]);
Please login to merge, or discard this patch.
src/Foundation/Providers/BootstrapServiceProvider.php 2 patches
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -79,16 +79,16 @@  discard block
 block discarded – undo
79 79
     private function loadRoutes()
80 80
     {
81 81
         foreach ($this->bootstrapService->getRoutes() as $route) {
82
-            $path = $route['path'];
82
+            $path = $route[ 'path' ];
83 83
             Route::group([
84
-                'prefix' => 'v1/' . str_plural($route['module']),
85
-                'namespace' => $route['controller'],
86
-                'domain' => $route['domain'],
87
-                'middleware' => ['api'],
88
-            ], function () use ($path) {
84
+                'prefix' => 'v1/'.str_plural($route[ 'module' ]),
85
+                'namespace' => $route[ 'controller' ],
86
+                'domain' => $route[ 'domain' ],
87
+                'middleware' => [ 'api' ],
88
+            ], function() use ($path) {
89 89
                 require $path;
90 90
             });
91
-            Route::model($route['module'], $route['model']);
91
+            Route::model($route[ 'module' ], $route[ 'model' ]);
92 92
         }
93 93
     }
94 94
 
@@ -100,11 +100,11 @@  discard block
 block discarded – undo
100 100
     protected function loadConfigs()
101 101
     {
102 102
         foreach ($this->bootstrapService->getConfigs() as $config) {
103
-            if (isset($config['filename']) && is_string($config['filename'])) {
104
-                $fileName = $config['filename'];
105
-                $configName = strtolower(explode('.',$fileName)[0]);
103
+            if (isset($config[ 'filename' ]) && is_string($config[ 'filename' ])) {
104
+                $fileName = $config[ 'filename' ];
105
+                $configName = strtolower(explode('.', $fileName)[ 0 ]);
106 106
                 $this->mergeConfigFrom(
107
-                    $config['path'], $configName
107
+                    $config[ 'path' ], $configName
108 108
                 );
109 109
             }
110 110
         }
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     {
120 120
         foreach ($this->bootstrapService->getFactories() as $factory) {
121 121
             if (!$this->app->environment('production')) {
122
-                app(Factory::class)->load($factory['path']);
122
+                app(Factory::class)->load($factory[ 'path' ]);
123 123
             }
124 124
         }
125 125
     }
@@ -132,15 +132,15 @@  discard block
 block discarded – undo
132 132
     public function loadMigrations()
133 133
     {
134 134
         foreach ($this->bootstrapService->getMigrations() as $migration) {
135
-            $this->loadMigrationsFrom($migration['path']);
135
+            $this->loadMigrationsFrom($migration[ 'path' ]);
136 136
         }
137 137
     }
138 138
 
139 139
     private function loadPolicies()
140 140
     {
141 141
         foreach ($this->bootstrapService->getPolicies() as $policy) {
142
-            if (class_implements_interface($policy['class'], ModelPolicyContract::class)) {
143
-                Gate::policy($policy['model'], $policy['class']);
142
+            if (class_implements_interface($policy[ 'class' ], ModelPolicyContract::class)) {
143
+                Gate::policy($policy[ 'model' ], $policy[ 'class' ]);
144 144
             }
145 145
         }
146 146
     }
@@ -149,8 +149,8 @@  discard block
 block discarded – undo
149 149
     {
150 150
         $app = $this->app;
151 151
         $service = $this->bootstrapService;
152
-        $this->app->extend('command.seed', function () use ($app, $service) {
153
-            return new SeedCommand($app['db'], $service);
152
+        $this->app->extend('command.seed', function() use ($app, $service) {
153
+            return new SeedCommand($app[ 'db' ], $service);
154 154
         });
155 155
     }
156 156
 
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         foreach ($this->bootstrapService->getModels() as $model) {
169 169
             if (class_implements_interface($model, Ownable::class)) {
170 170
                 Gate::policy($model, OwnershipPolicy::class);
171
-                Gate::define('access', OwnershipPolicy::class . '@access');
171
+                Gate::define('access', OwnershipPolicy::class.'@access');
172 172
             }
173 173
         }
174 174
     }
@@ -184,8 +184,8 @@  discard block
 block discarded – undo
184 184
     private function loadListeners()
185 185
     {
186 186
         foreach ($this->bootstrapService->getEvents() as $event) {
187
-            foreach ($event['listeners'] as $listener) {
188
-                Event::listen($event['class'], $listener);
187
+            foreach ($event[ 'listeners' ] as $listener) {
188
+                Event::listen($event[ 'class' ], $listener);
189 189
             }
190 190
         }
191 191
     }
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -176,8 +176,9 @@  discard block
 block discarded – undo
176 176
     private function loadServiceProviders()
177 177
     {
178 178
         foreach ($this->bootstrapService->getProviders() as $provider) {
179
-            if ($this->passedRegistrationCondition($provider))
180
-                $this->app->register($provider);
179
+            if ($this->passedRegistrationCondition($provider)) {
180
+                            $this->app->register($provider);
181
+            }
181 182
         }
182 183
     }
183 184
 
@@ -192,8 +193,9 @@  discard block
 block discarded – undo
192 193
 
193 194
     private function passedRegistrationCondition($class)
194 195
     {
195
-        if (!class_implements_interface($class, ConditionalAutoRegistration::class))
196
-            return true;
196
+        if (!class_implements_interface($class, ConditionalAutoRegistration::class)) {
197
+                    return true;
198
+        }
197 199
         return run_class_function($class, 'registrationCondition');
198 200
     }
199 201
 }
Please login to merge, or discard this patch.
src/Modules/User/Database/Migrations/2018_10_04_134544_CreateUserTable.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('users', function (Blueprint $table) {
15
+        Schema::create('users', function(Blueprint $table) {
16 16
             $table->increments('id');
17 17
             $table->string('identity_id')->unique();
18 18
             $table->string('email');
Please login to merge, or discard this patch.
src/Modules/Mongo/Abstracts/MongoCollectionMigration.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     public function __construct()
30 30
     {
31 31
         if (!isset($this->collection) || $this->collection === '') {
32
-            throw new InternalErrorException('Collection name must be specified on migration: ' . get_called_class());
32
+            throw new InternalErrorException('Collection name must be specified on migration: '.get_called_class());
33 33
         }
34 34
     }
35 35
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     final public function up()
42 42
     {
43 43
         if (!Schema::connection($this->connection)->hasTable($this->collection)) {
44
-            Schema::connection($this->connection)->create($this->collection, function (Blueprint $collection) {
44
+            Schema::connection($this->connection)->create($this->collection, function(Blueprint $collection) {
45 45
                 if (method_exists($this, 'migrate'))
46 46
                     $this->migrate($collection);
47 47
             });
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,8 +42,9 @@  discard block
 block discarded – undo
42 42
     {
43 43
         if (!Schema::connection($this->connection)->hasTable($this->collection)) {
44 44
             Schema::connection($this->connection)->create($this->collection, function (Blueprint $collection) {
45
-                if (method_exists($this, 'migrate'))
46
-                    $this->migrate($collection);
45
+                if (method_exists($this, 'migrate')) {
46
+                                    $this->migrate($collection);
47
+                }
47 48
             });
48 49
         }
49 50
     }
@@ -56,8 +57,9 @@  discard block
 block discarded – undo
56 57
     final public function down()
57 58
     {
58 59
         if (Schema::connection($this->connection)->hasTable($this->collection)) {
59
-            if (method_exists($this, 'destroy'))
60
-                $this->destroy();
60
+            if (method_exists($this, 'destroy')) {
61
+                            $this->destroy();
62
+            }
61 63
             Schema::connection($this->connection)->drop($this->collection);
62 64
         }
63 65
     }
Please login to merge, or discard this patch.
src/Foundation/Traits/RefreshDatabase.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,15 +24,15 @@
 block discarded – undo
24 24
         /* If refresh fails. It usually means the database was only partially migrated or seeded.
25 25
         ** Start fresh if that's the case
26 26
         **/
27
-        try{
27
+        try {
28 28
             $this->artisan('migrate:refresh');
29
-        } catch (\Exception $e){
29
+        } catch (\Exception $e) {
30 30
             $this->artisan('cache:model:clear');
31 31
             $this->artisan('migrate:fresh');
32 32
             $this->artisan('migrate:refresh');
33 33
         }
34 34
         $this->artisan('db:seed');
35
-        $this->beforeApplicationDestroyed(function () {
35
+        $this->beforeApplicationDestroyed(function() {
36 36
             RefreshDatabaseState::$migrated = false;
37 37
         });
38 38
     }
Please login to merge, or discard this patch.
src/Modules/Telescope/Providers/TelescopeServiceProvider.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -22,13 +22,13 @@  discard block
 block discarded – undo
22 22
 
23 23
         //Telescope::night();
24 24
 
25
-        Telescope::filter(function (IncomingEntry $entry) {
25
+        Telescope::filter(function(IncomingEntry $entry) {
26 26
 
27
-            if(is_bool($filter = $this->filterHorizonEntries($entry))){
27
+            if (is_bool($filter = $this->filterHorizonEntries($entry))) {
28 28
                 return $filter;
29 29
             }
30 30
 
31
-            if(is_bool($filter = $this->filterCorsRequests($entry))){
31
+            if (is_bool($filter = $this->filterCorsRequests($entry))) {
32 32
                 return $filter;
33 33
             }
34 34
 
@@ -46,14 +46,14 @@  discard block
 block discarded – undo
46 46
     protected function filterHorizonEntries(IncomingEntry $entry)
47 47
     {
48 48
         if ($entry->type === EntryType::REQUEST
49
-            && isset($entry->content['uri'])
50
-            && str_contains($entry->content['uri'], 'horizon')) {
49
+            && isset($entry->content[ 'uri' ])
50
+            && str_contains($entry->content[ 'uri' ], 'horizon')) {
51 51
             return false;
52 52
         }
53 53
 
54 54
         if ($entry->type === EntryType::EVENT
55
-            && isset($entry->content['name'])
56
-            && str_contains($entry->content['name'], 'Horizon')) {
55
+            && isset($entry->content[ 'name' ])
56
+            && str_contains($entry->content[ 'name' ], 'Horizon')) {
57 57
             return false;
58 58
         }
59 59
     }
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
     protected function filterCorsRequests(IncomingEntry $entry)
62 62
     {
63 63
         if ($entry->type === EntryType::REQUEST
64
-            && isset($entry->content['method'])
65
-            && $entry->content['method'] === 'OPTIONS') {
64
+            && isset($entry->content[ 'method' ])
65
+            && $entry->content[ 'method' ] === 'OPTIONS') {
66 66
             return false;
67 67
         }
68 68
     }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      */
77 77
     protected function gate()
78 78
     {
79
-        Gate::define('viewTelescope', function ($user) {
79
+        Gate::define('viewTelescope', function($user) {
80 80
             return in_array($user->email, [
81 81
                 //
82 82
             ]);
Please login to merge, or discard this patch.
src/Foundation/Tests/TransformerTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         $this->machineNoUser = new MachineTestModel(null);
29 29
     }
30 30
 
31
-    public function testNoRelation(){
31
+    public function testNoRelation() {
32 32
         $machineResource = MachineTestTransformer::resource($this->machine)->serialize();
33 33
         $this->assertEmpty($machineResource);
34 34
         $this->assertArrayNotHasKey('user', $machineResource);
@@ -40,13 +40,13 @@  discard block
 block discarded – undo
40 40
         $this->assertArrayHasKey('user', $machineResource);
41 41
     }
42 42
 
43
-    public function testEmptyRelation(){
43
+    public function testEmptyRelation() {
44 44
         $machineResource = MachineTestTransformer::resource($this->machineNoUser)->include('user')->serialize();
45 45
         $this->assertArrayHasKey('user', $machineResource);
46
-        $this->assertNull($machineResource['user']);
46
+        $this->assertNull($machineResource[ 'user' ]);
47 47
     }
48 48
 
49
-    public function testPreIncludedRelation(){
49
+    public function testPreIncludedRelation() {
50 50
         $machineResource = UserIncludedMachineTestTransformer::resource($this->machine)->serialize();
51 51
         $this->assertArrayHasKey('user', $machineResource);
52 52
     }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 class MachineTestTransformer extends Transformer {
70 70
     public function toArray($request)
71 71
     {
72
-        return [];
72
+        return [ ];
73 73
     }
74 74
 
75 75
     public function transformUser(MachineTestModel $machine)
@@ -79,13 +79,13 @@  discard block
 block discarded – undo
79 79
 }
80 80
 
81 81
 class UserIncludedMachineTestTransformer extends MachineTestTransformer {
82
-    protected $include = ['user'];
82
+    protected $include = [ 'user' ];
83 83
 }
84 84
 
85 85
 class UserTestTransformer extends Transformer {
86 86
 
87 87
     public function toArray($request)
88 88
     {
89
-        return [];
89
+        return [ ];
90 90
     }
91 91
 }
92 92
\ No newline at end of file
Please login to merge, or discard this patch.
src/Foundation/Cache/ModelCache.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     /**
25 25
      * ModelCache constructor.
26 26
      */
27
-    public function __construct(string $model, array $indexes = [], $cacheTime = null)
27
+    public function __construct(string $model, array $indexes = [ ], $cacheTime = null)
28 28
     {
29 29
         $this->model = $model;
30 30
         $this->secondaryIndexes = $indexes;
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     protected function eagerLoadRelations($model)
69 69
     {
70 70
         if ($model !== null) {
71
-            return $model::eagerLoadRelations([$model])[0];
71
+            return $model::eagerLoadRelations([ $model ])[ 0 ];
72 72
         }
73 73
     }
74 74
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      */
83 83
     public function getCacheName($id, string $index = 'id')
84 84
     {
85
-        return config('model.cache_prefix') . ':' . strtolower(get_short_class_name($this->model)) . ':' . $index . ':' . $id;
85
+        return config('model.cache_prefix').':'.strtolower(get_short_class_name($this->model)).':'.$index.':'.$id;
86 86
     }
87 87
 
88 88
     /**
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
     private static function deleteWithPrefix($prefix)
142 142
     {
143 143
         $redis = self::getCacheConnection();
144
-        $keyPattern = Cache::getPrefix() . $prefix . '*';
144
+        $keyPattern = Cache::getPrefix().$prefix.'*';
145 145
         $keys = $redis->keys($keyPattern);
146 146
         $redis->delete($keys);
147 147
     }
@@ -167,12 +167,12 @@  discard block
 block discarded – undo
167 167
      */
168 168
     public function clearModelCache()
169 169
     {
170
-        $pattern = config('model.cache_prefix') . ':' . strtolower(get_short_class_name($this->model));
170
+        $pattern = config('model.cache_prefix').':'.strtolower(get_short_class_name($this->model));
171 171
         self::deleteWithPrefix($pattern);
172 172
     }
173 173
 
174 174
     public function enabled(): bool
175 175
     {
176
-        return (bool)config('model.caching');
176
+        return (bool) config('model.caching');
177 177
     }
178 178
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,8 +57,9 @@
 block discarded – undo
57 57
 
58 58
         if ($modelId === null) {
59 59
             $model = ($this->model)::where($index, $key)->first();
60
-            if ($model !== null)
61
-                $this->store($model);
60
+            if ($model !== null) {
61
+                            $this->store($model);
62
+            }
62 63
             return $model;
63 64
         }
64 65
 
Please login to merge, or discard this patch.
src/Foundation/Console/SeedCommand.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
         $this->resolver->setDefaultConnection($this->getDatabase());
36 36
 
37
-        Model::unguarded(function () {
37
+        Model::unguarded(function() {
38 38
             foreach ($this->getSeeders() as $seeder) {
39 39
                 $seeder = $this->laravel->make($seeder);
40 40
                 if (!isset($seeder->enabled) || $seeder->enabled)
@@ -49,6 +49,6 @@  discard block
 block discarded – undo
49 49
     {
50 50
         $this->service = $this->laravel->make(BootstrapRegistrarService::class);
51 51
 
52
-        return $this->service->getSeeders() ?? [];
52
+        return $this->service->getSeeders() ?? [ ];
53 53
     }
54 54
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,8 +37,9 @@
 block discarded – undo
37 37
         Model::unguarded(function () {
38 38
             foreach ($this->getSeeders() as $seeder) {
39 39
                 $seeder = $this->laravel->make($seeder);
40
-                if (!isset($seeder->enabled) || $seeder->enabled)
41
-                    $seeder->__invoke();
40
+                if (!isset($seeder->enabled) || $seeder->enabled) {
41
+                                    $seeder->__invoke();
42
+                }
42 43
             }
43 44
         });
44 45
 
Please login to merge, or discard this patch.