@@ -141,20 +141,20 @@ discard block |
||
141 | 141 | |
142 | 142 | if (is_dir($baseDirectory)) { |
143 | 143 | // initialize the namespace prefix array |
144 | - if (isset($this->namespaceDirs[ $namespace ]) === false) { |
|
145 | - $this->namespaceDirs[ $namespace ] = []; |
|
144 | + if (isset($this->namespaceDirs[$namespace]) === false) { |
|
145 | + $this->namespaceDirs[$namespace] = []; |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | // retain the base directory for the namespace prefix |
149 | - if ( ! in_array($baseDirectory, $this->namespaceDirs[ $namespace ])) { |
|
149 | + if ( ! in_array($baseDirectory, $this->namespaceDirs[$namespace])) { |
|
150 | 150 | if ($prepend) { |
151 | - array_unshift($this->namespaceDirs[ $namespace ], $baseDirectory); |
|
151 | + array_unshift($this->namespaceDirs[$namespace], $baseDirectory); |
|
152 | 152 | } else { |
153 | - array_push($this->namespaceDirs[ $namespace ], $baseDirectory); |
|
153 | + array_push($this->namespaceDirs[$namespace], $baseDirectory); |
|
154 | 154 | } |
155 | 155 | } |
156 | 156 | |
157 | - $this->namespaceDirsMap[ $baseDirectory ] = $namespace; |
|
157 | + $this->namespaceDirsMap[$baseDirectory] = $namespace; |
|
158 | 158 | |
159 | 159 | // Register Namespace Language |
160 | 160 | language()->addFilePath($baseDirectory); |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | |
193 | 193 | if (is_dir($publicDir) and ! in_array($publicDir, $this->publicDirs)) { |
194 | 194 | if (isset($offset)) { |
195 | - $this->publicDirs[ $offset ] = $publicDir; |
|
195 | + $this->publicDirs[$offset] = $publicDir; |
|
196 | 196 | } else { |
197 | 197 | $this->publicDirs[] = $publicDir; |
198 | 198 | } |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | |
218 | 218 | if (is_dir($resourcesDir) and ! in_array($resourcesDir, $this->resourcesDirs)) { |
219 | 219 | if (isset($offset)) { |
220 | - $this->resourcesDirs[ $offset ] = $resourcesDir; |
|
220 | + $this->resourcesDirs[$offset] = $resourcesDir; |
|
221 | 221 | } else { |
222 | 222 | $this->resourcesDirs[] = $resourcesDir; |
223 | 223 | } |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | $dir = rtrim($dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; |
276 | 276 | |
277 | 277 | if (array_key_exists($dir, $this->namespaceDirsMap)) { |
278 | - return $this->namespaceDirsMap[ $dir ]; |
|
278 | + return $this->namespaceDirsMap[$dir]; |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | return false; |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | $namespace = trim($namespace, '\\') . '\\'; |
317 | 317 | |
318 | 318 | if (array_key_exists($namespace, $this->namespaceDirs)) { |
319 | - return $this->namespaceDirs[ $namespace ]; |
|
319 | + return $this->namespaceDirs[$namespace]; |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | return false; |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | } |
340 | 340 | |
341 | 341 | if ($this->requireFile($helper)) { |
342 | - $this->loadedHelpers[ pathinfo($helper, PATHINFO_FILENAME) ][] = $helper; |
|
342 | + $this->loadedHelpers[pathinfo($helper, PATHINFO_FILENAME)][] = $helper; |
|
343 | 343 | |
344 | 344 | return; |
345 | 345 | } |
@@ -355,17 +355,17 @@ discard block |
||
355 | 355 | } |
356 | 356 | |
357 | 357 | if ( ! array_key_exists($helper, $this->loadedHelpers)) { |
358 | - $this->loadedHelpers[ $helper ] = []; |
|
358 | + $this->loadedHelpers[$helper] = []; |
|
359 | 359 | } |
360 | 360 | |
361 | 361 | foreach ($helperDirectories as $helperDirectory) { |
362 | 362 | |
363 | 363 | $helperFilePath = $helperDirectory . studlycase($helper) . '.php'; |
364 | 364 | |
365 | - if (in_array($helperFilePath, $this->loadedHelpers[ $helper ])) { |
|
365 | + if (in_array($helperFilePath, $this->loadedHelpers[$helper])) { |
|
366 | 366 | continue; |
367 | 367 | } elseif ($this->requireFile($helperFilePath)) { |
368 | - $this->loadedHelpers[ $helper ][] = $helperFilePath; |
|
368 | + $this->loadedHelpers[$helper][] = $helperFilePath; |
|
369 | 369 | } |
370 | 370 | } |
371 | 371 | } |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | if (false !== ($modules = modules()->getRegistry())) { |
397 | 397 | foreach ($modules as $module) { |
398 | 398 | if ($module instanceof Module) { |
399 | - if (empty($this->namespaceDirs[ $module->getNamespace() ])) { |
|
399 | + if (empty($this->namespaceDirs[$module->getNamespace()])) { |
|
400 | 400 | $this->addNamespace($module->getNamespace(), $module->getRealPath()); |
401 | 401 | } |
402 | 402 | } |
@@ -458,12 +458,12 @@ discard block |
||
458 | 458 | public function loadMappedFile($namespace, $relativeClass) |
459 | 459 | { |
460 | 460 | // are there any base directories for this namespace prefix? |
461 | - if (isset($this->namespaceDirs[ $namespace ]) === false) { |
|
461 | + if (isset($this->namespaceDirs[$namespace]) === false) { |
|
462 | 462 | return false; |
463 | 463 | } |
464 | 464 | |
465 | 465 | // look through base directories for this namespace prefix |
466 | - foreach ($this->namespaceDirs[ $namespace ] as $namespaceDirectory) { |
|
466 | + foreach ($this->namespaceDirs[$namespace] as $namespaceDirectory) { |
|
467 | 467 | |
468 | 468 | // replace the namespace prefix with the base directory, |
469 | 469 | // replace namespace separators with directory separators |
@@ -528,9 +528,9 @@ discard block |
||
528 | 528 | public function services(array $classes) |
529 | 529 | { |
530 | 530 | foreach ($classes as $name => $class) { |
531 | - if(is_numeric($name)) { |
|
531 | + if (is_numeric($name)) { |
|
532 | 532 | services()->load($class); |
533 | - } elseif(is_string($name)) { |
|
533 | + } elseif (is_string($name)) { |
|
534 | 534 | services()->load($class, $name); |
535 | 535 | } |
536 | 536 | } |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | |
548 | 548 | public function models(array $models) |
549 | 549 | { |
550 | - foreach($models as $model) { |
|
550 | + foreach ($models as $model) { |
|
551 | 551 | models()->load($model); |
552 | 552 | } |
553 | 553 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public function loadRegistry() |
61 | 61 | { |
62 | - if(empty($this->registry)) { |
|
62 | + if (empty($this->registry)) { |
|
63 | 63 | $cacheItemPool = cache()->getItemPool('default'); |
64 | 64 | |
65 | 65 | if (cache()->hasItemPool('registry')) { |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | ); |
126 | 126 | } |
127 | 127 | |
128 | - $registry[ $package->getDirName() ] = $package; |
|
128 | + $registry[$package->getDirName()] = $package; |
|
129 | 129 | } elseif (is_cli()) { |
130 | 130 | output()->verbose( |
131 | 131 | (new Format()) |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public function registered($package) |
157 | 157 | { |
158 | - return isset($this->registry[ $package ]); |
|
158 | + return isset($this->registry[$package]); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | // ------------------------------------------------------------------------ |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | { |
172 | 172 | if (isset($package)) { |
173 | 173 | if ($this->registered($package)) { |
174 | - return $this->registry[ $package ]; |
|
174 | + return $this->registry[$package]; |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | return false; |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | |
183 | 183 | public function getDefaultMetadata() |
184 | 184 | { |
185 | - return $this->getRegistry( $this->getDefault() ); |
|
185 | + return $this->getRegistry($this->getDefault()); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | // ------------------------------------------------------------------------ |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | $first = reset($this->storage); |
42 | - if ( ! isset($first[ $this->primaryKey ])) { |
|
42 | + if ( ! isset($first[$this->primaryKey])) { |
|
43 | 43 | $keys = $first->getKeys(); |
44 | 44 | $this->primaryKey = reset($keys); |
45 | 45 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | public function get($property) |
50 | 50 | { |
51 | - if (empty($get[ $property ])) { |
|
51 | + if (empty($get[$property])) { |
|
52 | 52 | if (services()->has($property)) { |
53 | 53 | return services()->get($property); |
54 | 54 | } elseif (array_key_exists($property, $this->validSubModels)) { |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | final protected function loadSubModel($model) |
65 | 65 | { |
66 | - if (is_file($this->validSubModels[ $model ])) { |
|
66 | + if (is_file($this->validSubModels[$model])) { |
|
67 | 67 | $className = '\\' . get_called_class() . '\\' . ucfirst($model); |
68 | 68 | $className = str_replace('\Base\\Model', '\Models', $className); |
69 | 69 |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | loader()->addNamespace($reflection->name, $subModelPath); |
157 | 157 | |
158 | 158 | foreach (glob($subModelPath . '*.php') as $filepath) { |
159 | - $this->validSubModels[ strtolower(pathinfo($filepath, PATHINFO_FILENAME)) ] = $filepath; |
|
159 | + $this->validSubModels[strtolower(pathinfo($filepath, PATHINFO_FILENAME))] = $filepath; |
|
160 | 160 | } |
161 | 161 | } |
162 | 162 | } |
@@ -183,24 +183,24 @@ discard block |
||
183 | 183 | |
184 | 184 | public function &__get($property) |
185 | 185 | { |
186 | - $get[ $property ] = false; |
|
186 | + $get[$property] = false; |
|
187 | 187 | |
188 | 188 | if (services()->has($property)) { |
189 | - $get[ $property ] = services()->get($property); |
|
189 | + $get[$property] = services()->get($property); |
|
190 | 190 | } elseif (array_key_exists($property, $this->validSubModels)) { |
191 | - $get[ $property ] = $this->loadSubModel($property); |
|
191 | + $get[$property] = $this->loadSubModel($property); |
|
192 | 192 | } elseif (o2system()->__isset($property)) { |
193 | - $get[ $property ] = o2system()->__get($property); |
|
193 | + $get[$property] = o2system()->__get($property); |
|
194 | 194 | } |
195 | 195 | |
196 | - return $get[ $property ]; |
|
196 | + return $get[$property]; |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | // ------------------------------------------------------------------------ |
200 | 200 | |
201 | 201 | final protected function loadSubModel($model) |
202 | 202 | { |
203 | - if (is_file($this->validSubModels[ $model ])) { |
|
203 | + if (is_file($this->validSubModels[$model])) { |
|
204 | 204 | $className = '\\' . get_called_class() . '\\' . ucfirst($model); |
205 | 205 | $className = str_replace('\Base\\Model', '\Models', $className); |
206 | 206 |
@@ -30,7 +30,7 @@ |
||
30 | 30 | $referenceModel, |
31 | 31 | $foreignKey = null |
32 | 32 | ) { |
33 | - $this->currentModel =& $currentModel; |
|
33 | + $this->currentModel = & $currentModel; |
|
34 | 34 | $this->currentTable = $currentModel->table; |
35 | 35 | $this->currentPrimaryKey = $currentModel->primaryKey; |
36 | 36 |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | if (method_exists($this, 'getRecordOrdering')) { |
49 | - if ($this->recordOrdering === true && empty($sets[ 'record_ordering' ])) { |
|
50 | - $sets[ 'record_ordering' ] = $this->getRecordOrdering($this->table); |
|
49 | + if ($this->recordOrdering === true && empty($sets['record_ordering'])) { |
|
50 | + $sets['record_ordering'] = $this->getRecordOrdering($this->table); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | protected function insertOrUpdate(array $sets) |
68 | 68 | { |
69 | 69 | // Try to find |
70 | - if($result = $this->qb->from($this->table)->getWhere($sets)) { |
|
70 | + if ($result = $this->qb->from($this->table)->getWhere($sets)) { |
|
71 | 71 | return $this->update($sets); |
72 | 72 | } else { |
73 | 73 | return $this->insert($sets); |
@@ -82,8 +82,8 @@ discard block |
||
82 | 82 | foreach ($sets as $set) { |
83 | 83 | $this->insertRecordSets($set); |
84 | 84 | |
85 | - if ($this->recordOrdering === true && empty($sets[ 'record_ordering' ])) { |
|
86 | - $set[ 'record_ordering' ] = $this->getRecordOrdering($this->table); |
|
85 | + if ($this->recordOrdering === true && empty($sets['record_ordering'])) { |
|
86 | + $set['record_ordering'] = $this->getRecordOrdering($this->table); |
|
87 | 87 | } |
88 | 88 | } |
89 | 89 | } |
@@ -121,10 +121,10 @@ discard block |
||
121 | 121 | |
122 | 122 | if (empty($where)) { |
123 | 123 | if (empty($this->primaryKeys)) { |
124 | - $where[ $primaryKey ] = $sets[ $primaryKey ]; |
|
124 | + $where[$primaryKey] = $sets[$primaryKey]; |
|
125 | 125 | } else { |
126 | 126 | foreach ($this->primaryKeys as $primaryKey) { |
127 | - $where[ $primaryKey ] = $sets[ $primaryKey ]; |
|
127 | + $where[$primaryKey] = $sets[$primaryKey]; |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 | } |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | } |
143 | 143 | |
144 | 144 | if (method_exists($this, 'getRecordOrdering')) { |
145 | - if ($this->recordOrdering === true && empty($sets[ 'record_ordering' ])) { |
|
146 | - $sets[ 'record_ordering' ] = $this->getRecordOrdering($this->table); |
|
145 | + if ($this->recordOrdering === true && empty($sets['record_ordering'])) { |
|
146 | + $sets['record_ordering'] = $this->getRecordOrdering($this->table); |
|
147 | 147 | } |
148 | 148 | } |
149 | 149 | |
@@ -195,10 +195,10 @@ discard block |
||
195 | 195 | |
196 | 196 | if (empty($where)) { |
197 | 197 | if (empty($this->primaryKeys)) { |
198 | - $where[ $primaryKey ] = $sets[ $primaryKey ]; |
|
198 | + $where[$primaryKey] = $sets[$primaryKey]; |
|
199 | 199 | } else { |
200 | 200 | foreach ($this->primaryKeys as $primaryKey) { |
201 | - $where[ $primaryKey ] = $sets[ $primaryKey ]; |
|
201 | + $where[$primaryKey] = $sets[$primaryKey]; |
|
202 | 202 | } |
203 | 203 | } |
204 | 204 | } |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $this->primaryKeys = []; |
209 | 209 | |
210 | 210 | // Try to find |
211 | - if($result = $this->qb->from($this->table)->getWhere($where)) { |
|
211 | + if ($result = $this->qb->from($this->table)->getWhere($where)) { |
|
212 | 212 | return $this->update($sets, $where); |
213 | 213 | } else { |
214 | 214 | return $this->insert($sets); |
@@ -225,11 +225,11 @@ discard block |
||
225 | 225 | |
226 | 226 | $where = []; |
227 | 227 | if (empty($this->primaryKeys)) { |
228 | - $where[ $primaryKey ] = $sets[ $primaryKey ]; |
|
229 | - $this->qb->where($primaryKey, $sets[ $primaryKey ]); |
|
228 | + $where[$primaryKey] = $sets[$primaryKey]; |
|
229 | + $this->qb->where($primaryKey, $sets[$primaryKey]); |
|
230 | 230 | } else { |
231 | 231 | foreach ($this->primaryKeys as $primaryKey) { |
232 | - $where[ $primaryKey ] = $sets[ $primaryKey ]; |
|
232 | + $where[$primaryKey] = $sets[$primaryKey]; |
|
233 | 233 | } |
234 | 234 | } |
235 | 235 | |
@@ -241,8 +241,8 @@ discard block |
||
241 | 241 | foreach ($sets as $set) { |
242 | 242 | $this->updateRecordSets($set); |
243 | 243 | |
244 | - if ($this->recordOrdering === true && empty($sets[ 'record_ordering' ])) { |
|
245 | - $set[ 'record_ordering' ] = $this->getRecordOrdering($this->table); |
|
244 | + if ($this->recordOrdering === true && empty($sets['record_ordering'])) { |
|
245 | + $set['record_ordering'] = $this->getRecordOrdering($this->table); |
|
246 | 246 | } |
247 | 247 | } |
248 | 248 | } |
@@ -279,19 +279,19 @@ discard block |
||
279 | 279 | $where = []; |
280 | 280 | |
281 | 281 | if (empty($this->primaryKeys)) { |
282 | - $where[ $primaryKey ] = $id; |
|
283 | - $sets[ $primaryKey ] = $id; |
|
282 | + $where[$primaryKey] = $id; |
|
283 | + $sets[$primaryKey] = $id; |
|
284 | 284 | } elseif (is_array($id)) { |
285 | 285 | foreach ($this->primaryKeys as $primaryKey) { |
286 | - $where[ $primaryKey ] = $sets[ $primaryKey ]; |
|
287 | - $sets[ $primaryKey ] = $id[ $primaryKey ]; |
|
286 | + $where[$primaryKey] = $sets[$primaryKey]; |
|
287 | + $sets[$primaryKey] = $id[$primaryKey]; |
|
288 | 288 | } |
289 | 289 | } else { |
290 | 290 | foreach ($this->primaryKeys as $primaryKey) { |
291 | - $where[ $primaryKey ] = $sets[ $primaryKey ]; |
|
291 | + $where[$primaryKey] = $sets[$primaryKey]; |
|
292 | 292 | } |
293 | 293 | |
294 | - $sets[ reset($this->primaryKeys) ] = $id; |
|
294 | + $sets[reset($this->primaryKeys)] = $id; |
|
295 | 295 | } |
296 | 296 | |
297 | 297 | // Reset Primary Keys |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | $affectedRows = []; |
342 | 342 | |
343 | 343 | foreach ($ids as $id) { |
344 | - $affectedRows[ $id ] = $this->softDelete($id); |
|
344 | + $affectedRows[$id] = $this->softDelete($id); |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | return $affectedRows; |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | $affectedRows = []; |
355 | 355 | |
356 | 356 | foreach ($ids as $id) { |
357 | - $affectedRows[ $id ] = $this->softDeleteBy($id, $where); |
|
357 | + $affectedRows[$id] = $this->softDeleteBy($id, $where); |
|
358 | 358 | } |
359 | 359 | |
360 | 360 | return $affectedRows; |
@@ -368,13 +368,13 @@ discard block |
||
368 | 368 | |
369 | 369 | $where = []; |
370 | 370 | if (empty($this->primaryKeys)) { |
371 | - $where[ $primaryKey ] = $id; |
|
371 | + $where[$primaryKey] = $id; |
|
372 | 372 | } elseif (is_array($id)) { |
373 | 373 | foreach ($this->primaryKeys as $primaryKey) { |
374 | - $where[ $primaryKey ] = $id[ $primaryKey ]; |
|
374 | + $where[$primaryKey] = $id[$primaryKey]; |
|
375 | 375 | } |
376 | 376 | } else { |
377 | - $where[ reset($this->primaryKeys) ] = $id; |
|
377 | + $where[reset($this->primaryKeys)] = $id; |
|
378 | 378 | } |
379 | 379 | |
380 | 380 | // Reset Primary Keys |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | $affectedRows = []; |
413 | 413 | |
414 | 414 | foreach ($ids as $id) { |
415 | - $affectedRows[ $id ] = $this->delete($id, $force); |
|
415 | + $affectedRows[$id] = $this->delete($id, $force); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | return $affectedRows; |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | $affectedRows = []; |
424 | 424 | |
425 | 425 | foreach ($ids as $id) { |
426 | - $affectedRows[ $id ] = $this->deleteBy($id, $where, $force); |
|
426 | + $affectedRows[$id] = $this->deleteBy($id, $where, $force); |
|
427 | 427 | } |
428 | 428 | |
429 | 429 | return $affectedRows; |
@@ -439,19 +439,19 @@ discard block |
||
439 | 439 | $where = []; |
440 | 440 | |
441 | 441 | if (empty($this->primaryKeys)) { |
442 | - $where[ $primaryKey ] = $id; |
|
443 | - $sets[ $primaryKey ] = $id; |
|
442 | + $where[$primaryKey] = $id; |
|
443 | + $sets[$primaryKey] = $id; |
|
444 | 444 | } elseif (is_array($id)) { |
445 | 445 | foreach ($this->primaryKeys as $primaryKey) { |
446 | - $where[ $primaryKey ] = $sets[ $primaryKey ]; |
|
447 | - $sets[ $primaryKey ] = $id[ $primaryKey ]; |
|
446 | + $where[$primaryKey] = $sets[$primaryKey]; |
|
447 | + $sets[$primaryKey] = $id[$primaryKey]; |
|
448 | 448 | } |
449 | 449 | } else { |
450 | 450 | foreach ($this->primaryKeys as $primaryKey) { |
451 | - $where[ $primaryKey ] = $sets[ $primaryKey ]; |
|
451 | + $where[$primaryKey] = $sets[$primaryKey]; |
|
452 | 452 | } |
453 | 453 | |
454 | - $sets[ reset($this->primaryKeys) ] = $id; |
|
454 | + $sets[reset($this->primaryKeys)] = $id; |
|
455 | 455 | } |
456 | 456 | |
457 | 457 | // Reset Primary Keys |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | $affectedRows = []; |
495 | 495 | |
496 | 496 | foreach ($ids as $id) { |
497 | - $affectedRows[ $id ] = $this->publish($id); |
|
497 | + $affectedRows[$id] = $this->publish($id); |
|
498 | 498 | } |
499 | 499 | |
500 | 500 | return $affectedRows; |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | $affectedRows = []; |
508 | 508 | |
509 | 509 | foreach ($ids as $id) { |
510 | - $affectedRows[ $id ] = $this->publishBy($id, $where); |
|
510 | + $affectedRows[$id] = $this->publishBy($id, $where); |
|
511 | 511 | } |
512 | 512 | |
513 | 513 | return $affectedRows; |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | ]); |
86 | 86 | } |
87 | 87 | |
88 | - $update[ 'id' ] = $row->id; |
|
88 | + $update['id'] = $row->id; |
|
89 | 89 | |
90 | 90 | if ($this->hasChilds($row->id)) { |
91 | 91 | $right = $this->rebuildTree($row->id, $right, $depth + 1); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | ->update($update = [ |
96 | 96 | 'record_right' => $right, |
97 | 97 | ]); |
98 | - $update[ 'id' ] = $row->id; |
|
98 | + $update['id'] = $row->id; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | $i++; |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | { |
194 | 194 | $childs = []; |
195 | 195 | |
196 | - if($result = $this->qb |
|
196 | + if ($result = $this->qb |
|
197 | 197 | ->table($this->table) |
198 | 198 | ->where('id_parent', $idParent) |
199 | 199 | ->get()) { |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | */ |
222 | 222 | protected function getNumChilds($idParent) |
223 | 223 | { |
224 | - if($result = $this->qb |
|
224 | + if ($result = $this->qb |
|
225 | 225 | ->table($this->table) |
226 | 226 | ->select('id') |
227 | 227 | ->where('id_parent', $idParent) |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | if ($filepath === $filePath) { |
164 | 164 | continue; |
165 | 165 | } |
166 | - $this->validSubModels[ camelcase(pathinfo($filepath, PATHINFO_FILENAME)) ] = $filepath; |
|
166 | + $this->validSubModels[camelcase(pathinfo($filepath, PATHINFO_FILENAME))] = $filepath; |
|
167 | 167 | } |
168 | 168 | } |
169 | 169 | } |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | } |
211 | 211 | } |
212 | 212 | |
213 | - if (empty($get[ $property ])) { |
|
213 | + if (empty($get[$property])) { |
|
214 | 214 | if (services()->has($property)) { |
215 | 215 | return services()->get($property); |
216 | 216 | } elseif ($this->hasSubModel($property)) { |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | final protected function hasSubModel($model) |
252 | 252 | { |
253 | 253 | if (array_key_exists($model, $this->validSubModels)) { |
254 | - return (bool)is_file($this->validSubModels[ $model ]); |
|
254 | + return (bool)is_file($this->validSubModels[$model]); |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | return false; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | ); |
75 | 75 | |
76 | 76 | if ($this->config->offsetExists('extensions')) { |
77 | - $this->setFileExtensions($this->config[ 'extensions' ]); |
|
77 | + $this->setFileExtensions($this->config['extensions']); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | $this->document = new Html\Document(); |
@@ -90,13 +90,13 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function &__get($property) |
92 | 92 | { |
93 | - $get[ $property ] = false; |
|
93 | + $get[$property] = false; |
|
94 | 94 | |
95 | 95 | if (property_exists($this, $property)) { |
96 | 96 | return $this->{$property}; |
97 | 97 | } |
98 | 98 | |
99 | - return $get[ $property ]; |
|
99 | + return $get[$property]; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | public function parse($string, array $vars = []) |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | $error = new ErrorException( |
154 | 154 | 'E_VIEW_NOT_FOUND', |
155 | 155 | 0, |
156 | - @$backtrace[ 0 ][ 'file' ], |
|
157 | - @$backtrace[ 0 ][ 'line' ], |
|
156 | + @$backtrace[0]['file'], |
|
157 | + @$backtrace[0]['line'], |
|
158 | 158 | [trim($filename)] |
159 | 159 | ); |
160 | 160 | |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | |
301 | 301 | public function render(array $options = []) |
302 | 302 | { |
303 | - if(profiler() !== false) { |
|
303 | + if (profiler() !== false) { |
|
304 | 304 | profiler()->watch('Starting View Rendering'); |
305 | 305 | } |
306 | 306 | |
@@ -405,9 +405,9 @@ discard block |
||
405 | 405 | if ($this->config->output['uglify'] === true) { |
406 | 406 | $htmlOutput = preg_replace( |
407 | 407 | [ |
408 | - '/\>[^\S ]+/s', // strip whitespaces after tags, except space |
|
409 | - '/[^\S ]+\</s', // strip whitespaces before tags, except space |
|
410 | - '/(\s)+/s', // shorten multiple whitespace sequences |
|
408 | + '/\>[^\S ]+/s', // strip whitespaces after tags, except space |
|
409 | + '/[^\S ]+\</s', // strip whitespaces before tags, except space |
|
410 | + '/(\s)+/s', // shorten multiple whitespace sequences |
|
411 | 411 | '/<!--(.|\s)*?-->/', // Remove HTML comments |
412 | 412 | '/<!--(.*)-->/Uis', |
413 | 413 | "/[[:blank:]]+/", |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | $htmlOutput = $beautifier->format($htmlOutput); |
430 | 430 | } |
431 | 431 | |
432 | - if(profiler() !== false) { |
|
432 | + if (profiler() !== false) { |
|
433 | 433 | profiler()->watch('Ending View Rendering'); |
434 | 434 | } |
435 | 435 |