@@ -420,12 +420,12 @@ discard block |
||
420 | 420 | $session->set('language', language()->getDefault()); |
421 | 421 | } |
422 | 422 | |
423 | - if (config('security')->protection[ 'csrf' ] === true) { |
|
423 | + if (config('security')->protection['csrf'] === true) { |
|
424 | 424 | $csrfProtection = new Security\Protections\Csrf(); |
425 | 425 | $this->services->add($csrfProtection, 'csrfProtection'); |
426 | 426 | } |
427 | 427 | |
428 | - if (config('security')->protection[ 'xss' ] === true) { |
|
428 | + if (config('security')->protection['xss'] === true) { |
|
429 | 429 | $xssProtection = new Security\Protections\Xss(); |
430 | 430 | $this->services->add($xssProtection, 'xssProtection'); |
431 | 431 | } |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | $module->loadModel(); |
485 | 485 | |
486 | 486 | // Add View Resource Directory |
487 | - if($this->services->has('view')) { |
|
487 | + if ($this->services->has('view')) { |
|
488 | 488 | view()->addFilePath($module->getResourcesDir()); |
489 | 489 | presenter()->assets->pushFilePath($module->getResourcesDir()); |
490 | 490 | } |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | } |
609 | 609 | |
610 | 610 | if (presenter()->partials->offsetExists('content')) { |
611 | - if(is_ajax()) { |
|
611 | + if (is_ajax()) { |
|
612 | 612 | echo presenter()->partials->content; |
613 | 613 | } else { |
614 | 614 | $htmlOutput = view()->render(); |
@@ -196,10 +196,10 @@ discard block |
||
196 | 196 | */ |
197 | 197 | public function setProperties(array $properties) |
198 | 198 | { |
199 | - if (isset($properties[ 'presets' ])) { |
|
200 | - $this->setPresets($properties[ 'presets' ]); |
|
199 | + if (isset($properties['presets'])) { |
|
200 | + $this->setPresets($properties['presets']); |
|
201 | 201 | |
202 | - unset($properties[ 'presets' ]); |
|
202 | + unset($properties['presets']); |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | $this->properties = $properties; |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | $themes = []; |
290 | 290 | foreach ($directory->getTree() as $themeName => $themeTree) { |
291 | 291 | if (($theme = $this->getTheme($themeName)) instanceof Module\Theme) { |
292 | - $themes[ $themeName ] = $theme; |
|
292 | + $themes[$themeName] = $theme; |
|
293 | 293 | } |
294 | 294 | } |
295 | 295 | |
@@ -312,9 +312,9 @@ discard block |
||
312 | 312 | $dirPath = str_replace(PATH_APP, '', $this->getRealPath()); |
313 | 313 | $dirPathParts = explode(DIRECTORY_SEPARATOR, $dirPath); |
314 | 314 | |
315 | - if(count($dirPathParts)) { |
|
315 | + if (count($dirPathParts)) { |
|
316 | 316 | $dirPathParts = array_map('dash', $dirPathParts); |
317 | - $dirResources.= implode(DIRECTORY_SEPARATOR, $dirPathParts); |
|
317 | + $dirResources .= implode(DIRECTORY_SEPARATOR, $dirPathParts); |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | if (is_null($subDir)) { |
@@ -61,9 +61,9 @@ discard block |
||
61 | 61 | $properties = json_decode(file_get_contents($propFilePath), true); |
62 | 62 | |
63 | 63 | if (json_last_error() === JSON_ERROR_NONE) { |
64 | - if (isset($properties[ 'config' ])) { |
|
65 | - $this->presets = $properties[ 'presets' ]; |
|
66 | - unset($properties[ 'presets' ]); |
|
64 | + if (isset($properties['config'])) { |
|
65 | + $this->presets = $properties['presets']; |
|
66 | + unset($properties['presets']); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | $this->properties = $properties; |
@@ -197,10 +197,10 @@ discard block |
||
197 | 197 | { |
198 | 198 | $extensions = ['.php', '.phtml', '.html', '.tpl']; |
199 | 199 | |
200 | - if (isset($this->presets[ 'extensions' ])) { |
|
201 | - array_unshift($partialsExtensions, $this->presets[ 'extension' ]); |
|
202 | - } elseif (isset($this->presets[ 'extension' ])) { |
|
203 | - array_unshift($extensions, $this->presets[ 'extension' ]); |
|
200 | + if (isset($this->presets['extensions'])) { |
|
201 | + array_unshift($partialsExtensions, $this->presets['extension']); |
|
202 | + } elseif (isset($this->presets['extension'])) { |
|
203 | + array_unshift($extensions, $this->presets['extension']); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | $found = false; |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | } |
220 | 220 | } |
221 | 221 | |
222 | - return (bool) $found; |
|
222 | + return (bool)$found; |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | // ------------------------------------------------------------------------ |
@@ -235,10 +235,10 @@ discard block |
||
235 | 235 | { |
236 | 236 | $extensions = ['.php', '.phtml', '.html', '.tpl']; |
237 | 237 | |
238 | - if (isset($this->presets[ 'extensions' ])) { |
|
239 | - array_unshift($partialsExtensions, $this->presets[ 'extension' ]); |
|
240 | - } elseif (isset($this->presets[ 'extension' ])) { |
|
241 | - array_unshift($extensions, $this->presets[ 'extension' ]); |
|
238 | + if (isset($this->presets['extensions'])) { |
|
239 | + array_unshift($partialsExtensions, $this->presets['extension']); |
|
240 | + } elseif (isset($this->presets['extension'])) { |
|
241 | + array_unshift($extensions, $this->presets['extension']); |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | foreach ($extensions as $extension) { |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | { |
33 | 33 | parent::__construct(); |
34 | 34 | |
35 | - if(services()->has('csrfProtection')) { |
|
35 | + if (services()->has('csrfProtection')) { |
|
36 | 36 | $this->addHeader('X-CSRF-TOKEN', services()->get('csrfProtection')->getToken()); |
37 | 37 | } |
38 | 38 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $error = new ErrorException($errorMessage, $errorSeverity, $errorFile, $errorLine, $errorContext); |
149 | 149 | |
150 | 150 | // Logged the error |
151 | - if(services()->has('logger')) { |
|
151 | + if (services()->has('logger')) { |
|
152 | 152 | logger()->error( |
153 | 153 | implode( |
154 | 154 | ' ', |
@@ -301,21 +301,21 @@ discard block |
||
301 | 301 | ]; |
302 | 302 | |
303 | 303 | $this->statusCode = $code; |
304 | - $this->reasonPhrase = $error[ 'title' ]; |
|
304 | + $this->reasonPhrase = $error['title']; |
|
305 | 305 | |
306 | 306 | if (is_string($vars)) { |
307 | 307 | $vars = ['message' => $vars]; |
308 | - } elseif (is_array($vars) and empty($vars[ 'message' ])) { |
|
309 | - $vars[ 'message' ] = $error[ 'message' ]; |
|
308 | + } elseif (is_array($vars) and empty($vars['message'])) { |
|
309 | + $vars['message'] = $error['message']; |
|
310 | 310 | } |
311 | 311 | |
312 | - if (isset($vars[ 'message' ])) { |
|
313 | - $error[ 'message' ] = $vars[ 'message' ]; |
|
312 | + if (isset($vars['message'])) { |
|
313 | + $error['message'] = $vars['message']; |
|
314 | 314 | } |
315 | 315 | |
316 | 316 | if (is_ajax() or $this->mimeType !== 'text/html') { |
317 | 317 | $this->statusCode = $code; |
318 | - $this->reasonPhrase = $error[ 'title' ]; |
|
318 | + $this->reasonPhrase = $error['title']; |
|
319 | 319 | $this->send($vars); |
320 | 320 | |
321 | 321 | exit(EXIT_ERROR); |
@@ -193,11 +193,11 @@ discard block |
||
193 | 193 | $bundleFontsFile = $this->bundleFile('assets' . DIRECTORY_SEPARATOR . 'fonts.css', |
194 | 194 | implode(PHP_EOL, $this->fonts)); |
195 | 195 | |
196 | - if (is_file($bundleFontsFile[ 'filePath' ])) { |
|
196 | + if (is_file($bundleFontsFile['filePath'])) { |
|
197 | 197 | if (input()->env('DEBUG_STAGE') === 'PRODUCTION') { |
198 | - $output[] = '<link rel="stylesheet" type="text/css" media="all" href="' . $bundleFontsFile[ 'url' ] . '?v=' . $bundleFontsFile[ 'version' ] . '">'; |
|
198 | + $output[] = '<link rel="stylesheet" type="text/css" media="all" href="' . $bundleFontsFile['url'] . '?v=' . $bundleFontsFile['version'] . '">'; |
|
199 | 199 | } else { |
200 | - $output[] = '<link rel="stylesheet" type="text/css" media="all" href="' . $bundleFontsFile[ 'url' ] . '?v=' . $bundleFontsFile[ 'version' ] . '">'; |
|
200 | + $output[] = '<link rel="stylesheet" type="text/css" media="all" href="' . $bundleFontsFile['url'] . '?v=' . $bundleFontsFile['version'] . '">'; |
|
201 | 201 | } |
202 | 202 | } |
203 | 203 | } |
@@ -233,11 +233,11 @@ discard block |
||
233 | 233 | } elseif (in_array(pathinfo($style, PATHINFO_FILENAME), ['module', 'module.min'])) { |
234 | 234 | $modulePublicFile = $this->publishFile($style); |
235 | 235 | |
236 | - if (is_file($modulePublicFile[ 'filePath' ])) { |
|
236 | + if (is_file($modulePublicFile['filePath'])) { |
|
237 | 237 | if (input()->env('DEBUG_STAGE') === 'PRODUCTION') { |
238 | - $output[] = '<link rel="stylesheet" type="text/css" media="all" href="' . $modulePublicFile[ 'minify' ][ 'url' ] . '?v=' . $modulePublicFile[ 'version' ] . '">'; |
|
238 | + $output[] = '<link rel="stylesheet" type="text/css" media="all" href="' . $modulePublicFile['minify']['url'] . '?v=' . $modulePublicFile['version'] . '">'; |
|
239 | 239 | } else { |
240 | - $output[] = '<link rel="stylesheet" type="text/css" media="all" href="' . $modulePublicFile[ 'url' ] . '?v=' . $modulePublicFile[ 'version' ] . '">'; |
|
240 | + $output[] = '<link rel="stylesheet" type="text/css" media="all" href="' . $modulePublicFile['url'] . '?v=' . $modulePublicFile['version'] . '">'; |
|
241 | 241 | } |
242 | 242 | } |
243 | 243 | } else { |
@@ -248,11 +248,11 @@ discard block |
||
248 | 248 | if (count($bundleStyleSources)) { |
249 | 249 | $bundleStylePublicFile = $this->bundleFile($bundleFilename . '.css', $bundleStyleSources); |
250 | 250 | |
251 | - if (is_file($bundleStylePublicFile[ 'filePath' ])) { |
|
251 | + if (is_file($bundleStylePublicFile['filePath'])) { |
|
252 | 252 | if (input()->env('DEBUG_STAGE') === 'PRODUCTION') { |
253 | - $output[] = '<link rel="stylesheet" type="text/css" media="all" href="' . $bundleStylePublicFile[ 'minify' ][ 'url' ] . '?v=' . $bundleStylePublicFile[ 'version' ] . '">'; |
|
253 | + $output[] = '<link rel="stylesheet" type="text/css" media="all" href="' . $bundleStylePublicFile['minify']['url'] . '?v=' . $bundleStylePublicFile['version'] . '">'; |
|
254 | 254 | } else { |
255 | - $output[] = '<link rel="stylesheet" type="text/css" media="all" href="' . $bundleStylePublicFile[ 'url' ] . '?v=' . $bundleStylePublicFile[ 'version' ] . '">'; |
|
255 | + $output[] = '<link rel="stylesheet" type="text/css" media="all" href="' . $bundleStylePublicFile['url'] . '?v=' . $bundleStylePublicFile['version'] . '">'; |
|
256 | 256 | } |
257 | 257 | } |
258 | 258 | } |
@@ -265,15 +265,15 @@ discard block |
||
265 | 265 | foreach ($this->javascripts as $javascript) { |
266 | 266 | if (in_array(pathinfo($style, PATHINFO_FILENAME), $unbundledFilenames)) { |
267 | 267 | $fileVersion = $this->getVersion(filemtime($javascript)); |
268 | - $output[] = '<script type="text/javascript" id="js-'.pathinfo($javascript, PATHINFO_FILENAME).'" src="' . $this->getUrl($javascript) . '?v=' . $fileVersion . '"></script>'; |
|
268 | + $output[] = '<script type="text/javascript" id="js-' . pathinfo($javascript, PATHINFO_FILENAME) . '" src="' . $this->getUrl($javascript) . '?v=' . $fileVersion . '"></script>'; |
|
269 | 269 | } elseif (in_array(pathinfo($javascript, PATHINFO_FILENAME), ['module', 'module.min'])) { |
270 | 270 | $modulePublicFile = $this->publishFile($javascript); |
271 | 271 | |
272 | - if (is_file($modulePublicFile[ 'filePath' ])) { |
|
272 | + if (is_file($modulePublicFile['filePath'])) { |
|
273 | 273 | if (input()->env('DEBUG_STAGE') === 'PRODUCTION') { |
274 | - $output[] = '<script type="text/javascript" id="js-module" src="' . $modulePublicFile[ 'minify' ][ 'url' ] . '?v=' . $modulePublicFile[ 'version' ] . '"></script>'; |
|
274 | + $output[] = '<script type="text/javascript" id="js-module" src="' . $modulePublicFile['minify']['url'] . '?v=' . $modulePublicFile['version'] . '"></script>'; |
|
275 | 275 | } else { |
276 | - $output[] = '<script type="text/javascript" id="js-module" src="' . $modulePublicFile[ 'url' ] . '?v=' . $modulePublicFile[ 'version' ] . '"></script>'; |
|
276 | + $output[] = '<script type="text/javascript" id="js-module" src="' . $modulePublicFile['url'] . '?v=' . $modulePublicFile['version'] . '"></script>'; |
|
277 | 277 | } |
278 | 278 | } |
279 | 279 | } else { |
@@ -284,11 +284,11 @@ discard block |
||
284 | 284 | if (count($bundleJavascriptSources)) { |
285 | 285 | $bundleJavascriptPublicFile = $this->bundleFile($bundleFilename . '.js', $bundleJavascriptSources); |
286 | 286 | |
287 | - if (is_file($bundleJavascriptPublicFile[ 'filePath' ])) { |
|
287 | + if (is_file($bundleJavascriptPublicFile['filePath'])) { |
|
288 | 288 | if (input()->env('DEBUG_STAGE') === 'PRODUCTION') { |
289 | - $output[] = '<script type="text/javascript" id="js-bundle" src="' . $bundleJavascriptPublicFile[ 'minify' ][ 'url' ] . '?v=' . $bundleJavascriptPublicFile[ 'version' ] . '"></script>'; |
|
289 | + $output[] = '<script type="text/javascript" id="js-bundle" src="' . $bundleJavascriptPublicFile['minify']['url'] . '?v=' . $bundleJavascriptPublicFile['version'] . '"></script>'; |
|
290 | 290 | } else { |
291 | - $output[] = '<script type="text/javascript" id="js-bundle" src="' . $bundleJavascriptPublicFile[ 'url' ] . '?v=' . $bundleJavascriptPublicFile[ 'version' ] . '"></script>'; |
|
291 | + $output[] = '<script type="text/javascript" id="js-bundle" src="' . $bundleJavascriptPublicFile['url'] . '?v=' . $bundleJavascriptPublicFile['version'] . '"></script>'; |
|
292 | 292 | } |
293 | 293 | } |
294 | 294 | } |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | if (is_file($mapFilePath = $publicFilePath . '.map')) { |
174 | 174 | $mapMetadata = json_decode(file_get_contents($mapFilePath), true); |
175 | 175 | // if the file version is changed delete it first |
176 | - if ( ! hash_equals($fileVersion, $mapMetadata[ 'version' ])) { |
|
176 | + if ( ! hash_equals($fileVersion, $mapMetadata['version'])) { |
|
177 | 177 | unlink($publicFilePath); |
178 | 178 | unlink($publicMinifyFilePath); |
179 | 179 | unlink($mapFilePath); |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | if ( ! empty($content)) { |
267 | 267 | $sourcesContent[] = $content; |
268 | 268 | } else { |
269 | - unset($sources[ $key ]); |
|
269 | + unset($sources[$key]); |
|
270 | 270 | } |
271 | 271 | } |
272 | 272 | |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | if (is_file($mapFilePath = $publicFilePath . '.map')) { |
288 | 288 | $mapMetadata = json_decode(file_get_contents($mapFilePath), true); |
289 | 289 | // if the file version is changed delete it first |
290 | - if ( ! hash_equals($fileVersion, $mapMetadata[ 'version' ])) { |
|
290 | + if ( ! hash_equals($fileVersion, $mapMetadata['version'])) { |
|
291 | 291 | unlink($publicFilePath); |
292 | 292 | unlink($publicMinifyFilePath); |
293 | 293 | unlink($mapFilePath); |
@@ -111,15 +111,15 @@ discard block |
||
111 | 111 | foreach ($this->javascripts as $javascript) { |
112 | 112 | if (in_array(pathinfo($javascript, PATHINFO_FILENAME), $unbundledFilenames)) { |
113 | 113 | $fileVersion = $this->getVersion(filemtime($javascript)); |
114 | - $output[] = '<script type="text/javascript" id="js-'.pathinfo($javascript, PATHINFO_FILENAME).'" src="' . $this->getUrl($javascript) . '?v=' . $fileVersion . '"></script>'; |
|
114 | + $output[] = '<script type="text/javascript" id="js-' . pathinfo($javascript, PATHINFO_FILENAME) . '" src="' . $this->getUrl($javascript) . '?v=' . $fileVersion . '"></script>'; |
|
115 | 115 | } elseif (in_array(pathinfo($javascript, PATHINFO_FILENAME), ['module', 'module.min'])) { |
116 | 116 | $modulePublicFile = $this->publishFile($javascript); |
117 | 117 | |
118 | - if (is_file($modulePublicFile[ 'filePath' ])) { |
|
118 | + if (is_file($modulePublicFile['filePath'])) { |
|
119 | 119 | if (input()->env('DEBUG_STAGE') === 'PRODUCTION') { |
120 | - $output[] = '<script type="text/javascript" id="js-module" src="' . $modulePublicFile[ 'minify' ][ 'url' ] . '?v=' . $modulePublicFile[ 'version' ] . '"></script>'; |
|
120 | + $output[] = '<script type="text/javascript" id="js-module" src="' . $modulePublicFile['minify']['url'] . '?v=' . $modulePublicFile['version'] . '"></script>'; |
|
121 | 121 | } else { |
122 | - $output[] = '<script type="text/javascript" id="js-module" src="' . $modulePublicFile[ 'url' ] . '?v=' . $modulePublicFile[ 'version' ] . '"></script>'; |
|
122 | + $output[] = '<script type="text/javascript" id="js-module" src="' . $modulePublicFile['url'] . '?v=' . $modulePublicFile['version'] . '"></script>'; |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | } else { |
@@ -130,11 +130,11 @@ discard block |
||
130 | 130 | if (count($bundleJavascriptSources)) { |
131 | 131 | $bundleJavascriptPublicFile = $this->bundleFile($bundleFilename . '.js', $bundleJavascriptSources); |
132 | 132 | |
133 | - if (is_file($bundleJavascriptPublicFile[ 'filePath' ])) { |
|
133 | + if (is_file($bundleJavascriptPublicFile['filePath'])) { |
|
134 | 134 | if (input()->env('DEBUG_STAGE') === 'PRODUCTION') { |
135 | - $output[] = '<script type="text/javascript" id="js-bundle" src="' . $bundleJavascriptPublicFile[ 'minify' ][ 'url' ] . '?v=' . $bundleJavascriptPublicFile[ 'version' ] . '"></script>'; |
|
135 | + $output[] = '<script type="text/javascript" id="js-bundle" src="' . $bundleJavascriptPublicFile['minify']['url'] . '?v=' . $bundleJavascriptPublicFile['version'] . '"></script>'; |
|
136 | 136 | } else { |
137 | - $output[] = '<script type="text/javascript" id="js-bundle" src="' . $bundleJavascriptPublicFile[ 'url' ] . '?v=' . $bundleJavascriptPublicFile[ 'version' ] . '"></script>'; |
|
137 | + $output[] = '<script type="text/javascript" id="js-bundle" src="' . $bundleJavascriptPublicFile['url'] . '?v=' . $bundleJavascriptPublicFile['version'] . '"></script>'; |
|
138 | 138 | } |
139 | 139 | } |
140 | 140 | } |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | $args = func_get_args(); |
68 | 68 | |
69 | 69 | if (count($args)) { |
70 | - if (isset($GLOBALS[ $args[ 0 ] ])) { |
|
71 | - return $GLOBALS[ $args[ 0 ] ]; |
|
70 | + if (isset($GLOBALS[$args[0]])) { |
|
71 | + return $GLOBALS[$args[0]]; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | return null; |
@@ -93,8 +93,8 @@ discard block |
||
93 | 93 | $args = func_get_args(); |
94 | 94 | |
95 | 95 | if (count($args)) { |
96 | - if (isset($_ENV[ $args[ 0 ] ])) { |
|
97 | - return $_ENV[ $args[ 0 ] ]; |
|
96 | + if (isset($_ENV[$args[0]])) { |
|
97 | + return $_ENV[$args[0]]; |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | return null; |
@@ -195,9 +195,9 @@ discard block |
||
195 | 195 | $args = func_get_args(); |
196 | 196 | |
197 | 197 | if (count($args) == 1) { |
198 | - return o2system()->models->autoload($args[ 0 ]); |
|
198 | + return o2system()->models->autoload($args[0]); |
|
199 | 199 | } else if (count($args) == 2) { |
200 | - return o2system()->models->autoload($args[ 0 ], $args[ 1 ]); |
|
200 | + return o2system()->models->autoload($args[0], $args[1]); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | return o2system()->models; |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | $args = func_get_args(); |
220 | 220 | |
221 | 221 | if (count($args)) { |
222 | - return o2system()->modules->getModule($args[ 0 ]); |
|
222 | + return o2system()->modules->getModule($args[0]); |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | return o2system()->modules; |
@@ -261,8 +261,8 @@ discard block |
||
261 | 261 | $args = func_get_args(); |
262 | 262 | |
263 | 263 | if (count($args)) { |
264 | - if (isset($_SESSION[ $args[ 0 ] ])) { |
|
265 | - return $_SESSION[ $args[ 0 ] ]; |
|
264 | + if (isset($_SESSION[$args[0]])) { |
|
265 | + return $_SESSION[$args[0]]; |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | return null; |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | if (method_exists($this, 'getRecordOrdering')) { |
44 | - if ($this->recordOrdering === true && empty($sets[ 'record_ordering' ])) { |
|
45 | - $sets[ 'record_ordering' ] = $this->getRecordOrdering($this->table); |
|
44 | + if ($this->recordOrdering === true && empty($sets['record_ordering'])) { |
|
45 | + $sets['record_ordering'] = $this->getRecordOrdering($this->table); |
|
46 | 46 | } |
47 | 47 | } |
48 | 48 | |
@@ -93,8 +93,8 @@ discard block |
||
93 | 93 | if (method_exists($this, 'insertRecordSets')) { |
94 | 94 | foreach ($sets as $set) { |
95 | 95 | $this->insertRecordSets($set); |
96 | - if ($this->recordOrdering === true && empty($sets[ 'record_ordering' ])) { |
|
97 | - $set[ 'record_ordering' ] = $this->getRecordOrdering($this->table); |
|
96 | + if ($this->recordOrdering === true && empty($sets['record_ordering'])) { |
|
97 | + $set['record_ordering'] = $this->getRecordOrdering($this->table); |
|
98 | 98 | } |
99 | 99 | } |
100 | 100 | } |
@@ -154,8 +154,8 @@ discard block |
||
154 | 154 | $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id'; |
155 | 155 | |
156 | 156 | if (empty($conditions)) { |
157 | - if (isset($sets[ $primaryKey ])) { |
|
158 | - $conditions = [$primaryKey => $sets[ $primaryKey ]]; |
|
157 | + if (isset($sets[$primaryKey])) { |
|
158 | + $conditions = [$primaryKey => $sets[$primaryKey]]; |
|
159 | 159 | } |
160 | 160 | } |
161 | 161 | |
@@ -168,8 +168,8 @@ discard block |
||
168 | 168 | } |
169 | 169 | |
170 | 170 | if (method_exists($this, 'getRecordOrdering')) { |
171 | - if ($this->recordOrdering === true && empty($sets[ 'record_ordering' ])) { |
|
172 | - $sets[ 'record_ordering' ] = $this->getRecordOrdering($this->table); |
|
171 | + if ($this->recordOrdering === true && empty($sets['record_ordering'])) { |
|
172 | + $sets['record_ordering'] = $this->getRecordOrdering($this->table); |
|
173 | 173 | } |
174 | 174 | } |
175 | 175 | |
@@ -202,8 +202,8 @@ discard block |
||
202 | 202 | $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id'; |
203 | 203 | |
204 | 204 | if (empty($conditions)) { |
205 | - if (isset($sets[ $primaryKey ])) { |
|
206 | - $conditions = [$primaryKey => $sets[ $primaryKey ]]; |
|
205 | + if (isset($sets[$primaryKey])) { |
|
206 | + $conditions = [$primaryKey => $sets[$primaryKey]]; |
|
207 | 207 | } else { |
208 | 208 | $conditions = $sets; |
209 | 209 | } |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | |
236 | 236 | if (method_exists($this, 'updateRecordSets')) { |
237 | 237 | foreach ($sets as $key => $set) { |
238 | - $this->updateRecordSets($sets[ $key ]); |
|
238 | + $this->updateRecordSets($sets[$key]); |
|
239 | 239 | } |
240 | 240 | } |
241 | 241 | |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | */ |
384 | 384 | private function updateRecordStatus($id, $recordStatus, $method) |
385 | 385 | { |
386 | - $sets[ 'record_status' ] = $recordStatus; |
|
386 | + $sets['record_status'] = $recordStatus; |
|
387 | 387 | $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id'; |
388 | 388 | |
389 | 389 | if (method_exists($this, 'updateRecordSets')) { |
@@ -417,13 +417,13 @@ discard block |
||
417 | 417 | private function updateRecordStatusMany(array $ids, $recordStatus, $method) |
418 | 418 | { |
419 | 419 | if (count($ids)) { |
420 | - $sets[ 'record_status' ] = $recordStatus; |
|
420 | + $sets['record_status'] = $recordStatus; |
|
421 | 421 | $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id'; |
422 | 422 | |
423 | 423 | $this->qb->whereIn($primaryKey, $ids); |
424 | 424 | |
425 | 425 | if (method_exists($this, 'updateRecordSets')) { |
426 | - $this->updateRecordSets($sets[ $key ]); |
|
426 | + $this->updateRecordSets($sets[$key]); |
|
427 | 427 | } |
428 | 428 | |
429 | 429 | if (method_exists($this, $beforeMethod = 'before' . ucfirst($method))) { |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | private function updateRecordStatusBy(array $conditions = [], $recordStatus, $method) |
456 | 456 | { |
457 | 457 | if (count($conditions)) { |
458 | - $sets[ 'record_status' ] = $recordStatus; |
|
458 | + $sets['record_status'] = $recordStatus; |
|
459 | 459 | |
460 | 460 | if (method_exists($this, 'updateRecordSets')) { |
461 | 461 | $this->updateRecordSets($sets); |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | private function updateRecordStatusManyBy($conditions = [], $recordStatus, $method) |
491 | 491 | { |
492 | 492 | if (count($conditions)) { |
493 | - $sets[ 'record_status' ] = $recordStatus; |
|
493 | + $sets['record_status'] = $recordStatus; |
|
494 | 494 | |
495 | 495 | if (method_exists($this, 'updateRecordSets')) { |
496 | 496 | $this->updateRecordSets($sets); |