Test Setup Failed
Branch master (436403)
by Sherif
08:38
created
Modules/Core/Console/Commands/Stubs/Module/Http/Resources/DummyResource.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
      */
15 15
     public function toArray($request)
16 16
     {
17
-        if (! $this->resource) {
17
+        if (!$this->resource) {
18 18
             return [];
19 19
         }
20 20
 
Please login to merge, or discard this patch.
src/Modules/Core/Console/Commands/MakeModuleCommand.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         $this->container['slug']        = Str::slug($this->argument('slug'));
92 92
         $this->container['name']        = Str::studly($this->container['slug']);
93 93
         $this->container['version']     = '1.0';
94
-        $this->container['description'] = 'This is the description for the ' . $this->container['name'] . ' module.';
94
+        $this->container['description'] = 'This is the description for the '.$this->container['name'].' module.';
95 95
         $this->container['location']    = config('modules.default_location');
96 96
         $this->container['provider']    = config("modules.locations.{$this->container['location']}.provider");
97 97
         $this->container['basename']    = Str::studly($this->container['slug']);
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 
125 125
         $progress->finish();
126 126
 
127
-        event($this->container['slug'] . '.module.made');
127
+        event($this->container['slug'].'.module.made');
128 128
 
129 129
         $this->info("\nModule generated successfully.");
130 130
     }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         }
145 145
 
146 146
         $directory = module_path(null, $this->container['basename'], $location);
147
-        $source    = __DIR__ . '/Stubs/Module';
147
+        $source    = __DIR__.'/Stubs/Module';
148 148
 
149 149
         $this->files->makeDirectory($directory);
150 150
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
                 $subPath = str_replace($search, $replace, $subPath);
164 164
             }
165 165
 
166
-            $filePath = $directory . '/' . $subPath;
166
+            $filePath = $directory.'/'.$subPath;
167 167
             
168 168
             // if the file is module.json, replace it with the custom manifest file name
169 169
             if ($file->getFilename() === 'module.json' && $manifest) {
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
             
179 179
             $dir = dirname($filePath);
180 180
             
181
-            if (! $this->files->isDirectory($dir)) {
181
+            if (!$this->files->isDirectory($dir)) {
182 182
                 $this->files->makeDirectory($dir, 0755, true);
183 183
             }
184 184
 
@@ -213,22 +213,22 @@  discard block
 block discarded – undo
213 213
         ];
214 214
 
215 215
         $replace = [
216
-            ucfirst($modelNameSingular) . 'Factory',
216
+            ucfirst($modelNameSingular).'Factory',
217 217
             $modelNameSingular,
218 218
             $this->container['slug'],
219 219
             ucfirst($modelName),
220 220
             ucfirst($modelNameSingular),
221
-            ucfirst($modelName) . 'DatabaseSeeder',
222
-            ucfirst($modelName) . 'TableSeeder',
223
-            ucfirst($modelNameSingular) . 'Controller',
224
-            ucfirst($modelNameSingular) . 'Service',
225
-            ucfirst($modelNameSingular) . 'ServiceInterface',
226
-            ucfirst($modelNameSingular) . 'Repository',
227
-            ucfirst($modelNameSingular) . 'RepositoryInterface',
228
-            ucfirst($modelName) . 'Errors',
229
-            'Store' . ucfirst($modelNameSingular),
221
+            ucfirst($modelName).'DatabaseSeeder',
222
+            ucfirst($modelName).'TableSeeder',
223
+            ucfirst($modelNameSingular).'Controller',
224
+            ucfirst($modelNameSingular).'Service',
225
+            ucfirst($modelNameSingular).'ServiceInterface',
226
+            ucfirst($modelNameSingular).'Repository',
227
+            ucfirst($modelNameSingular).'RepositoryInterface',
228
+            ucfirst($modelName).'Errors',
229
+            'Store'.ucfirst($modelNameSingular),
230 230
             ucfirst($modelNameSingular),
231
-            ucfirst($modelNameSingular) . 'Observer',
231
+            ucfirst($modelNameSingular).'Observer',
232 232
             Str::snake($modelName),
233 233
             $modelName,
234 234
         ];
@@ -252,6 +252,6 @@  discard block
 block discarded – undo
252 252
         $modelName = $this->container['slug'];
253 253
         $migrationName = Str::camel($modelName);
254 254
         $migrationName = Str::snake($migrationName);
255
-        return $this->callSilent('make:module:migration', ['slug' => $modelName, 'name' => 'create_' . $migrationName . '_table']);
255
+        return $this->callSilent('make:module:migration', ['slug' => $modelName, 'name' => 'create_'.$migrationName.'_table']);
256 256
     }
