@@ -113,8 +113,8 @@ discard block |
||
113 | 113 | $options = input()->get(); |
114 | 114 | |
115 | 115 | if (empty($options)) { |
116 | - $_GET[ 'host' ] = 'localhost'; |
|
117 | - $_GET[ 'port' ] = 8000; |
|
116 | + $_GET['host'] = 'localhost'; |
|
117 | + $_GET['port'] = 8000; |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | $this->__callOptions(); |
@@ -126,12 +126,12 @@ discard block |
||
126 | 126 | ->setNewLinesAfter(1) |
127 | 127 | ); |
128 | 128 | |
129 | - $_SERVER[ 'DOCUMENT_ROOT' ] = PATH_PUBLIC; |
|
129 | + $_SERVER['DOCUMENT_ROOT'] = PATH_PUBLIC; |
|
130 | 130 | |
131 | 131 | output()->write( |
132 | 132 | (new Format()) |
133 | 133 | ->setContextualClass(Format::INFO) |
134 | - ->setString(language()->getLine('CLI_SERVE_DOC_ROOT', [$_SERVER[ 'DOCUMENT_ROOT' ]])) |
|
134 | + ->setString(language()->getLine('CLI_SERVE_DOC_ROOT', [$_SERVER['DOCUMENT_ROOT']])) |
|
135 | 135 | ->setNewLinesAfter(1) |
136 | 136 | ); |
137 | 137 |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $directory = new \RecursiveIteratorIterator(new \RecursiveCallbackFilterIterator( |
97 | 97 | new \RecursiveDirectoryIterator(PATH_ROOT, |
98 | 98 | \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS), |
99 | - function ($current, $key, $iterator) { |
|
99 | + function($current, $key, $iterator) { |
|
100 | 100 | if ($current->isDir()) { |
101 | 101 | // exclude build directory |
102 | 102 | if (in_array($current->getFilename(), [ |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | $files[] = $packageJsonFileInfo; |
120 | 120 | |
121 | - if ($packageJsonFileInfo[ 'filename' ] === 'language') { |
|
121 | + if ($packageJsonFileInfo['filename'] === 'language') { |
|
122 | 122 | if (is_cli()) { |
123 | 123 | output()->verbose( |
124 | 124 | (new Format()) |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | ); |
142 | 142 | } |
143 | 143 | |
144 | - $registry[ $package->getDirName() ] = $package; |
|
144 | + $registry[$package->getDirName()] = $package; |
|
145 | 145 | } elseif (is_cli()) { |
146 | 146 | output()->verbose( |
147 | 147 | (new Format()) |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | { |
186 | 186 | if (isset($package)) { |
187 | 187 | if ($this->registered($package)) { |
188 | - return $this->registry[ $package ]; |
|
188 | + return $this->registry[$package]; |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | return false; |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | */ |
206 | 206 | public function registered($package) |
207 | 207 | { |
208 | - return isset($this->registry[ $package ]); |
|
208 | + return isset($this->registry[$package]); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | // ------------------------------------------------------------------------ |
@@ -487,11 +487,11 @@ |
||
487 | 487 | $moduleParentSegments = []; |
488 | 488 | |
489 | 489 | foreach ([ |
490 | - 'apps', |
|
491 | - 'modules', |
|
492 | - 'components', |
|
493 | - 'plugins', |
|
494 | - ] as $moduleType |
|
490 | + 'apps', |
|
491 | + 'modules', |
|
492 | + 'components', |
|
493 | + 'plugins', |
|
494 | + ] as $moduleType |
|
495 | 495 | ) { |
496 | 496 | if (false !== ($segmentKey = array_search($modularType, $moduleSegments))) { |
497 | 497 | $moduleParentSegments = array_slice($moduleSegments, 0, $segmentKey); |
@@ -203,13 +203,13 @@ discard block |
||
203 | 203 | |
204 | 204 | if (isset($config) AND is_array($config)) { |
205 | 205 | // Set default timezone |
206 | - if (isset($config[ 'datetime' ][ 'timezone' ])) { |
|
207 | - date_default_timezone_set($config[ 'datetime' ][ 'timezone' ]); |
|
206 | + if (isset($config['datetime']['timezone'])) { |
|
207 | + date_default_timezone_set($config['datetime']['timezone']); |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | // Setup Language Ideom and Locale |
211 | - if (isset($config[ 'language' ])) { |
|
212 | - language()->setDefault($config[ 'language' ]); |
|
211 | + if (isset($config['language'])) { |
|
212 | + language()->setDefault($config['language']); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | config()->merge($config); |
@@ -372,14 +372,14 @@ discard block |
||
372 | 372 | public function push($module) |
373 | 373 | { |
374 | 374 | if ( ! in_array($module->getNamespace(), ['O2System\Kernel\\', 'O2System\Framework\\', 'App\\'])) { |
375 | - if($module instanceof DataStructures\Module) { |
|
375 | + if ($module instanceof DataStructures\Module) { |
|
376 | 376 | $this->autoload($module); |
377 | 377 | |
378 | 378 | parent::push($module); |
379 | 379 | |
380 | - if($module->getType() === 'APP') { |
|
380 | + if ($module->getType() === 'APP') { |
|
381 | 381 | $this->setActiveApp($module); |
382 | - } elseif(in_array($module->getType(), ['MODULE', 'COMPONENT'])) { |
|
382 | + } elseif (in_array($module->getType(), ['MODULE', 'COMPONENT'])) { |
|
383 | 383 | $this->setActiveModule($module); |
384 | 384 | } |
385 | 385 | } |
@@ -447,8 +447,8 @@ discard block |
||
447 | 447 | $packageJsonFile = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $packageJsonFile); |
448 | 448 | $packageJsonFileInfo = pathinfo($packageJsonFile); |
449 | 449 | |
450 | - if ($packageJsonFileInfo[ 'filename' ] === 'widget' or |
|
451 | - $packageJsonFileInfo[ 'filename' ] === 'language' or |
|
450 | + if ($packageJsonFileInfo['filename'] === 'widget' or |
|
451 | + $packageJsonFileInfo['filename'] === 'language' or |
|
452 | 452 | strpos($packageJsonFile, '.svn') !== false // subversion properties file conflict. |
453 | 453 | ) { |
454 | 454 | continue; |
@@ -478,8 +478,8 @@ discard block |
||
478 | 478 | } |
479 | 479 | |
480 | 480 | if (strpos($packageJsonFile, |
481 | - $modularType = ucfirst(plural($packageJsonFileInfo[ 'filename' ])) . DIRECTORY_SEPARATOR) === false) { |
|
482 | - $modularType = ucfirst($packageJsonFileInfo[ 'filename' ]) . DIRECTORY_SEPARATOR; |
|
481 | + $modularType = ucfirst(plural($packageJsonFileInfo['filename'])) . DIRECTORY_SEPARATOR) === false) { |
|
482 | + $modularType = ucfirst($packageJsonFileInfo['filename']) . DIRECTORY_SEPARATOR; |
|
483 | 483 | } |
484 | 484 | |
485 | 485 | $modularType = strtolower(rtrim($modularType, DIRECTORY_SEPARATOR)); |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | PATH_PUBLIC, |
495 | 495 | PATH_RESOURCES, |
496 | 496 | PATH_APP, |
497 | - $packageJsonFileInfo[ 'basename' ], |
|
497 | + $packageJsonFileInfo['basename'], |
|
498 | 498 | ], |
499 | 499 | '', |
500 | 500 | $packageJsonFile |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | ) |
504 | 504 | ); |
505 | 505 | |
506 | - $moduleSegments = array_map(function ($string) { |
|
506 | + $moduleSegments = array_map(function($string) { |
|
507 | 507 | return dash(snakecase($string)); |
508 | 508 | }, $moduleSegments); |
509 | 509 | |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | if (false !== ($segmentKey = array_search($modularType, $moduleSegments))) { |
520 | 520 | $moduleParentSegments = array_slice($moduleSegments, 0, $segmentKey); |
521 | 521 | |
522 | - unset($moduleSegments[ $segmentKey ]); |
|
522 | + unset($moduleSegments[$segmentKey]); |
|
523 | 523 | break; |
524 | 524 | } |
525 | 525 | } |
@@ -530,29 +530,29 @@ discard block |
||
530 | 530 | str_replace( |
531 | 531 | PATH_ROOT, |
532 | 532 | '', |
533 | - $packageJsonFileInfo[ 'dirname' ] |
|
533 | + $packageJsonFileInfo['dirname'] |
|
534 | 534 | ), |
535 | 535 | false |
536 | 536 | ); |
537 | 537 | |
538 | - if (isset($packageJsonMetadata[ 'namespace' ])) { |
|
539 | - $moduleNamespace = $packageJsonMetadata[ 'namespace' ]; |
|
540 | - unset($packageJsonMetadata[ 'namespace' ]); |
|
538 | + if (isset($packageJsonMetadata['namespace'])) { |
|
539 | + $moduleNamespace = $packageJsonMetadata['namespace']; |
|
540 | + unset($packageJsonMetadata['namespace']); |
|
541 | 541 | } |
542 | 542 | |
543 | 543 | $registryKey = implode('/', $moduleSegments); |
544 | 544 | |
545 | 545 | if ($registryKey === '') { |
546 | - if ($packageJsonFileInfo[ 'dirname' ] . DIRECTORY_SEPARATOR !== PATH_APP and $modularType === 'app') { |
|
546 | + if ($packageJsonFileInfo['dirname'] . DIRECTORY_SEPARATOR !== PATH_APP and $modularType === 'app') { |
|
547 | 547 | $registryKey = dash(snakecase( |
548 | - pathinfo($packageJsonFileInfo[ 'dirname' ], PATHINFO_FILENAME))); |
|
548 | + pathinfo($packageJsonFileInfo['dirname'], PATHINFO_FILENAME))); |
|
549 | 549 | } |
550 | 550 | } |
551 | 551 | |
552 | - $registry[ $registryKey ] = (new DataStructures\Module( |
|
553 | - $packageJsonFileInfo[ 'dirname' ] |
|
552 | + $registry[$registryKey] = (new DataStructures\Module( |
|
553 | + $packageJsonFileInfo['dirname'] |
|
554 | 554 | )) |
555 | - ->setType($packageJsonFileInfo[ 'filename' ]) |
|
555 | + ->setType($packageJsonFileInfo['filename']) |
|
556 | 556 | ->setNamespace($moduleNamespace) |
557 | 557 | ->setSegments($moduleSegments) |
558 | 558 | ->setParentSegments($moduleParentSegments) |
@@ -714,8 +714,8 @@ discard block |
||
714 | 714 | $segment = dash($segment); |
715 | 715 | |
716 | 716 | if ($this->exists($segment)) { |
717 | - if ($this->registry[ $segment ] instanceof DataStructures\Module) { |
|
718 | - return $this->registry[ $segment ]; |
|
717 | + if ($this->registry[$segment] instanceof DataStructures\Module) { |
|
718 | + return $this->registry[$segment]; |
|
719 | 719 | } |
720 | 720 | } |
721 | 721 | |
@@ -751,8 +751,8 @@ discard block |
||
751 | 751 | */ |
752 | 752 | public function first() |
753 | 753 | { |
754 | - if (isset($this->registry[ '' ])) { |
|
755 | - return $this->registry[ '' ]; |
|
754 | + if (isset($this->registry[''])) { |
|
755 | + return $this->registry['']; |
|
756 | 756 | } elseif (reset($this->registry)->type === 'APP') { |
757 | 757 | return reset($this->registry); |
758 | 758 | } |
@@ -774,7 +774,7 @@ discard block |
||
774 | 774 | $segments = (is_array($segments) ? implode('/', array_map('dash', $segments)) : $segments); |
775 | 775 | |
776 | 776 | if ($this->exists($segments)) { |
777 | - return $this->registry[ $segments ]; |
|
777 | + return $this->registry[$segments]; |
|
778 | 778 | } |
779 | 779 | |
780 | 780 | return false; |
@@ -795,7 +795,7 @@ discard block |
||
795 | 795 | |
796 | 796 | foreach ($this as $key => $module) { |
797 | 797 | if ($module instanceof DataStructures\Module) { |
798 | - $namespaces[ $key ] = new SplNamespaceInfo($module->getNamespace(), $module->getRealPath()); |
|
798 | + $namespaces[$key] = new SplNamespaceInfo($module->getNamespace(), $module->getRealPath()); |
|
799 | 799 | } |
800 | 800 | } |
801 | 801 |
@@ -195,10 +195,10 @@ discard block |
||
195 | 195 | */ |
196 | 196 | public function setProperties(array $properties) |
197 | 197 | { |
198 | - if (isset($properties[ 'presets' ])) { |
|
199 | - $this->setPresets($properties[ 'presets' ]); |
|
198 | + if (isset($properties['presets'])) { |
|
199 | + $this->setPresets($properties['presets']); |
|
200 | 200 | |
201 | - unset($properties[ 'presets' ]); |
|
201 | + unset($properties['presets']); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | $this->properties = $properties; |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | $themes = []; |
289 | 289 | foreach ($directory->getTree() as $themeName => $themeTree) { |
290 | 290 | if (($theme = $this->getTheme($themeName)) instanceof Module\Theme) { |
291 | - $themes[ $themeName ] = $theme; |
|
291 | + $themes[$themeName] = $theme; |
|
292 | 292 | } |
293 | 293 | } |
294 | 294 | |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | |
516 | 516 | if ( ! empty($controller->name) and ! in_array($controller->getParameter(), |
517 | 517 | ['login', 'pages', 'setup', 'license'])) { |
518 | - $controllers[ $controller->getParameter() ] = $controller; |
|
518 | + $controllers[$controller->getParameter()] = $controller; |
|
519 | 519 | } |
520 | 520 | } |
521 | 521 | } |
@@ -111,7 +111,7 @@ |
||
111 | 111 | } |
112 | 112 | } |
113 | 113 | |
114 | - if(empty($this->methods) and $this->hasMethod('route')) { |
|
114 | + if (empty($this->methods) and $this->hasMethod('route')) { |
|
115 | 115 | $method = $this->getMethod('route'); |
116 | 116 | $method->segment = dash($method->name); |
117 | 117 | $method->segments = implode('/', $segments); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | ]); |
86 | 86 | } |
87 | 87 | |
88 | - $update[ $this->primaryKey ] = $child->{$this->primaryKey}; |
|
88 | + $update[$this->primaryKey] = $child->{$this->primaryKey}; |
|
89 | 89 | |
90 | 90 | if ($this->qb |
91 | 91 | ->table($this->table) |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | ->update($update = [ |
101 | 101 | 'record_right' => $right, |
102 | 102 | ]); |
103 | - $update[ $this->primaryKey ] = $child->{$this->primaryKey}; |
|
103 | + $update[$this->primaryKey] = $child->{$this->primaryKey}; |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | $i++; |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | ->select($this->table . '.*') |
257 | 257 | ->from($this->table) |
258 | 258 | ->from($this->table . ' AS node') |
259 | - ->whereBetween($this->table . '.record_left', [ 'node.record_left', 'node.record_right']) |
|
259 | + ->whereBetween($this->table . '.record_left', ['node.record_left', 'node.record_right']) |
|
260 | 260 | ->where([ |
261 | 261 | 'node.' . $this->primaryKey => $id, |
262 | 262 | $this->table . '.' . $this->primaryKey . '!=' => $id, |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | $properties = json_decode(file_get_contents($propFilePath), true); |
63 | 63 | |
64 | 64 | if (json_last_error() === JSON_ERROR_NONE) { |
65 | - if (isset($properties[ 'config' ])) { |
|
66 | - $this->presets = $properties[ 'presets' ]; |
|
67 | - unset($properties[ 'presets' ]); |
|
65 | + if (isset($properties['config'])) { |
|
66 | + $this->presets = $properties['presets']; |
|
67 | + unset($properties['presets']); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $this->properties = $properties; |
@@ -198,10 +198,10 @@ discard block |
||
198 | 198 | { |
199 | 199 | $extensions = ['.php', '.phtml', '.html', '.tpl']; |
200 | 200 | |
201 | - if (isset($this->presets[ 'extensions' ])) { |
|
202 | - array_unshift($partialsExtensions, $this->presets[ 'extension' ]); |
|
203 | - } elseif (isset($this->presets[ 'extension' ])) { |
|
204 | - array_unshift($extensions, $this->presets[ 'extension' ]); |
|
201 | + if (isset($this->presets['extensions'])) { |
|
202 | + array_unshift($partialsExtensions, $this->presets['extension']); |
|
203 | + } elseif (isset($this->presets['extension'])) { |
|
204 | + array_unshift($extensions, $this->presets['extension']); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | $found = false; |
@@ -253,10 +253,10 @@ discard block |
||
253 | 253 | if (isset($layout)) { |
254 | 254 | $extensions = ['.php', '.phtml', '.html', '.tpl']; |
255 | 255 | |
256 | - if (isset($this->presets[ 'extensions' ])) { |
|
257 | - array_unshift($partialsExtensions, $this->presets[ 'extension' ]); |
|
258 | - } elseif (isset($this->presets[ 'extension' ])) { |
|
259 | - array_unshift($extensions, $this->presets[ 'extension' ]); |
|
256 | + if (isset($this->presets['extensions'])) { |
|
257 | + array_unshift($partialsExtensions, $this->presets['extension']); |
|
258 | + } elseif (isset($this->presets['extension'])) { |
|
259 | + array_unshift($extensions, $this->presets['extension']); |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | foreach ($extensions as $extension) { |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | if ($this->layout instanceof Theme\Layout) { |
291 | 291 | |
292 | 292 | // load parent theme layout |
293 | - if($this->layout->getFilename() !== 'theme') { |
|
293 | + if ($this->layout->getFilename() !== 'theme') { |
|
294 | 294 | $themeLayout = $this->getLayout('theme'); |
295 | 295 | |
296 | 296 | // add theme layout public directory |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | if (count($this->fillableColumns)) { |
41 | 41 | foreach ($sets as $key => $value) { |
42 | 42 | if ( ! in_array($key, $this->fillableColumns)) { |
43 | - unset($sets[ $key ]); |
|
43 | + unset($sets[$key]); |
|
44 | 44 | } |
45 | 45 | } |
46 | 46 | } |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | if (method_exists($this, 'getRecordOrdering')) { |
57 | - if ($this->recordOrdering === true && empty($sets[ 'record_ordering' ])) { |
|
58 | - $sets[ 'record_ordering' ] = $this->getRecordOrdering(); |
|
57 | + if ($this->recordOrdering === true && empty($sets['record_ordering'])) { |
|
58 | + $sets['record_ordering'] = $this->getRecordOrdering(); |
|
59 | 59 | } |
60 | 60 | } |
61 | 61 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | if ($files = input()->files()) { |
71 | 71 | // Uploaded Image Process |
72 | 72 | if (isset($this->uploadedImageKey)) { |
73 | - if (isset($files[ $this->uploadedImageKey ])) { |
|
73 | + if (isset($files[$this->uploadedImageKey])) { |
|
74 | 74 | $upload->process($this->uploadedImageKey); |
75 | 75 | |
76 | 76 | if ($upload->getErrors()) { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | } |
90 | 90 | } elseif (count($this->uploadedImageKeys)) { |
91 | 91 | foreach ($this->uploadedImageKeys as $uploadedImageKey) { |
92 | - if (isset($files[ $uploadedImageKey ])) { |
|
92 | + if (isset($files[$uploadedImageKey])) { |
|
93 | 93 | $upload->process($uploadedImageKey); |
94 | 94 | |
95 | 95 | if ($upload->getErrors()) { |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | // Uploaded File Process |
113 | 113 | if (isset($this->uploadedFileFilepath)) { |
114 | - if (isset($files[ $this->uploadedFileKey ])) { |
|
114 | + if (isset($files[$this->uploadedFileKey])) { |
|
115 | 115 | $upload->process($this->uploadedFileKey); |
116 | 116 | |
117 | 117 | if ($upload->getErrors()) { |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | } |
131 | 131 | } elseif (count($this->uploadedFileKeys)) { |
132 | 132 | foreach ($this->uploadedFileKeys as $uploadedFileKey) { |
133 | - if (isset($files[ $uploadedFileKey ])) { |
|
133 | + if (isset($files[$uploadedFileKey])) { |
|
134 | 134 | $upload->process($uploadedFileKey); |
135 | 135 | |
136 | 136 | if ($upload->getErrors()) { |
@@ -163,9 +163,9 @@ discard block |
||
163 | 163 | |
164 | 164 | $label = false; |
165 | 165 | foreach (['name', 'label', 'title', 'code'] as $labelField) { |
166 | - if (isset($sets[ $labelField ])) { |
|
167 | - if(services()->has('session')) { |
|
168 | - session()->setFlash('success', language('SUCCESS_INSERT_WITH_LABEL', [$sets[ $labelField ]])); |
|
166 | + if (isset($sets[$labelField])) { |
|
167 | + if (services()->has('session')) { |
|
168 | + session()->setFlash('success', language('SUCCESS_INSERT_WITH_LABEL', [$sets[$labelField]])); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | $label = true; |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | } |
175 | 175 | |
176 | 176 | if ($label === false) { |
177 | - if(services()->has('session')) { |
|
177 | + if (services()->has('session')) { |
|
178 | 178 | session()->setFlash('success', language('SUCCESS_INSERT')); |
179 | 179 | } |
180 | 180 | } |
@@ -185,9 +185,9 @@ discard block |
||
185 | 185 | |
186 | 186 | $label = false; |
187 | 187 | foreach (['name', 'label', 'title', 'code'] as $labelField) { |
188 | - if (isset($sets[ $labelField ])) { |
|
189 | - if(services()->has('session')) { |
|
190 | - session()->setFlash('danger', language('FAILED_INSERT_WITH_LABEL', [$sets[ $labelField ]])); |
|
188 | + if (isset($sets[$labelField])) { |
|
189 | + if (services()->has('session')) { |
|
190 | + session()->setFlash('danger', language('FAILED_INSERT_WITH_LABEL', [$sets[$labelField]])); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | $label = true; |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | } |
197 | 197 | |
198 | 198 | if ($label === false) { |
199 | - if(services()->has('session')) { |
|
199 | + if (services()->has('session')) { |
|
200 | 200 | session()->setFlash('danger', language('FAILED_INSERT')); |
201 | 201 | } |
202 | 202 | } |
@@ -224,8 +224,8 @@ discard block |
||
224 | 224 | $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id'; |
225 | 225 | |
226 | 226 | if (empty($conditions)) { |
227 | - if (isset($sets[ $primaryKey ])) { |
|
228 | - $conditions = [$primaryKey => $sets[ $primaryKey ]]; |
|
227 | + if (isset($sets[$primaryKey])) { |
|
228 | + $conditions = [$primaryKey => $sets[$primaryKey]]; |
|
229 | 229 | } else { |
230 | 230 | $conditions = $sets; |
231 | 231 | } |
@@ -259,8 +259,8 @@ discard block |
||
259 | 259 | if (method_exists($this, 'insertRecordSets')) { |
260 | 260 | foreach ($sets as $set) { |
261 | 261 | $this->insertRecordSets($set); |
262 | - if ($this->recordOrdering === true && empty($sets[ 'record_ordering' ])) { |
|
263 | - $set[ 'record_ordering' ] = $this->getRecordOrdering(); |
|
262 | + if ($this->recordOrdering === true && empty($sets['record_ordering'])) { |
|
263 | + $set['record_ordering'] = $this->getRecordOrdering(); |
|
264 | 264 | } |
265 | 265 | } |
266 | 266 | } |
@@ -332,15 +332,15 @@ discard block |
||
332 | 332 | $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id'; |
333 | 333 | |
334 | 334 | if (empty($conditions)) { |
335 | - if (isset($sets[ $primaryKey ])) { |
|
336 | - $conditions = [$primaryKey => $sets[ $primaryKey ]]; |
|
335 | + if (isset($sets[$primaryKey])) { |
|
336 | + $conditions = [$primaryKey => $sets[$primaryKey]]; |
|
337 | 337 | } |
338 | 338 | } |
339 | 339 | |
340 | 340 | if (count($this->fillableColumns)) { |
341 | 341 | foreach ($sets as $key => $value) { |
342 | 342 | if ( ! in_array($key, $this->fillableColumns)) { |
343 | - unset($sets[ $key ]); |
|
343 | + unset($sets[$key]); |
|
344 | 344 | } |
345 | 345 | } |
346 | 346 | } |
@@ -354,8 +354,8 @@ discard block |
||
354 | 354 | } |
355 | 355 | |
356 | 356 | if (method_exists($this, 'getRecordOrdering')) { |
357 | - if ($this->recordOrdering === true && empty($sets[ 'record_ordering' ])) { |
|
358 | - $sets[ 'record_ordering' ] = $this->getRecordOrdering(); |
|
357 | + if ($this->recordOrdering === true && empty($sets['record_ordering'])) { |
|
358 | + $sets['record_ordering'] = $this->getRecordOrdering(); |
|
359 | 359 | } |
360 | 360 | } |
361 | 361 | |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | if ($files = input()->files()) { |
372 | 372 | // Uploaded Image Process |
373 | 373 | if (isset($this->uploadedImageKey)) { |
374 | - if (isset($files[ $this->uploadedImageKey ])) { |
|
374 | + if (isset($files[$this->uploadedImageKey])) { |
|
375 | 375 | $upload->process($this->uploadedImageKey); |
376 | 376 | |
377 | 377 | if ($upload->getErrors()) { |
@@ -386,8 +386,8 @@ discard block |
||
386 | 386 | } |
387 | 387 | |
388 | 388 | return false; |
389 | - } elseif ($row->offsetGet($this->uploadedImageKey) !== $upload->getUploadedFiles()->first()[ 'name' ]) { |
|
390 | - $sets[ $this->uploadedImageKey ] = $upload->getUploadedFiles()->first()[ 'name' ]; |
|
389 | + } elseif ($row->offsetGet($this->uploadedImageKey) !== $upload->getUploadedFiles()->first()['name']) { |
|
390 | + $sets[$this->uploadedImageKey] = $upload->getUploadedFiles()->first()['name']; |
|
391 | 391 | |
392 | 392 | if (is_file($filePath = $this->uploadedImageFilePath . $row->offsetGet($this->uploadedImageKey))) { |
393 | 393 | unlink($filePath); |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | } |
397 | 397 | } elseif (count($this->uploadedImageKeys)) { |
398 | 398 | foreach ($this->uploadedImageKeys as $uploadedImageKey) { |
399 | - if (isset($files[ $uploadedImageKey ])) { |
|
399 | + if (isset($files[$uploadedImageKey])) { |
|
400 | 400 | $upload->process($uploadedImageKey); |
401 | 401 | |
402 | 402 | if ($upload->getErrors()) { |
@@ -411,8 +411,8 @@ discard block |
||
411 | 411 | } |
412 | 412 | |
413 | 413 | return false; |
414 | - } elseif ($row->offsetGet($uploadedImageKey) !== $upload->getUploadedFiles()->first()[ 'name' ]) { |
|
415 | - $sets[ $uploadedImageKey ] = $upload->getUploadedFiles()->first()[ 'name' ]; |
|
414 | + } elseif ($row->offsetGet($uploadedImageKey) !== $upload->getUploadedFiles()->first()['name']) { |
|
415 | + $sets[$uploadedImageKey] = $upload->getUploadedFiles()->first()['name']; |
|
416 | 416 | |
417 | 417 | if (is_file($filePath = $this->uploadedImageFilePath . $row->offsetGet($uploadedImageKey))) { |
418 | 418 | unlink($filePath); |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | |
425 | 425 | // Uploaded File Process |
426 | 426 | if (isset($this->uploadedFileFilepath)) { |
427 | - if (isset($files[ $this->uploadedFileKey ])) { |
|
427 | + if (isset($files[$this->uploadedFileKey])) { |
|
428 | 428 | $upload->process($this->uploadedFileKey); |
429 | 429 | |
430 | 430 | if ($upload->getErrors()) { |
@@ -439,8 +439,8 @@ discard block |
||
439 | 439 | } |
440 | 440 | |
441 | 441 | return false; |
442 | - } elseif ($row->offsetGet($this->uploadedFileKey) !== $upload->getUploadedFiles()->first()[ 'name' ]) { |
|
443 | - $sets[ $this->uploadedFileKey ] = $upload->getUploadedFiles()->first()[ 'name' ]; |
|
442 | + } elseif ($row->offsetGet($this->uploadedFileKey) !== $upload->getUploadedFiles()->first()['name']) { |
|
443 | + $sets[$this->uploadedFileKey] = $upload->getUploadedFiles()->first()['name']; |
|
444 | 444 | |
445 | 445 | if (is_file($filePath = $this->uploadedFileFilepath . $row->offsetGet($this->uploadedFileKey))) { |
446 | 446 | unlink($filePath); |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | } |
450 | 450 | } elseif (count($this->uploadedFileKeys)) { |
451 | 451 | foreach ($this->uploadedFileKeys as $uploadedFileKey) { |
452 | - if (isset($files[ $uploadedFileKey ])) { |
|
452 | + if (isset($files[$uploadedFileKey])) { |
|
453 | 453 | $upload->process($uploadedFileKey); |
454 | 454 | |
455 | 455 | if ($upload->getErrors()) { |
@@ -464,8 +464,8 @@ discard block |
||
464 | 464 | } |
465 | 465 | |
466 | 466 | return false; |
467 | - } elseif ($row->offsetGet($uploadedFileKey) !== $upload->getUploadedFiles()->first()[ 'name' ]) { |
|
468 | - $sets[ $uploadedFileKey ] = $upload->getUploadedFiles()->first()[ 'name' ]; |
|
467 | + } elseif ($row->offsetGet($uploadedFileKey) !== $upload->getUploadedFiles()->first()['name']) { |
|
468 | + $sets[$uploadedFileKey] = $upload->getUploadedFiles()->first()['name']; |
|
469 | 469 | |
470 | 470 | if (is_file($filePath = $this->uploadedFileFilepath . $row->offsetGet($uploadedFileKey))) { |
471 | 471 | unlink($filePath); |
@@ -485,10 +485,10 @@ discard block |
||
485 | 485 | |
486 | 486 | $label = false; |
487 | 487 | foreach (['name', 'label', 'title', 'code'] as $labelField) { |
488 | - if (isset($sets[ $labelField ])) { |
|
489 | - if(services()->has('session')) { |
|
488 | + if (isset($sets[$labelField])) { |
|
489 | + if (services()->has('session')) { |
|
490 | 490 | session()->setFlash('success', |
491 | - language('SUCCESS_UPDATE_WITH_LABEL', [$sets[ $labelField ]])); |
|
491 | + language('SUCCESS_UPDATE_WITH_LABEL', [$sets[$labelField]])); |
|
492 | 492 | } |
493 | 493 | |
494 | 494 | $label = true; |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | } |
498 | 498 | |
499 | 499 | if ($label === false) { |
500 | - if(services()->has('session')) { |
|
500 | + if (services()->has('session')) { |
|
501 | 501 | session()->setFlash('success', language('SUCCESS_UPDATE')); |
502 | 502 | } |
503 | 503 | } |
@@ -509,9 +509,9 @@ discard block |
||
509 | 509 | |
510 | 510 | $label = false; |
511 | 511 | foreach (['name', 'label', 'title', 'code'] as $labelField) { |
512 | - if (isset($sets[ $labelField ])) { |
|
513 | - if(services()->has('session')) { |
|
514 | - session()->setFlash('danger', language('FAILED_UPDATE_WITH_LABEL', [$sets[ $labelField ]])); |
|
512 | + if (isset($sets[$labelField])) { |
|
513 | + if (services()->has('session')) { |
|
514 | + session()->setFlash('danger', language('FAILED_UPDATE_WITH_LABEL', [$sets[$labelField]])); |
|
515 | 515 | } |
516 | 516 | |
517 | 517 | $label = true; |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | } |
521 | 521 | |
522 | 522 | if ($label === false) { |
523 | - if(services()->has('session')) { |
|
523 | + if (services()->has('session')) { |
|
524 | 524 | session()->setFlash('danger', language('FAILED_UPDATE')); |
525 | 525 | } |
526 | 526 | } |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | |
563 | 563 | if (method_exists($this, 'updateRecordSets')) { |
564 | 564 | foreach ($sets as $key => $set) { |
565 | - $this->updateRecordSets($sets[ $key ]); |
|
565 | + $this->updateRecordSets($sets[$key]); |
|
566 | 566 | } |
567 | 567 | } |
568 | 568 | |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | */ |
779 | 779 | private function updateRecordStatus($id, $recordStatus, $method) |
780 | 780 | { |
781 | - $sets[ 'record_status' ] = $recordStatus; |
|
781 | + $sets['record_status'] = $recordStatus; |
|
782 | 782 | $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id'; |
783 | 783 | |
784 | 784 | if (method_exists($this, 'updateRecordSets')) { |
@@ -818,7 +818,7 @@ discard block |
||
818 | 818 | private function updateRecordStatusMany(array $ids, $recordStatus, $method) |
819 | 819 | { |
820 | 820 | if (count($ids)) { |
821 | - $sets[ 'record_status' ] = $recordStatus; |
|
821 | + $sets['record_status'] = $recordStatus; |
|
822 | 822 | $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id'; |
823 | 823 | |
824 | 824 | $this->qb->whereIn($primaryKey, $ids); |
@@ -863,7 +863,7 @@ discard block |
||
863 | 863 | private function updateRecordStatusBy($recordStatus, $method, array $conditions) |
864 | 864 | { |
865 | 865 | if (count($conditions)) { |
866 | - $sets[ 'record_status' ] = $recordStatus; |
|
866 | + $sets['record_status'] = $recordStatus; |
|
867 | 867 | |
868 | 868 | if (method_exists($this, 'updateRecordSets')) { |
869 | 869 | $this->updateRecordSets($sets); |
@@ -905,7 +905,7 @@ discard block |
||
905 | 905 | private function updateRecordStatusManyBy($recordStatus, $method, array $conditions) |
906 | 906 | { |
907 | 907 | if (count($conditions)) { |
908 | - $sets[ 'record_status' ] = $recordStatus; |
|
908 | + $sets['record_status'] = $recordStatus; |
|
909 | 909 | |
910 | 910 | if (method_exists($this, 'updateRecordSets')) { |
911 | 911 | $this->updateRecordSets($sets); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | exit(EXIT_ERROR); |
101 | 101 | } |
102 | 102 | |
103 | - $jsonProperties[ 'name' ] = readable( |
|
103 | + $jsonProperties['name'] = readable( |
|
104 | 104 | pathinfo($modulePath, PATHINFO_FILENAME), |
105 | 105 | true |
106 | 106 | ); |
@@ -113,10 +113,10 @@ discard block |
||
113 | 113 | ) . '\\'; |
114 | 114 | } else { |
115 | 115 | $namespace = $this->namespace; |
116 | - $jsonProperties[ 'namespace' ] = rtrim($namespace, '\\') . '\\'; |
|
116 | + $jsonProperties['namespace'] = rtrim($namespace, '\\') . '\\'; |
|
117 | 117 | } |
118 | 118 | |
119 | - $jsonProperties[ 'created' ] = date('d M Y'); |
|
119 | + $jsonProperties['created'] = date('d M Y'); |
|
120 | 120 | |
121 | 121 | loader()->addNamespace($namespace, $modulePath); |
122 | 122 |