Completed
Push — master ( 8023d3...8b2ccd )
by Sherif
10:04
created
src/Modules/Core/Console/Commands/MakeModuleCommand.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         $this->container['slug']        = Str::slug($this->argument('slug'));
91 91
         $this->container['name']        = Str::studly($this->container['slug']);
92 92
         $this->container['version']     = '1.0';
93
-        $this->container['description'] = 'This is the description for the ' . $this->container['name'] . ' module.';
93
+        $this->container['description'] = 'This is the description for the '.$this->container['name'].' module.';
94 94
         $this->container['location']    = config('modules.default_location');
95 95
         $this->container['provider']    = config("modules.locations.{$this->container['location']}.provider");
96 96
         $this->container['basename']    = Str::studly($this->container['slug']);
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
         $progress->finish();
125 125
 
126
-        event($this->container['slug'] . '.module.made');
126
+        event($this->container['slug'].'.module.made');
127 127
 
128 128
         $this->info("\nModule generated successfully.");
129 129
     }
@@ -138,18 +138,18 @@  discard block
 block discarded – undo
138 138
         $manifest = config("modules.locations.$location.manifest") ?: 'module.json';
139 139
         $provider = config("modules.locations.$location.provider") ?: 'ModuleServiceProvider';
140 140
 
141
-        if (!$this->files->isDirectory($root)) {
141
+        if ( ! $this->files->isDirectory($root)) {
142 142
             $this->files->makeDirectory($root);
143 143
         }
144 144
 
145 145
         $directory = module_path(null, $this->container['basename'], $location);
146
-        $source    = __DIR__ . '/Stubs/Module';
146
+        $source    = __DIR__.'/Stubs/Module';
147 147
 
148 148
         $this->files->makeDirectory($directory);
149 149
 
150 150
         $sourceFiles = $this->files->allFiles($source, true);
151 151
 
152
-        if (!empty($this->mapping)) {
152
+        if ( ! empty($this->mapping)) {
153 153
             $search = array_keys($this->mapping);
154 154
             $replace = array_values($this->mapping);
155 155
         }
@@ -158,11 +158,11 @@  discard block
 block discarded – undo
158 158
             $contents = $this->replacePlaceholders($file->getContents());
159 159
             $subPath = $file->getRelativePathname();
160 160
 
161
-            if (!empty($this->mapping)) {
161
+            if ( ! empty($this->mapping)) {
162 162
                 $subPath = str_replace($search, $replace, $subPath);
163 163
             }
164 164
 
165
-            $filePath = $directory . '/' . $subPath;
165
+            $filePath = $directory.'/'.$subPath;
166 166
             
167 167
             // if the file is module.json, replace it with the custom manifest file name
168 168
             if ($file->getFilename() === 'module.json' && $manifest) {
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
             
178 178
             $dir = dirname($filePath);
179 179
             
180
-            if (! $this->files->isDirectory($dir)) {
180
+            if ( ! $this->files->isDirectory($dir)) {
181 181
                 $this->files->makeDirectory($dir, 0755, true);
182 182
             }
183 183
 
@@ -211,21 +211,21 @@  discard block
 block discarded – undo
211 211
         ];
212 212
 
213 213
         $replace = [
214
-            ucfirst($modelNameSingular) . 'Factory',
214
+            ucfirst($modelNameSingular).'Factory',
215 215
             $modelNameSingular,
216 216
             $this->container['slug'],
217 217
             ucfirst($modelName),
218 218
             ucfirst($modelNameSingular),
219
-            ucfirst($modelName) . 'DatabaseSeeder',
220
-            ucfirst($modelName) . 'TableSeeder',
221
-            ucfirst($modelNameSingular) . 'Controller',
222
-            ucfirst($modelNameSingular) . 'Service',
223
-            ucfirst($modelNameSingular) . 'Repository',
224
-            ucfirst($modelName) . 'Errors',
225
-            'Insert' . ucfirst($modelNameSingular),
226
-            'Update' . ucfirst($modelNameSingular),
219
+            ucfirst($modelName).'DatabaseSeeder',
220
+            ucfirst($modelName).'TableSeeder',
221
+            ucfirst($modelNameSingular).'Controller',
222
+            ucfirst($modelNameSingular).'Service',
223
+            ucfirst($modelNameSingular).'Repository',
224
+            ucfirst($modelName).'Errors',
225
+            'Insert'.ucfirst($modelNameSingular),
226
+            'Update'.ucfirst($modelNameSingular),
227 227
             ucfirst($modelNameSingular),
228
-            ucfirst($modelNameSingular) . 'Observer',
228
+            ucfirst($modelNameSingular).'Observer',
229 229
             $modelName,
230 230
             $modelName,
231 231
         ];
@@ -247,6 +247,6 @@  discard block
 block discarded – undo
247 247
     protected function generateMigration()
248 248
     {
249 249
         $modelName = $this->container['slug'];
250
-        return $this->callSilent('make:module:migration', ['slug' => $modelName, 'name' => 'create_' . $modelName . '_table']);
250
+        return $this->callSilent('make:module:migration', ['slug' => $modelName, 'name' => 'create_'.$modelName.'_table']);
251 251
     }
252 252
 }
Please login to merge, or discard this patch.
src/Modules/Core/Errors/Errors.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@
 block discarded – undo
19 19
     public function __call($name, $arguments)
20 20
     {
21 21
         foreach (\Module::all() as $module) {
22
-            $nameSpace = 'App\\Modules\\' . $module['basename'];
23
-            $class = $nameSpace . '\\Errors\\' . $module['basename'] . 'Errors';
22
+            $nameSpace = 'App\\Modules\\'.$module['basename'];
23
+            $class = $nameSpace.'\\Errors\\'.$module['basename'].'Errors';
24 24
 
25 25
             if (class_exists($class)) {
26 26
                 $class = \App::make($class);
Please login to merge, or discard this patch.
Database/Migrations/2018_08_08_100000_create_telescope_entries_table.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public function up()
42 42
     {
43
-        $this->schema->create('telescope_entries', function (Blueprint $table) {
43
+        $this->schema->create('telescope_entries', function(Blueprint $table) {
44 44
             $table->bigIncrements('sequence');
45 45
             $table->uuid('uuid');
46 46
             $table->uuid('batch_id');
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             $table->index(['type', 'should_display_on_index']);
56 56
         });
57 57
 
58
-        $this->schema->create('telescope_entries_tags', function (Blueprint $table) {
58
+        $this->schema->create('telescope_entries_tags', function(Blueprint $table) {
59 59
             $table->uuid('entry_uuid');
60 60
             $table->string('tag');
61 61
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
                   ->onDelete('cascade');
69 69
         });
70 70
 
71
-        $this->schema->create('telescope_monitoring', function (Blueprint $table) {
71
+        $this->schema->create('telescope_monitoring', function(Blueprint $table) {
72 72
             $table->string('tag');
73 73
         });
74 74
     }
Please login to merge, or discard this patch.
src/Modules/Core/BaseClasses/BaseRepository.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      */
22 22
     public function __construct($model)
23 23
     {
24
-        $this->model  = $model;
24
+        $this->model = $model;
25 25
     }
26 26
 
27 27
     /**
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         $model      = false;
87 87
         $relations  = [];
88 88
 
89
-        \DB::transaction(function () use (&$model, &$relations, $data) {
89
+        \DB::transaction(function() use (&$model, &$relations, $data) {
90 90
             
91 91
             $model     = $this->prepareModel($data);
92 92
             $relations = $this->prepareRelations($data, $model);
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
      */
111 111
     public function delete($value, $attribute = 'id')
112 112
     {
113
-        \DB::transaction(function () use ($value, $attribute) {
114
-            $this->model->where($attribute, '=', $value)->lockForUpdate()->get()->each(function ($model) {
113
+        \DB::transaction(function() use ($value, $attribute) {
114
+            $this->model->where($attribute, '=', $value)->lockForUpdate()->get()->each(function($model) {
115 115
                 $model->delete();
116 116
             });
117 117
         });
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
     {
202 202
         $model = $this->model->onlyTrashed()->find($id);
203 203
 
204
-        if (! $model) {
204
+        if ( ! $model) {
205 205
             \Errors::notFound(class_basename($this->model).' with id : '.$id);
206 206
         }
207 207
 
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
          * @var array
226 226
          */
227 227
         $model = Arr::has($data, 'id') ? $modelClass->lockForUpdate()->find($data['id']) : new $modelClass;
228
-        if (! $model) {
228
+        if ( ! $model) {
229 229
             \Errors::notFound(class_basename($modelClass).' with id : '.$data['id']);
230 230
         }
231 231
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
                      * If the relation has no value then marke the relation data
283 283
                      * related to the model to be deleted.
284 284
                      */
285
-                    if (! $value || ! count($value)) {
285
+                    if ( ! $value || ! count($value)) {
286 286
                         $relations[$relation] = 'delete';
287 287
                     }
288 288
                 }
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
                             /**
310 310
                              * If model doesn't exists.
311 311
                              */
312
-                            if (! $relationModel) {
312
+                            if ( ! $relationModel) {
313 313
                                 \Errors::notFound(class_basename($relationBaseModel).' with id : '.$val['id']);
314 314
                             }
315 315
 
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
                                 /**
341 341
                                  * If model doesn't exists.
342 342
                                  */
343
-                                if (! $relationModel) {
343
+                                if ( ! $relationModel) {
344 344
                                     \Errors::notFound(class_basename($relationBaseModel).' with id : '.$value['id']);
345 345
                                 }
346 346
 
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
         $value      = $removeLast === false ? $value : substr($value, 0, $removeLast);
547 547
         $path       = explode('->', $value);
548 548
         $field      = array_shift($path);
549
-        $result     = sprintf('%s->\'$.%s\'', $field, collect($path)->map(function ($part) {
549
+        $result     = sprintf('%s->\'$.%s\'', $field, collect($path)->map(function($part) {
550 550
             return '"'.$part.'"';
551 551
         })->implode('.'));
552 552
         
Please login to merge, or discard this patch.
src/Modules/OauthClients/Routes/api.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 |
12 12
 */
13 13
 
14
-Route::group(['prefix' => 'oauth/clients'], function () {
14
+Route::group(['prefix' => 'oauth/clients'], function() {
15 15
 
16 16
     Route::get('/', 'OauthClientController@index');
17 17
     Route::get('{id}', 'OauthClientController@show');
Please login to merge, or discard this patch.
src/Modules/Permissions/Routes/api.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
 */
15 15
 
16
-Route::group(['prefix' => 'permissions'], function () {
16
+Route::group(['prefix' => 'permissions'], function() {
17 17
         
18 18
     Route::get('/', 'PermissionController@index');
19 19
     Route::get('/{id}', 'PermissionController@show');
Please login to merge, or discard this patch.
src/Modules/Reporting/Routes/api.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 |
12 12
 */
13 13
 
14
-Route::group(['prefix' => 'reports'], function () {
14
+Route::group(['prefix' => 'reports'], function() {
15 15
         
16 16
     Route::get('/', 'ReportController@index');
17 17
     Route::get('/{id}', 'ReportController@show');
Please login to merge, or discard this patch.
src/Modules/PushNotificationDevices/Routes/api.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
 */
15 15
 
16
-Route::group(['prefix' => 'push/notification/devices'], function () {
16
+Route::group(['prefix' => 'push/notification/devices'], function() {
17 17
         
18 18
     Route::get('/', 'PushNotificationDeviceController@index');
19 19
     Route::get('{id}', 'PushNotificationDeviceController@show');
Please login to merge, or discard this patch.
src/Modules/Core/Console/Commands/Stubs/Module/Routes/api.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
 */
15 15
 
16
-Route::group(['prefix' => 'DummyRoutePrefix'], function () {
16
+Route::group(['prefix' => 'DummyRoutePrefix'], function() {
17 17
 
18 18
     Route::get('/', 'DummyController@index');
19 19
     Route::get('{id}', 'DummyController@show');
Please login to merge, or discard this patch.