257 257
 }
Please login to merge, or discard this patch.
src/Modules/Core/Console/Commands/PassportInstallCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
     {
33 33
         $this->call('passport:keys', ['--force' => $this->option('force'), '--length' => $this->option('length')]);
34 34
         $oauthClient = \Core::oauthCLients()->first(['password_client' => 1]);
35
-        if (! $oauthClient) {
35
+        if (!$oauthClient) {
36 36
             $oauthClient = $client->createPasswordGrantClient(
37 37
                 null,
38 38
                 config('app.name'),
Please login to merge, or discard this patch.
src/Modules/Core/BaseClasses/BaseService.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     {
43 43
         $translatable = $this->repo->model->translatable ?? [];
44 44
         $filters = $this->constructFilters($conditions, $local);
45
-        $sortBy = in_array($sortBy, $translatable) ? $sortBy . '->' . $local : $sortBy;
45
+        $sortBy = in_array($sortBy, $translatable) ? $sortBy.'->'.$local : $sortBy;
46 46
 
47 47
         if ($trashed) {
48 48
             return $this->deleted(['and' => $filters], $perPage ?? 15, $sortBy ?? 'created_at', $desc ?? true);
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                 /**
214 214
                  * Prepare key based on the the requested lang if it was translatable.
215 215
                  */
216
-                $key = in_array($key, $translatable) ? $key . '->' . $local : $key;
216
+                $key = in_array($key, $translatable) ? $key.'->'.$local : $key;
217 217
 
218 218
                 /**
219 219
                  * Convert 0/1 or true/false to boolean in case of not foreign key.
@@ -248,11 +248,11 @@  discard block
 block discarded – undo
248 248
                      * Default string filteration.
249 249
                      */
250 250
                 } elseif ($value) {
251
-                    $key = 'LOWER(' . $key . ')';
251
+                    $key = 'LOWER('.$key.')';
252 252
                     $value = strtolower($value);
253 253
                     $filters[$key] = [
254 254
                         'op' => 'like',
255
-                        'val' => '%' . $value . '%'
255
+                        'val' => '%'.$value.'%'
256 256
                     ];
257 257
                 }
258 258
             }
Please login to merge, or discard this patch.
src/Modules/Core/BaseClasses/Contracts/BaseServiceInterface.php 1 patch
Indentation   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -8,127 +8,127 @@
 block discarded – undo
8 8
 
9 9
 interface BaseServiceInterface
10 10
 {
11
-  /**
12
-   * Fetch records with relations based on the given params.
13
-   *
14
-   * @param   string $local
15
-   * @param   array  $relations
16
-   * @param   array  $conditions
17
-   * @param   int    $perPage
18
-   * @param   string $sortBy
19
-   * @param   bool   $desc
20
-   * @param   bool   $trashed
21
-   * @return LengthAwarePaginator
22
-   */
11
+    /**
12
+     * Fetch records with relations based on the given params.
13
+     *
14
+     * @param   string $local
15
+     * @param   array  $relations
16
+     * @param   array  $conditions
17
+     * @param   int    $perPage
18
+     * @param   string $sortBy
19
+     * @param   bool   $desc
20
+     * @param   bool   $trashed
21
+     * @return LengthAwarePaginator
22
+     */
23 23
     public function list(string $local, array $relations = [], array $conditions = [], int $perPage = 15, string $sortBy = 'created_at', bool $desc = true, bool $trashed = false): LengthAwarePaginator;
24 24
 
25
-  /**
26
-   * Fetch all records with relations from the storage.
27
-   *
28
-   * @param  array   $relations
29
-   * @param  string  $sortBy
30
-   * @param  boolean $desc
31
-   * @param  array   $columns
32
-   * @return collection
33
-   */
25
+    /**
26
+     * Fetch all records with relations from the storage.
27
+     *
28
+     * @param  array   $relations
29
+     * @param  string  $sortBy
30
+     * @param  boolean $desc
31
+     * @param  array   $columns
32
+     * @return collection
33
+     */
34 34
     public function all(array $relations = [], string $sortBy = 'created_at', bool $desc = true, array $columns = ['*']): Collection;
35 35
 
36
-  /**
37
-   * Fetch all records with relations from storage in pages.
38
-   *
39
-   * @param  integer $perPage
40
-   * @param  array   $relations
41
-   * @param  array   $sortBy
42
-   * @param  array   $desc
43
-   * @param  array   $columns
44
-   * @return LengthAwarePaginator
45
-   */
36
+    /**
37
+     * Fetch all records with relations from storage in pages.
38
+     *
39
+     * @param  integer $perPage
40
+     * @param  array   $relations
41
+     * @param  array   $sortBy
42
+     * @param  array   $desc
43
+     * @param  array   $columns
44
+     * @return LengthAwarePaginator
45
+     */
46 46
     public function paginate(int $perPage = 15, array $relations = [], string $sortBy = 'created_at', bool $desc = true, array $columns = ['*']): LengthAwarePaginator;
47 47
 
48
-  /**
49
-   * Fetch all records with relations based on
50
-   * the given condition from storage in pages.
51
-   *
52
-   * @param  array   $conditions array of conditions
53
-   * @param  integer $perPage
54
-   * @param  array   $relations
55
-   * @param  array   $sortBy
56
-   * @param  array   $desc
57
-   * @param  array   $columns
58
-   * @return collection
59
-   */
48
+    /**
49
+     * Fetch all records with relations based on
50
+     * the given condition from storage in pages.
51
+     *
52
+     * @param  array   $conditions array of conditions
53
+     * @param  integer $perPage
54
+     * @param  array   $relations
55
+     * @param  array   $sortBy
56
+     * @param  array   $desc
57
+     * @param  array   $columns
58
+     * @return collection
59
+     */
60 60
     public function paginateBy(array $conditions, int $perPage = 15, array $relations = [], string $sortBy = 'created_at', bool $desc = true, array $columns = ['*']): LengthAwarePaginator;
61 61
 
62
-  /**
63
-   * Save the given model/models to the storage.
64
-   *
65
-   * @param  array   $data
66
-   * @return Model
67
-   */
62
+    /**
63
+     * Save the given model/models to the storage.
64
+     *
65
+     * @param  array   $data
66
+     * @return Model
67
+     */
68 68
     public function save(array $data): Model;
69 69
 
70
-  /**
71
-   * Delete record from the storage based on the given
72
-   * condition.
73
-   *
74
-   * @param  string $value condition value
75
-   * @param  string $attribute condition column name
76
-   * @return bool
77
-   */
70
+    /**
71
+     * Delete record from the storage based on the given
72
+     * condition.
73
+     *
74
+     * @param  string $value condition value
75
+     * @param  string $attribute condition column name
76
+     * @return bool
77
+     */
78 78
     public function delete(string $value, string $attribute = 'id'): bool;
79 79
 
80
-  /**
81
-   * Fetch records from the storage based on the given
82
-   * id.
83
-   *
84
-   * @param  int   $id
85
-   * @param  array $relations
86
-   * @param  array $columns
87
-   * @return object
88
-   */
80
+    /**
81
+     * Fetch records from the storage based on the given
82
+     * id.
83
+     *
84
+     * @param  int   $id
85
+     * @param  array $relations
86
+     * @param  array $columns
87
+     * @return object
88
+     */
89 89
     public function find(int $id, array $relations = [], array $columns = ['*']): Model;
90 90
 
91
-  /**
92
-   * Fetch records from the storage based on the given
93
-   * condition.
94
-   *
95
-   * @param  array   $conditions array of conditions
96
-   * @param  array   $relations
97
-   * @param  array   $sortBy
98
-   * @param  array   $desc
99
-   * @param  array   $columns
100
-   * @return collection
101
-   */
91
+    /**
92
+     * Fetch records from the storage based on the given
93
+     * condition.
94
+     *
95
+     * @param  array   $conditions array of conditions
96
+     * @param  array   $relations
97
+     * @param  array   $sortBy
98
+     * @param  array   $desc
99
+     * @param  array   $columns
100
+     * @return collection
101
+     */
102 102
     public function findBy(array $conditions, array $relations = [], string $sortBy = 'created_at', bool $desc = true, array $columns = ['*']): Collection;
103 103
 
104
-  /**
105
-   * Fetch the first record fro the storage based on the given
106
-   * condition.
107
-   *
108
-   * @param  array $conditions array of conditions
109
-   * @param  array $relations
110
-   * @param  array $columns
111
-   * @return Model
112
-   */
104
+    /**
105
+     * Fetch the first record fro the storage based on the given
106
+     * condition.
107
+     *
108
+     * @param  array $conditions array of conditions
109
+     * @param  array $relations
110
+     * @param  array $columns
111
+     * @return Model
112
+     */
113 113
     public function first(array $conditions, array $relations = [], array $columns = ['*']): Model;
114 114
 
115
-  /**
116
-   * Return the deleted models in pages based on the given conditions.
117
-   *
118
-   * @param  array  $conditions array of conditions
119
-   * @param  int    $perPage
120
-   * @param  string $sortBy
121
-   * @param  bool   $desc
122
-   * @param  array  $columns
123
-   * @return LengthAwarePaginator
124
-   */
115
+    /**
116
+     * Return the deleted models in pages based on the given conditions.
117
+     *
118
+     * @param  array  $conditions array of conditions
119
+     * @param  int    $perPage
120
+     * @param  string $sortBy
121
+     * @param  bool   $desc
122
+     * @param  array  $columns
123
+     * @return LengthAwarePaginator
124
+     */
125 125
     public function deleted(array $conditions, int $perPage = 15, string $sortBy = 'created_at', bool $desc = true, array $columns = ['*']): LengthAwarePaginator;
126 126
 
127
-  /**
128
-   * Restore the deleted model.
129
-   *
130
-   * @param  int $id
131
-   * @return bool
132
-   */
127
+    /**
128
+     * Restore the deleted model.
129
+     *
130
+     * @param  int $id
131
+     * @return bool
132
+     */
133 133
     public function restore(int $id): bool;
134 134
 }
Please login to merge, or discard this patch.
src/Modules/Core/BaseClasses/Contracts/BaseRepositoryInterface.php 1 patch
Indentation   +109 added lines, -109 removed lines patch added patch discarded remove patch
@@ -8,138 +8,138 @@
 block discarded – undo
8 8
 
9 9
 interface BaseRepositoryInterface
10 10
 {
11
-  /**
12
-   * Fetch all records with relations from the storage.
13
-   *
14
-   * @param  array  $relations
15
-   * @param  string $sortBy
16
-   * @param  bool   $desc
17
-   * @param  array  $columns
18
-   * @return collection
19
-   */
11
+    /**
12
+     * Fetch all records with relations from the storage.
13
+     *
14
+     * @param  array  $relations
15
+     * @param  string $sortBy
16
+     * @param  bool   $desc
17
+     * @param  array  $columns
18
+     * @return collection
19
+     */
20 20
     public function all(array $relations = [], string $sortBy = 'created_at', bool $desc = true, array $columns = ['*']): Collection;
21 21
 
22
-  /**
23
-   * Fetch all records with relations from storage in pages.
24
-   *
25
-   * @param  int    $perPage
26
-   * @param  array  $relations
27
-   * @param  string $sortBy
28
-   * @param  bool   $desc
29
-   * @param  array  $columns
30
-   * @return LengthAwarePaginator
31
-   */
22
+    /**
23
+     * Fetch all records with relations from storage in pages.
24
+     *
25
+     * @param  int    $perPage
26
+     * @param  array  $relations
27
+     * @param  string $sortBy
28
+     * @param  bool   $desc
29
+     * @param  array  $columns
30
+     * @return LengthAwarePaginator
31
+     */
32 32
     public function paginate(int $perPage = 15, array $relations = [], string $sortBy = 'created_at', bool $desc = true, array $columns = ['*']): LengthAwarePaginator;
33 33
 
34
-  /**
35
-   * Fetch all records with relations based on
36
-   * the given condition from storage in pages.
37
-   *
38
-   * @param  array   $conditions array of conditions
39
-   * @param  integer $perPage
40
-   * @param  array   $relations
41
-   * @param  array   $sortBy
42
-   * @param  array   $desc
43
-   * @param  array   $columns
44
-   * @return collection
45
-   */
34
+    /**
35
+     * Fetch all records with relations based on
36
+     * the given condition from storage in pages.
37
+     *
38
+     * @param  array   $conditions array of conditions
39
+     * @param  integer $perPage
40
+     * @param  array   $relations
41
+     * @param  array   $sortBy
42
+     * @param  array   $desc
43
+     * @param  array   $columns
44
+     * @return collection
45
+     */
46 46
     public function paginateBy(array $conditions, int $perPage = 15, array $relations = [], string $sortBy = 'created_at', bool $desc = true, array $columns = ['*']): LengthAwarePaginator;
47 47
 
48
-  /**
49
-   * Count all records based on the given condition from storage.
50
-   *
51
-   * @param  array $conditions array of conditions
52
-   * @return int
53
-   */
48
+    /**
49
+     * Count all records based on the given condition from storage.
50
+     *
51
+     * @param  array $conditions array of conditions
52
+     * @return int
53
+     */
54 54
     public function count(array $conditions = []): int;
55 55
 
56
-  /**
57
-   * Pluck column based on the given condition from storage.
58
-   *
59
-   * @param  array  $conditions array of conditions
60
-   * @param  string $column
61
-   * @return collection
62
-   */
56
+    /**
57
+     * Pluck column based on the given condition from storage.
58
+     *
59
+     * @param  array  $conditions array of conditions
60
+     * @param  string $column
61
+     * @return collection
62
+     */
63 63
     public function pluck(array $conditions, string $column): Collection;
64 64
 
65
-  /**
66
-   * Save the given model to the storage.
67
-   *
68
-   * @param  array $data
69
-   * @return Model
70
-   */
65
+    /**
66
+     * Save the given model to the storage.
67
+     *
68
+     * @param  array $data
69
+     * @return Model
70
+     */
71 71
     public function save(array $data): Model;
72 72
 
73
-  /**
74
-   * Insert the given model/models to the storage.
75
-   *
76
-   * @param  array $data
77
-   * @return bool
78
-   */
73
+    /**
74
+     * Insert the given model/models to the storage.
75
+     *
76
+     * @param  array $data
77
+     * @return bool
78
+     */
79 79
     public function insert(array $data): bool;
80 80
 
81
-  /**
82
-   * Delete record from the storage based on the given
83
-   * condition.
84
-   *
85
-   * @param  string $value condition value
86
-   * @param  string $attribute condition column name
87
-   * @return bool
88
-   */
81
+    /**
82
+     * Delete record from the storage based on the given
83
+     * condition.
84
+     *
85
+     * @param  string $value condition value
86
+     * @param  string $attribute condition column name
87
+     * @return bool
88
+     */
89 89
     public function delete(string $value, string $attribute = 'id'): bool;
90 90
 
91
-  /**
92
-   * Fetch records from the storage based on the given
93
-   * id.
94
-   *
95
-   * @param  int   $id
96
-   * @param  array $relations
97
-   * @param  array $columns
98
-   * @return Model
99
-   */
91
+    /**
92
+     * Fetch records from the storage based on the given
93
+     * id.
94
+     *
95
+     * @param  int   $id
96
+     * @param  array $relations
97
+     * @param  array $columns
98
+     * @return Model
99
+     */
100 100
     public function find(int $id, array $relations = [], array $columns = ['*']): Model;
101 101
 
102
-  /**
103
-   * Fetch records from the storage based on the given
104
-   * condition.
105
-   *
106
-   * @param  array   $conditions array of conditions
107
-   * @param  array   $relations
108
-   * @param  string  $sortBy
109
-   * @param  bool    $desc
110
-   * @param  array   $columns
111
-   * @return collection
112
-   */
102
+    /**
103
+     * Fetch records from the storage based on the given
104
+     * condition.
105
+     *
106
+     * @param  array   $conditions array of conditions
107
+     * @param  array   $relations
108
+     * @param  string  $sortBy
109
+     * @param  bool    $desc
110
+     * @param  array   $columns
111
+     * @return collection
112
+     */
113 113
     public function findBy(array $conditions, array $relations = [], string $sortBy = 'created_at', bool $desc = true, array $columns = ['*']): Collection;
114 114
 
115
-  /**
116
-   * Fetch the first record fro the storage based on the given
117
-   * condition.
118
-   *
119
-   * @param  array $conditions array of conditions
120
-   * @param  array $relations
121
-   * @param  array $columns
122
-   * @return Model
123
-   */
115
+    /**
116
+     * Fetch the first record fro the storage based on the given
117
+     * condition.
118
+     *
119
+     * @param  array $conditions array of conditions
120
+     * @param  array $relations
121
+     * @param  array $columns
122
+     * @return Model
123
+     */
124 124
     public function first(array $conditions, array $relations = [], array $columns = ['*']): Model;
125 125
 
126
-  /**
127
-   * Return the deleted models in pages based on the given conditions.
128
-   *
129
-   * @param  array  $conditions array of conditions
130
-   * @param  int    $perPage
131
-   * @param  string $sortBy
132
-   * @param  bool   $desc
133
-   * @param  array  $columns
134
-   * @return LengthAwarePaginator
135
-   */
126
+    /**
127
+     * Return the deleted models in pages based on the given conditions.
128
+     *
129
+     * @param  array  $conditions array of conditions
130
+     * @param  int    $perPage
131
+     * @param  string $sortBy
132
+     * @param  bool   $desc
133
+     * @param  array  $columns
134
+     * @return LengthAwarePaginator
135
+     */
136 136
     public function deleted(array $conditions, int $perPage = 15, string $sortBy = 'created_at', bool $desc = true, array $columns = ['*']): LengthAwarePaginator;
137 137
 
138
-  /**
139
-   * Restore the deleted model.
140
-   *
141
-   * @param  int $id
142
-   * @return bool
143
-   */
138
+    /**
139
+     * Restore the deleted model.
140
+     *
141
+     * @param  int $id
142
+     * @return bool
143
+     */
144 144
     public function restore(int $id): bool;
145 145
 }
Please login to merge, or discard this patch.
src/Modules/Core/BaseClasses/BaseEnum.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
     {
56 56
         $stringArr = [];
57 57
         collect(self::all())->each(function ($item, $key) use (&$stringArr) {
58
-            $stringArr[] = $key . ': ' . $item;
58
+            $stringArr[] = $key.': '.$item;
59 59
         });
60 60
 
61 61
         return implode(',', $stringArr);
Please login to merge, or discard this patch.
src/Modules/Core/BaseClasses/BaseRepository.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
         $model = $this->model->onlyTrashed()->find($id);
249 249
 
250 250
         if (!$model) {
251
-            Errors::notFound(class_basename($this->model) . ' with id : ' . $id);
251
+            Errors::notFound(class_basename($this->model).' with id : '.$id);
252 252
         }
253 253
 
254 254
         $model->restore();
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
         $model = Arr::has($data, 'id') ? $modelClass->lockForUpdate()->find($data['id']) : new $modelClass;
269 269
 
270 270
         if (!$model) {
271
-            Errors::notFound(class_basename($modelClass) . ' with id : ' . $data['id']);
271
+            Errors::notFound(class_basename($modelClass).' with id : '.$data['id']);
272 272
         }
273 273
 
274 274
         foreach ($data as $key => $value) {
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
         }
332 332
 
333 333
         if (!$relatedModel) {
334
-            Errors::notFound(class_basename($relationBaseModel) . ' with id : ' . $relatedModelData['id']);
334
+            Errors::notFound(class_basename($relationBaseModel).' with id : '.$relatedModelData['id']);
335 335
         }
336 336
 
337 337
         if (is_array($relatedModelData)) {
@@ -401,11 +401,11 @@  discard block
 block discarded – undo
401 401
 
402 402
             if ($key == 'and') {
403 403
                 $conditions       = $this->constructConditions($value, $model);
404
-                $conditionString .= str_replace('{op}', 'and', $conditions['conditionString']) . ' {op} ';
404
+                $conditionString .= str_replace('{op}', 'and', $conditions['conditionString']).' {op} ';
405 405
                 $conditionValues  = array_merge($conditionValues, $conditions['conditionValues']);
406 406
             } elseif ($key == 'or') {
407 407
                 $conditions       = $this->constructConditions($value, $model);
408
-                $conditionString .= str_replace('{op}', 'or', $conditions['conditionString']) . ' {op} ';
408
+                $conditionString .= str_replace('{op}', 'or', $conditions['conditionString']).' {op} ';
409 409
                 $conditionValues  = array_merge($conditionValues, $conditions['conditionValues']);
410 410
             } else {
411 411
                 if (is_array($value)) {
@@ -421,38 +421,38 @@  discard block
 block discarded – undo
421 421
                 }
422 422
 
423 423
                 if (strtolower($operator) == 'between') {
424
-                    $conditionString  .= $key . ' >= ? and ';
424
+                    $conditionString  .= $key.' >= ? and ';
425 425
                     $conditionValues[] = $value1;
426 426
 
427
-                    $conditionString  .= $key . ' <= ? {op} ';
427
+                    $conditionString  .= $key.' <= ? {op} ';
428 428
                     $conditionValues[] = $value2;
429 429
                 } elseif (strtolower($operator) == 'in') {
430 430
                     $conditionValues  = array_merge($conditionValues, $value);
431 431
                     $inBindingsString = rtrim(str_repeat('?,', count($value)), ',');
432
-                    $conditionString .= $key . ' in (' . rtrim($inBindingsString, ',') . ') {op} ';
432
+                    $conditionString .= $key.' in ('.rtrim($inBindingsString, ',').') {op} ';
433 433
                 } elseif (strtolower($operator) == 'null') {
434
-                    $conditionString .= $key . ' is null {op} ';
434
+                    $conditionString .= $key.' is null {op} ';
435 435
                 } elseif (strtolower($operator) == 'not null') {
436
-                    $conditionString .= $key . ' is not null {op} ';
436
+                    $conditionString .= $key.' is not null {op} ';
437 437
                 } elseif (strtolower($operator) == 'has') {
438 438
                     $sql              = $model->withTrashed()->withoutGlobalScopes()->has($key)->toSql();
439 439
                     $bindings         = $model->withTrashed()->withoutGlobalScopes()->has($key)->getBindings();
440 440
                     if ($value) {
441 441
                         $conditions       = $this->constructConditions($value, $model->$key()->getRelated());
442
-                        $conditionString .= substr(substr($sql, strpos($sql, 'exists')), 0, -1) . ' and ' . $conditions['conditionString'] . ') {op} ';
442
+                        $conditionString .= substr(substr($sql, strpos($sql, 'exists')), 0, -1).' and '.$conditions['conditionString'].') {op} ';
443 443
                         $conditionValues  = array_merge($conditionValues, $bindings);
444 444
                         $conditionValues  = array_merge($conditionValues, $conditions['conditionValues']);
445 445
                     } else {
446
-                        $conditionString .= substr(substr($sql, strpos($sql, 'exists')), 0, -1) . ') {op} ';
446
+                        $conditionString .= substr(substr($sql, strpos($sql, 'exists')), 0, -1).') {op} ';
447 447
                         $conditionValues  = array_merge($conditionValues, $bindings);
448 448
                     }
449 449
                 } else {
450
-                    $conditionString  .= $key . ' ' . $operator . ' ? {op} ';
450
+                    $conditionString  .= $key.' '.$operator.' ? {op} ';
451 451
                     $conditionValues[] = $value;
452 452
                 }
453 453
             }
454 454
         }
455
-        $conditionString = '(' . rtrim($conditionString, '{op} ') . ')';
455
+        $conditionString = '('.rtrim($conditionString, '{op} ').')';
456 456
         return ['conditionString' => $conditionString, 'conditionValues' => $conditionValues];
457 457
     }
458 458
 
@@ -469,9 +469,9 @@  discard block
 block discarded – undo
469 469
         $path       = explode('->', $value);
470 470
         $field      = array_shift($path);
471 471
         $result     = sprintf('%s->\'$.%s\'', $field, collect($path)->map(function ($part) {
472
-            return '"' . $part . '"';
472
+            return '"'.$part.'"';
473 473
         })->implode('.'));
474 474
 
475
-        return $removeLast === false ? $result : $result . ')';
475
+        return $removeLast === false ? $result : $result.')';
476 476
     }
477 477
 }
Please login to merge, or discard this patch.
src/Modules/Users/Http/Resources/AclUser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
      */
18 18
     public function toArray($request)
19 19
     {
20
-        if (! $this->resource) {
20
+        if (!$this->resource) {
21 21
             return [];
22 22
         }
23 23
 
Please login to merge, or discard this patch.