Completed
Push — develop ( 8dee05 )
by Dmytro
20:08
created
core/src/ManagerTheme.php 5 patches
Doc Comments   +16 added lines patch added patch discarded remove patch
@@ -270,6 +270,9 @@  discard block
 block discarded – undo
270 270
         return $this->langName;
271 271
     }
272 272
 
273
+    /**
274
+     * @return string
275
+     */
273 276
     public function getTextDir($notEmpty = null)
274 277
     {
275 278
         return ($notEmpty === null) ? $this->textDir : (empty($this->textDir) ? '' : $notEmpty);
@@ -280,6 +283,9 @@  discard block
 block discarded – undo
280 283
         $this->textDir = $textDir === 'rtl' ? 'rtl' : 'ltr';
281 284
     }
282 285
 
286
+    /**
287
+     * @param string $key
288
+     */
283 289
     public function getLexicon($key = null, $default = '')
284 290
     {
285 291
         return $key === null ? $this->lexicon : get_by_key($this->lexicon, $key, $default);
@@ -290,6 +296,9 @@  discard block
 block discarded – undo
290 296
         return $this->charset;
291 297
     }
292 298
 
299
+    /**
300
+     * @param string $charset
301
+     */
293 302
     public function setCharset($charset)
294 303
     {
295 304
         $this->charset = $charset;
@@ -334,6 +343,9 @@  discard block
 block discarded – undo
334 343
         return $key === null ? $this->style : get_by_key($this->style, $key, '');
335 344
     }
336 345
 
346
+    /**
347
+     * @param string $name
348
+     */
337 349
     public function view($name, array $params = [])
338 350
     {
339 351
         return View::make(
@@ -570,6 +582,10 @@  discard block
 block discarded – undo
570 582
         return $content;
571 583
     }
572 584
 
585
+    /**
586
+     * @param string $name
587
+     * @param string $config
588
+     */
573 589
     public function makeTemplate($name, $config = null, array $placeholders = [], $clean = true) : string
574 590
     {
575 591
         $content = $this->getTemplate($name, $config);
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php namespace EvolutionCMS;
2 2
 
3
-use EvolutionCMS\Interfaces\ManagerThemeInterface;
4 3
 use EvolutionCMS\Interfaces\CoreInterface;
4
+use EvolutionCMS\Interfaces\ManagerThemeInterface;
5 5
 use View;
6 6
 
7 7
 class ManagerTheme implements ManagerThemeInterface
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -425,7 +425,7 @@
 block discarded – undo
425 425
     {
426 426
         $out = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
427 427
         if ($out <= 0) {
428
-           $out = null;
428
+            $out = null;
429 429
         }
430 430
 
431 431
         return $out;
Please login to merge, or discard this patch.
Spacing   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -215,23 +215,23 @@  discard block
 block discarded – undo
215 215
         $modx_manager_charset = $this->getCharset();
216 216
         $modx_textdir = $this->getTextDir();
217 217
 
218
-        include_once MODX_MANAGER_PATH . "includes/lang/english.inc.php";
218
+        include_once MODX_MANAGER_PATH."includes/lang/english.inc.php";
219 219
 
220 220
         // now include_once different language file as english
221
-        if (!isset($lang) || !file_exists(MODX_MANAGER_PATH . "includes/lang/" . $lang . ".inc.php")) {
221
+        if (!isset($lang) || !file_exists(MODX_MANAGER_PATH."includes/lang/".$lang.".inc.php")) {
222 222
             $lang = 'english'; // if not set, get the english language file.
223 223
         }
224 224
 
225 225
         // $length_eng_lang = count($_lang);
226 226
         //// Not used for now, required for difference-check with other languages than english (i.e. inside installer)
227 227
 
228
-        if ($lang !== "english" && file_exists(MODX_MANAGER_PATH . "includes/lang/" . $lang . ".inc.php")) {
229
-            include_once MODX_MANAGER_PATH . "includes/lang/" . $lang . ".inc.php";
228
+        if ($lang !== "english" && file_exists(MODX_MANAGER_PATH."includes/lang/".$lang.".inc.php")) {
229
+            include_once MODX_MANAGER_PATH."includes/lang/".$lang.".inc.php";
230 230
         }
231 231
 
232 232
         // allow custom language overrides not altered by future EVO-updates
233
-        if (file_exists(MODX_MANAGER_PATH . "includes/lang/override/" . $lang . ".inc.php")) {
234
-            include_once MODX_MANAGER_PATH . "includes/lang/override/" . $lang . ".inc.php";
233
+        if (file_exists(MODX_MANAGER_PATH."includes/lang/override/".$lang.".inc.php")) {
234
+            include_once MODX_MANAGER_PATH."includes/lang/override/".$lang.".inc.php";
235 235
         }
236 236
 
237 237
         foreach ($_lang as $k => $v) {
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 
298 298
     public function getViewName($name)
299 299
     {
300
-        return $this->namespace . '::' . $name;
300
+        return $this->namespace.'::'.$name;
301 301
     }
302 302
 
303 303
     /**
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
         $_style = [];
309 309
         $modx = $this->core;
310 310
         $_lang = $this->getLexicon();
311
-        include_once $this->getThemeDir(true) . 'style.php';
311
+        include_once $this->getThemeDir(true).'style.php';
312 312
         $this->style = $_style;
313 313
     }
314 314
 
@@ -318,12 +318,12 @@  discard block
 block discarded – undo
318 318
      */
319 319
     public function getThemeDir($full = true) : string
320 320
     {
321
-        return ($full ? MODX_MANAGER_PATH : '') . 'media/style/' . $this->getTheme() . '/';
321
+        return ($full ? MODX_MANAGER_PATH : '').'media/style/'.$this->getTheme().'/';
322 322
     }
323 323
 
324 324
     public function getThemeUrl() : string
325 325
     {
326
-        return MODX_MANAGER_URL . $this->getThemeDir(false);
326
+        return MODX_MANAGER_URL.$this->getThemeDir(false);
327 327
     }
328 328
 
329 329
     /**
@@ -364,10 +364,10 @@  discard block
 block discarded – undo
364 364
             $theme = $this->getTheme();
365 365
         }
366 366
 
367
-        if (is_file(MODX_MANAGER_PATH . "/media/style/" . $theme . "/" . $filepath)) {
368
-            $element = MODX_MANAGER_PATH . "/media/style/" . $theme . "/" . $filepath;
367
+        if (is_file(MODX_MANAGER_PATH."/media/style/".$theme."/".$filepath)) {
368
+            $element = MODX_MANAGER_PATH."/media/style/".$theme."/".$filepath;
369 369
         } else {
370
-            $element = MODX_MANAGER_PATH . ltrim($filepath, '/');
370
+            $element = MODX_MANAGER_PATH.ltrim($filepath, '/');
371 371
         }
372 372
 
373 373
         return $element;
@@ -387,14 +387,14 @@  discard block
 block discarded – undo
387 387
         $controllerName = $this->findController($action);
388 388
 
389 389
         if (\is_int($controllerName)) {
390
-            $out = $this->view('page.' . $action)->render();
390
+            $out = $this->view('page.'.$action)->render();
391 391
         } elseif (class_exists($controllerName) &&
392 392
             \in_array(Interfaces\ManagerTheme\PageControllerInterface::class, class_implements($controllerName), true)
393 393
         ) {
394 394
             /** @var Interfaces\ManagerTheme\PageControllerInterface $controller */
395 395
             $controller = new $controllerName($this, $data);
396 396
             $controller->setIndex($action);
397
-            if (! $controller->canView()) {
397
+            if (!$controller->canView()) {
398 398
                 $this->alertAndQuit('error_no_privileges');
399 399
             } elseif (($out = $controller->checkLocked()) !== null) {
400 400
                 $this->alertAndQuit($out, false);
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
             }
406 406
         } else {
407 407
             $action = 0;
408
-            $out = $this->view('page.' . $action)->render();
408
+            $out = $this->view('page.'.$action)->render();
409 409
         }
410 410
 
411 411
         /********************************************************************/
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
 
424 424
     public function getItemId()
425 425
     {
426
-        $out = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
426
+        $out = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
427 427
         if ($out <= 0) {
428 428
            $out = null;
429 429
         }
@@ -438,9 +438,9 @@  discard block
 block discarded – undo
438 438
         if (isset($_GET['a']) && isset($_POST['a'])) {
439 439
             $this->alertAndQuit('error_double_action');
440 440
         } elseif (isset($_GET['a'])) {
441
-            $action = (int)filter_input(INPUT_GET, 'a', FILTER_VALIDATE_INT, $option);
441
+            $action = (int) filter_input(INPUT_GET, 'a', FILTER_VALIDATE_INT, $option);
442 442
         } elseif (isset($_POST['a'])) {
443
-            $action = (int)filter_input(INPUT_POST, 'a', FILTER_VALIDATE_INT, $option);
443
+            $action = (int) filter_input(INPUT_POST, 'a', FILTER_VALIDATE_INT, $option);
444 444
         } else {
445 445
             $action = null;
446 446
         }
@@ -463,13 +463,13 @@  discard block
 block discarded – undo
463 463
         }
464 464
 
465 465
         // andrazk 20070416 - if installer is running, destroy active sessions
466
-        if (file_exists(MODX_BASE_PATH . 'assets/cache/installProc.inc.php')) {
467
-            include_once(MODX_BASE_PATH . 'assets/cache/installProc.inc.php');
466
+        if (file_exists(MODX_BASE_PATH.'assets/cache/installProc.inc.php')) {
467
+            include_once(MODX_BASE_PATH.'assets/cache/installProc.inc.php');
468 468
             if (isset($installStartTime)) {
469 469
                 if ((time() - $installStartTime) > 5 * 60) { // if install flag older than 5 minutes, discard
470 470
                     unset($installStartTime);
471
-                    @ chmod(MODX_BASE_PATH . 'assets/cache/installProc.inc.php', 0755);
472
-                    unlink(MODX_BASE_PATH . 'assets/cache/installProc.inc.php');
471
+                    @ chmod(MODX_BASE_PATH.'assets/cache/installProc.inc.php', 0755);
472
+                    unlink(MODX_BASE_PATH.'assets/cache/installProc.inc.php');
473 473
                 } else {
474 474
                     if ($_SERVER['REQUEST_METHOD'] != 'POST') {
475 475
                         if (isset($_COOKIE[session_name()])) {
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
                                 //						setcookie(session_name(), '', 0, MODX_BASE_URL);
495 495
                             }
496 496
                             header('HTTP/1.0 307 Redirect');
497
-                            header('Location: ' . MODX_MANAGER_URL . 'index.php?installGoingOn=2');
497
+                            header('Location: '.MODX_MANAGER_URL.'index.php?installGoingOn=2');
498 498
                         }
499 499
                     }
500 500
                 }
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
 
513 513
     public function getManagerStartupPageId()
514 514
     {
515
-        $homeId = (int)$this->getCore()->getConfig('manager_login_startup');
515
+        $homeId = (int) $this->getCore()->getConfig('manager_login_startup');
516 516
         if ($homeId <= 0) {
517 517
             $homeId = $this->getCore()->getConfig('site_start');
518 518
         }
@@ -527,8 +527,8 @@  discard block
 block discarded – undo
527 527
 
528 528
     public function getTemplate($name, $config = null)
529 529
     {
530
-        if(!empty($config) && empty($this->getCore()->getConfig($config))) {
531
-            $this->getCore()->setConfig($config, MODX_MANAGER_PATH . 'media/style/common/' . $name . '.tpl');
530
+        if (!empty($config) && empty($this->getCore()->getConfig($config))) {
531
+            $this->getCore()->setConfig($config, MODX_MANAGER_PATH.'media/style/common/'.$name.'.tpl');
532 532
         }
533 533
 
534 534
         $target = $this->getCore()->getConfig($config);
@@ -547,22 +547,22 @@  discard block
 block discarded – undo
547 547
             }
548 548
         } else {
549 549
             $chunk = $this->getCore()->getChunk($target);
550
-            if ($chunk!==false && !empty($chunk)) {
550
+            if ($chunk !== false && !empty($chunk)) {
551 551
                 $content = $chunk;
552
-            } elseif (is_file(MODX_BASE_PATH . $target)) {
553
-                $target = MODX_BASE_PATH . $target;
552
+            } elseif (is_file(MODX_BASE_PATH.$target)) {
553
+                $target = MODX_BASE_PATH.$target;
554 554
                 $content = file_get_contents($target);
555
-            } elseif (is_file($this->getThemeDir() . $name . '.tpl')) {
556
-                $target = $this->getThemeDir() . $name . '.tpl';
555
+            } elseif (is_file($this->getThemeDir().$name.'.tpl')) {
556
+                $target = $this->getThemeDir().$name.'.tpl';
557 557
                 $content = file_get_contents($target);
558
-            } elseif (is_file($this->getThemeDir() . 'templates/actions/' . $name . '.tpl')) {
559
-                $target = $this->getThemeDir() . 'templates/actions/' . $name . '.tpl';
558
+            } elseif (is_file($this->getThemeDir().'templates/actions/'.$name.'.tpl')) {
559
+                $target = $this->getThemeDir().'templates/actions/'.$name.'.tpl';
560 560
                 $content = file_get_contents($target);
561
-            } elseif (is_file($this->getThemeDir() . 'html/' . $name . '.html')) { // ClipperCMS compatible
562
-                $target = $this->getThemeDir() . 'html/' . $name . '.html';
561
+            } elseif (is_file($this->getThemeDir().'html/'.$name.'.html')) { // ClipperCMS compatible
562
+                $target = $this->getThemeDir().'html/'.$name.'.html';
563 563
                 $content = file_get_contents($target);
564 564
             } else {
565
-                $target = MODX_MANAGER_PATH . 'media/style/common/' . $name . '.tpl';
565
+                $target = MODX_MANAGER_PATH.'media/style/common/'.$name.'.tpl';
566 566
                 $content = file_get_contents($target);
567 567
             }
568 568
         }
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
     public function getTemplatePlaceholders() : array
595 595
     {
596 596
         $plh = [
597
-            'favicon' => (file_exists(MODX_BASE_PATH . 'favicon.ico') ? MODX_SITE_URL : $this->getThemeUrl() . '/images/') . 'favicon.ico',
597
+            'favicon' => (file_exists(MODX_BASE_PATH.'favicon.ico') ? MODX_SITE_URL : $this->getThemeUrl().'/images/').'favicon.ico',
598 598
             'homeurl' => $this->getCore()->makeUrl($this->getManagerStartupPageId()),
599 599
             'logouturl' => MODX_MANAGER_URL.'index.php?a=8',
600 600
             'year' => date('Y'),
@@ -607,17 +607,17 @@  discard block
 block discarded – undo
607 607
         // set login logo image
608 608
         $logo = $this->getCore()->getConfig('login_logo', '');
609 609
         if ($logo !== '') {
610
-            $plh['login_logo'] = MODX_SITE_URL . $logo;
610
+            $plh['login_logo'] = MODX_SITE_URL.$logo;
611 611
         } else {
612
-            $plh['login_logo'] = $this->getThemeUrl() . '/images/login/default/login-logo.png';
612
+            $plh['login_logo'] = $this->getThemeUrl().'/images/login/default/login-logo.png';
613 613
         }
614 614
 
615 615
         // set login background image
616 616
         $background = $this->getCore()->getConfig('login_bg', '');
617 617
         if ($background !== '') {
618
-            $plh['login_bg'] = MODX_SITE_URL . $background;
618
+            $plh['login_bg'] = MODX_SITE_URL.$background;
619 619
         } else {
620
-            $plh['login_bg'] = $this->getThemeUrl() . 'images/login/default/login-background.jpg';
620
+            $plh['login_bg'] = $this->getThemeUrl().'images/login/default/login-background.jpg';
621 621
         }
622 622
         unset($background);
623 623
 
@@ -637,19 +637,19 @@  discard block
 block discarded – undo
637 637
 
638 638
         // andrazk 20070416 - notify user of install/update
639 639
         if (isset($_GET['installGoingOn'])) {
640
-            switch ((int)$_GET['installGoingOn']) {
640
+            switch ((int) $_GET['installGoingOn']) {
641 641
                 case 1:
642 642
                     $this->getCore()->setPlaceholder(
643 643
                         'login_message',
644
-                        '<p><span class="fail">' . $this->getLexicon('login_cancelled_install_in_progress') . '</p>' .
645
-                        '<p>' . $this->getLexicon('login_message') . '</p>'
644
+                        '<p><span class="fail">'.$this->getLexicon('login_cancelled_install_in_progress').'</p>'.
645
+                        '<p>'.$this->getLexicon('login_message').'</p>'
646 646
                     );
647 647
                     break;
648 648
                 case 2:
649 649
                     $this->getCore()->setPlaceholder(
650 650
                         'login_message',
651
-                        '<p><span class="fail">' . $this->getLexicon('login_cancelled_site_was_updated') . '</p>'.
652
-                        '<p>' . $this->getLexicon('login_message') . '</p>'
651
+                        '<p><span class="fail">'.$this->getLexicon('login_cancelled_site_was_updated').'</p>'.
652
+                        '<p>'.$this->getLexicon('login_message').'</p>'
653 653
                     );
654 654
                     break;
655 655
             }
@@ -657,10 +657,10 @@  discard block
 block discarded – undo
657 657
 
658 658
         if ($this->getCore()->getConfig('use_captcha')) {
659 659
             $plh['login_captcha_message'] = $this->getLexicon("login_captcha_message");
660
-            $plh['captcha_image'] = '<a href="' . MODX_MANAGER_URL . '" class="loginCaptcha">' .
661
-                '<img id="captcha_image" src="' . MODX_MANAGER_URL . 'captcha.php?rand=' . rand() . '" alt="' . $this->getLexicon("login_captcha_message") . '" />' .
660
+            $plh['captcha_image'] = '<a href="'.MODX_MANAGER_URL.'" class="loginCaptcha">'.
661
+                '<img id="captcha_image" src="'.MODX_MANAGER_URL.'captcha.php?rand='.rand().'" alt="'.$this->getLexicon("login_captcha_message").'" />'.
662 662
                 '</a>';
663
-            $plh['captcha_input'] = '<label>' . $this->getLexicon("captcha_code") . '</label>' .
663
+            $plh['captcha_input'] = '<label>'.$this->getLexicon("captcha_code").'</label>'.
664 664
                 '<input type="text" name="captcha_code" tabindex="3" value="" />';
665 665
         }
666 666
 
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
 
675 675
         // invoke OnManagerLoginFormRender event
676 676
         $evtOut = $this->getCore()->invokeEvent('OnManagerLoginFormRender');
677
-        $html = is_array($evtOut) ? '<div id="onManagerLoginFormRender">' . implode('', $evtOut) . '</div>' : '';
677
+        $html = is_array($evtOut) ? '<div id="onManagerLoginFormRender">'.implode('', $evtOut).'</div>' : '';
678 678
         $plh['OnManagerLoginFormRender'] = $html;
679 679
 
680 680
         return $this->makeTemplate('login', 'manager_login_tpl', $plh);
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
         // save page to manager object
688 688
         $this->getCore()->getManagerApi()->action = $action;
689 689
 
690
-        if ((int)$action > 1) {
690
+        if ((int) $action > 1) {
691 691
             $sql = sprintf(
692 692
                 "REPLACE INTO %s (sid, internalKey, username, lasthit, action, id) VALUES ('%s', %d, '%s', %d, '%s', %s)",
693 693
                 $this->getCore()->getDatabase()->getFullTableName('active_users'),
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
                 $this->getCore()->getLoginUserID(),
696 696
                 $_SESSION['mgrShortname'],
697 697
                 $this->getCore()->tstart,
698
-                (string)$action,
698
+                (string) $action,
699 699
                 $this->getItemId() ?? var_export(null, true)
700 700
             );
701 701
             $this->getCore()->getDatabase()->query($sql);
@@ -742,26 +742,26 @@  discard block
 block discarded – undo
742 742
     public function getCssFiles()
743 743
     {
744 744
         return [
745
-            'bootstrap' => MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css',
746
-            'font-awesome' => MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css',
747
-            'fonts' => $this->getThemeDir() . 'css/fonts.css',
748
-            'forms' => $this->getThemeDir() . 'css/forms.css',
749
-            'mainmenu' => $this->getThemeDir() . 'css/mainmenu.css',
750
-            'tree' => $this->getThemeDir() . 'css/tree.css',
751
-            'custom' => $this->getThemeDir() . 'css/custom.css',
752
-            'tabpane' => $this->getThemeDir() . 'css/tabpane.css',
753
-            'contextmenu' => $this->getThemeDir() . 'css/contextmenu.css',
754
-            'index' => $this->getThemeDir() . 'css/index.css',
755
-            'main' => $this->getThemeDir() . 'css/main.css'
745
+            'bootstrap' => MODX_MANAGER_PATH.'media/style/common/bootstrap/css/bootstrap.min.css',
746
+            'font-awesome' => MODX_MANAGER_PATH.'media/style/common/font-awesome/css/font-awesome.min.css',
747
+            'fonts' => $this->getThemeDir().'css/fonts.css',
748
+            'forms' => $this->getThemeDir().'css/forms.css',
749
+            'mainmenu' => $this->getThemeDir().'css/mainmenu.css',
750
+            'tree' => $this->getThemeDir().'css/tree.css',
751
+            'custom' => $this->getThemeDir().'css/custom.css',
752
+            'tabpane' => $this->getThemeDir().'css/tabpane.css',
753
+            'contextmenu' => $this->getThemeDir().'css/contextmenu.css',
754
+            'index' => $this->getThemeDir().'css/index.css',
755
+            'main' => $this->getThemeDir().'css/main.css'
756 756
         ];
757 757
     }
758 758
 
759 759
     public function css()
760 760
     {
761
-        $css = $this->getThemeUrl() . 'style.css';
761
+        $css = $this->getThemeUrl().'style.css';
762 762
         $minCssName = 'css/styles.min.css';
763 763
 
764
-        if (!file_exists($this->getThemeDir(). $minCssName) && is_writable($this->getThemeDir() . 'css')) {
764
+        if (!file_exists($this->getThemeDir().$minCssName) && is_writable($this->getThemeDir().'css')) {
765 765
             $files = $this->getCssFiles();
766 766
             $evtOut = $this->getCore()->invokeEvent('OnBeforeMinifyCss', array(
767 767
                 'files' => $files,
@@ -780,19 +780,19 @@  discard block
 block discarded – undo
780 780
                         sprintf($this->getLexicon('invalid_event_response'), 'OnBeforeMinifyManagerCss')
781 781
                     );
782 782
             }
783
-            require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php';
783
+            require_once MODX_BASE_PATH.'assets/lib/Formatter/CSSMinify.php';
784 784
             $minifier = new \Formatter\CSSMinify($files);
785 785
             $css = $minifier->minify();
786 786
             file_put_contents(
787
-                $this->getThemeDir(). $minCssName,
787
+                $this->getThemeDir().$minCssName,
788 788
                 $css
789 789
             );
790 790
         }
791
-        if (file_exists($this->getThemeDir(). $minCssName)) {
792
-            $css = $this->getThemeUrl() . $minCssName;
791
+        if (file_exists($this->getThemeDir().$minCssName)) {
792
+            $css = $this->getThemeUrl().$minCssName;
793 793
         }
794 794
 
795
-        return $css . '?v=' . EVO_INSTALL_TIME;
795
+        return $css.'?v='.EVO_INSTALL_TIME;
796 796
     }
797 797
 
798 798
     public function getMainFrameHeaderHTMLBlock() : string
@@ -806,8 +806,8 @@  discard block
 block discarded – undo
806 806
         $default = 'dark';
807 807
         $modes = array('', 'lightness', 'light', 'dark', 'darkness');
808 808
 
809
-        $cookie = (int)get_by_key($_COOKIE, 'MODX_themeMode', 0, function ($val) use ($modes) {
810
-            return (int)$val > 0 && (int)$val <= \count($modes);
809
+        $cookie = (int) get_by_key($_COOKIE, 'MODX_themeMode', 0, function($val) use ($modes) {
810
+            return (int) $val > 0 && (int) $val <= \count($modes);
811 811
         });
812 812
         $system = $this->getCore()->getConfig('manager_theme_mode');
813 813
 
Please login to merge, or discard this patch.
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -466,7 +466,8 @@  discard block
 block discarded – undo
466 466
         if (file_exists(MODX_BASE_PATH . 'assets/cache/installProc.inc.php')) {
467 467
             include_once(MODX_BASE_PATH . 'assets/cache/installProc.inc.php');
468 468
             if (isset($installStartTime)) {
469
-                if ((time() - $installStartTime) > 5 * 60) { // if install flag older than 5 minutes, discard
469
+                if ((time() - $installStartTime) > 5 * 60) {
470
+// if install flag older than 5 minutes, discard
470 471
                     unset($installStartTime);
471 472
                     @ chmod(MODX_BASE_PATH . 'assets/cache/installProc.inc.php', 0755);
472 473
                     unlink(MODX_BASE_PATH . 'assets/cache/installProc.inc.php');
@@ -558,7 +559,8 @@  discard block
 block discarded – undo
558 559
             } elseif (is_file($this->getThemeDir() . 'templates/actions/' . $name . '.tpl')) {
559 560
                 $target = $this->getThemeDir() . 'templates/actions/' . $name . '.tpl';
560 561
                 $content = file_get_contents($target);
561
-            } elseif (is_file($this->getThemeDir() . 'html/' . $name . '.html')) { // ClipperCMS compatible
562
+            } elseif (is_file($this->getThemeDir() . 'html/' . $name . '.html')) {
563
+// ClipperCMS compatible
562 564
                 $target = $this->getThemeDir() . 'html/' . $name . '.html';
563 565
                 $content = file_get_contents($target);
564 566
             } else {
@@ -806,7 +808,7 @@  discard block
 block discarded – undo
806 808
         $default = 'dark';
807 809
         $modes = array('', 'lightness', 'light', 'dark', 'darkness');
808 810
 
809
-        $cookie = (int)get_by_key($_COOKIE, 'MODX_themeMode', 0, function ($val) use ($modes) {
811
+        $cookie = (int)get_by_key($_COOKIE, 'MODX_themeMode', 0, function ($val) use ($modes){
810 812
             return (int)$val > 0 && (int)$val <= \count($modes);
811 813
         });
812 814
         $system = $this->getCore()->getConfig('manager_theme_mode');
Please login to merge, or discard this patch.
core/src/Models/EventLog.php 2 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php namespace EvolutionCMS\Models;
2 2
 
3
-use Illuminate\Database\Eloquent;
4 3
 use EvolutionCMS\Traits;
4
+use Illuminate\Database\Eloquent;
5 5
 
6 6
 /**
7 7
  * EvolutionCMS\Models\EventLog
Please login to merge, or discard this patch.
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -29,28 +29,28 @@
 block discarded – undo
29 29
     use Traits\Models\ManagerActions,
30 30
         Traits\Models\TimeMutator;
31 31
 
32
-	protected $table = 'event_log';
32
+    protected $table = 'event_log';
33 33
 
34 34
     const CREATED_AT = 'createdon';
35 35
     const UPDATED_AT = null;
36 36
     protected $dateFormat = 'U';
37 37
 
38
-	protected $casts = [
39
-		'eventid' => 'int',
40
-		'createdon' => 'int',
41
-		'type' => 'int',
42
-		'user' => 'int',
43
-		'usertype' => 'int'
44
-	];
38
+    protected $casts = [
39
+        'eventid' => 'int',
40
+        'createdon' => 'int',
41
+        'type' => 'int',
42
+        'user' => 'int',
43
+        'usertype' => 'int'
44
+    ];
45 45
 
46
-	protected $fillable = [
47
-		'eventid',
48
-		'type',
49
-		'user',
50
-		'usertype',
51
-		'source',
52
-		'description'
53
-	];
46
+    protected $fillable = [
47
+        'eventid',
48
+        'type',
49
+        'user',
50
+        'usertype',
51
+        'source',
52
+        'description'
53
+    ];
54 54
 
55 55
     public const TYPE_INFORMATION = 1;
56 56
     public const TYPE_WARNING = 2;
Please login to merge, or discard this patch.
core/src/Models/ManagerUser.php 3 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php namespace EvolutionCMS\Models;
2 2
 
3
-use Illuminate\Database\Eloquent;
4 3
 use EvolutionCMS\Traits;
4
+use Illuminate\Database\Eloquent;
5 5
 
6 6
 /**
7 7
  * EvolutionCMS\Models\ManagerUser
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -16,16 +16,16 @@
 block discarded – undo
16 16
 {
17 17
     use Traits\Models\ManagerActions;
18 18
 
19
-	public $timestamps = false;
19
+    public $timestamps = false;
20 20
 
21
-	protected $hidden = [
22
-		'password'
23
-	];
21
+    protected $hidden = [
22
+        'password'
23
+    ];
24 24
 
25
-	protected $fillable = [
26
-		'username',
27
-		'password'
28
-	];
25
+    protected $fillable = [
26
+        'username',
27
+        'password'
28
+    ];
29 29
 
30 30
     public function attributes()
31 31
     {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,12 +29,12 @@  discard block
 block discarded – undo
29 29
 
30 30
     public function attributes()
31 31
     {
32
-        return $this->hasOne(UserAttribute::class,'internalKey','id');
32
+        return $this->hasOne(UserAttribute::class, 'internalKey', 'id');
33 33
     }
34 34
 
35 35
     public function memberGroups()
36 36
     {
37
-        return $this->hasMany(MemberGroup::class,'member','id');
37
+        return $this->hasMany(MemberGroup::class, 'member', 'id');
38 38
     }
39 39
 
40 40
     public function groups() : Eloquent\Relations\BelongsToMany
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
     public function settings()
46 46
     {
47
-        return $this->hasMany(UserSetting::class,'user','id');
47
+        return $this->hasMany(UserSetting::class, 'user', 'id');
48 48
     }
49 49
 
50 50
     public function delete()
Please login to merge, or discard this patch.
core/src/Models/SiteContent.php 4 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php namespace EvolutionCMS\Models;
2 2
 
3
-use Illuminate\Database\Eloquent;
4 3
 use EvolutionCMS\Traits;
4
+use Illuminate\Database\Eloquent;
5 5
 
6 6
 /**
7 7
  * EvolutionCMS\Models\SiteContent
Please login to merge, or discard this patch.
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -79,69 +79,69 @@
 block discarded – undo
79 79
     const CREATED_AT = 'createdon';
80 80
     const UPDATED_AT = 'editedon';
81 81
     const DELETED_AT = 'deletedon';
82
-	protected $dateFormat = 'U';
83
-
84
-	protected $casts = [
85
-		'published' => 'int',
86
-		'pub_date' => 'int',
87
-		'unpub_date' => 'int',
88
-		'parent' => 'int',
89
-		'isfolder' => 'int',
90
-		'richtext' => 'bool',
91
-		'template' => 'int',
92
-		'menuindex' => 'int',
93
-		'searchable' => 'int',
94
-		'cacheable' => 'int',
95
-		'createdby' => 'int',
96
-		'createdon' => 'int',
97
-		'editedby' => 'int',
98
-		'editedon' => 'int',
99
-		'deleted' => 'int',
100
-		'deletedby' => 'int',
101
-		'publishedon' => 'int',
102
-		'publishedby' => 'int',
103
-		'donthit' => 'bool',
104
-		'privateweb' => 'bool',
105
-		'privatemgr' => 'bool',
106
-		'content_dispo' => 'bool',
107
-		'hidemenu' => 'bool',
108
-		'alias_visible' => 'int'
109
-	];
110
-
111
-	protected $fillable = [
112
-		'type',
113
-		'contentType',
114
-		'pagetitle',
115
-		'longtitle',
116
-		'description',
117
-		'alias',
118
-		'link_attributes',
119
-		'published',
120
-		'pub_date',
121
-		'unpub_date',
122
-		'parent',
123
-		'isfolder',
124
-		'introtext',
125
-		'content',
126
-		'richtext',
127
-		'template',
128
-		'menuindex',
129
-		'searchable',
130
-		'cacheable',
131
-		'createdby',
132
-		'editedby',
133
-		'deleted',
134
-		'deletedby',
135
-		'publishedon',
136
-		'publishedby',
137
-		'menutitle',
138
-		'donthit',
139
-		'privateweb',
140
-		'privatemgr',
141
-		'content_dispo',
142
-		'hidemenu',
143
-		'alias_visible'
144
-	];
82
+    protected $dateFormat = 'U';
83
+
84
+    protected $casts = [
85
+        'published' => 'int',
86
+        'pub_date' => 'int',
87
+        'unpub_date' => 'int',
88
+        'parent' => 'int',
89
+        'isfolder' => 'int',
90
+        'richtext' => 'bool',
91
+        'template' => 'int',
92
+        'menuindex' => 'int',
93
+        'searchable' => 'int',
94
+        'cacheable' => 'int',
95
+        'createdby' => 'int',
96
+        'createdon' => 'int',
97
+        'editedby' => 'int',
98
+        'editedon' => 'int',
99
+        'deleted' => 'int',
100
+        'deletedby' => 'int',
101
+        'publishedon' => 'int',
102
+        'publishedby' => 'int',
103
+        'donthit' => 'bool',
104
+        'privateweb' => 'bool',
105
+        'privatemgr' => 'bool',
106
+        'content_dispo' => 'bool',
107
+        'hidemenu' => 'bool',
108
+        'alias_visible' => 'int'
109
+    ];
110
+
111
+    protected $fillable = [
112
+        'type',
113
+        'contentType',
114
+        'pagetitle',
115
+        'longtitle',
116
+        'description',
117
+        'alias',
118
+        'link_attributes',
119
+        'published',
120
+        'pub_date',
121
+        'unpub_date',
122
+        'parent',
123
+        'isfolder',
124
+        'introtext',
125
+        'content',
126
+        'richtext',
127
+        'template',
128
+        'menuindex',
129
+        'searchable',
130
+        'cacheable',
131
+        'createdby',
132
+        'editedby',
133
+        'deleted',
134
+        'deletedby',
135
+        'publishedon',
136
+        'publishedby',
137
+        'menutitle',
138
+        'donthit',
139
+        'privateweb',
140
+        'privatemgr',
141
+        'content_dispo',
142
+        'hidemenu',
143
+        'alias_visible'
144
+    ];
145 145
 
146 146
     protected $managerActionsMap = [
147 147
         'id' => [
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -200,7 +200,7 @@
 block discarded – undo
200 200
         return array_key_exists($this->getKey(), self::getLockedElements());
201 201
     }
202 202
 
203
-    public function getAlreadyEditInfoAttribute() :? array
203
+    public function getAlreadyEditInfoAttribute() : ? array
204 204
     {
205 205
         return $this->isAlreadyEdit ? self::getLockedElements()[$this->getKey()] : null;
206 206
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -209,7 +209,7 @@
 block discarded – undo
209 209
     {
210 210
         return $builder->where('pub_date', '<=', $time)
211 211
             ->where('pub_date', '>', 0)
212
-            ->where(function(Eloquent\Builder $query) use($time) {
212
+            ->where(function(Eloquent\Builder $query) use($time){
213 213
                 $query->where('unpub_date', '>', $time)
214 214
                     ->orWhere('unpub_date', '=', 0);
215 215
             })->where('published', '=', 0);
Please login to merge, or discard this patch.
core/src/Models/SiteHtmlsnippet.php 3 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php namespace EvolutionCMS\Models;
2 2
 
3
-use Illuminate\Database\Eloquent;
4 3
 use EvolutionCMS\Traits;
4
+use Illuminate\Database\Eloquent;
5 5
 
6 6
 /**
7 7
  * EvolutionCMS\Models\SiteHtmlsnippet
Please login to merge, or discard this patch.
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -39,31 +39,31 @@
 block discarded – undo
39 39
     use Traits\Models\ManagerActions,
40 40
         Traits\Models\TimeMutator;
41 41
 
42
-	const CREATED_AT = 'createdon';
43
-	const UPDATED_AT = 'editedon';
42
+    const CREATED_AT = 'createdon';
43
+    const UPDATED_AT = 'editedon';
44 44
     protected $dateFormat = 'U';
45 45
 
46
-	protected $casts = [
47
-		'editor_type' => 'int',
48
-		'category' => 'int',
49
-		'cache_type' => 'bool',
50
-		'locked' => 'int',
51
-		'createdon' => 'int',
52
-		'editedon' => 'int',
53
-		'disabled' => 'int'
54
-	];
46
+    protected $casts = [
47
+        'editor_type' => 'int',
48
+        'category' => 'int',
49
+        'cache_type' => 'bool',
50
+        'locked' => 'int',
51
+        'createdon' => 'int',
52
+        'editedon' => 'int',
53
+        'disabled' => 'int'
54
+    ];
55 55
 
56
-	protected $fillable = [
57
-		'name',
58
-		'description',
59
-		'editor_type',
60
-		'editor_name',
61
-		'category',
62
-		'cache_type',
63
-		'snippet',
64
-		'locked',
65
-		'disabled'
66
-	];
56
+    protected $fillable = [
57
+        'name',
58
+        'description',
59
+        'editor_type',
60
+        'editor_name',
61
+        'category',
62
+        'cache_type',
63
+        'snippet',
64
+        'locked',
65
+        'disabled'
66
+    ];
67 67
 
68 68
     protected $managerActionsMap = [
69 69
         'actions.cancel' => 76,
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@
 block discarded – undo
117 117
         return array_key_exists($this->getKey(), self::getLockedElements());
118 118
     }
119 119
 
120
-    public function getAlreadyEditInfoAttribute() :? array
120
+    public function getAlreadyEditInfoAttribute() : ? array
121 121
     {
122 122
         return $this->isAlreadyEdit ? self::getLockedElements()[$this->getKey()] : null;
123 123
     }
Please login to merge, or discard this patch.
core/src/Models/SiteModule.php 3 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php namespace EvolutionCMS\Models;
2 2
 
3
-use Illuminate\Database\Eloquent;
4 3
 use EvolutionCMS\Traits;
4
+use Illuminate\Database\Eloquent;
5 5
 
6 6
 /**
7 7
  * EvolutionCMS\Models\SiteModule
Please login to merge, or discard this patch.
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -44,40 +44,40 @@
 block discarded – undo
44 44
     use Traits\Models\ManagerActions,
45 45
         Traits\Models\TimeMutator;
46 46
 
47
-	const CREATED_AT = 'createdon';
48
-	const UPDATED_AT = 'editedon';
47
+    const CREATED_AT = 'createdon';
48
+    const UPDATED_AT = 'editedon';
49 49
     protected $dateFormat = 'U';
50 50
 
51
-	protected $casts = [
52
-		'editor_type' => 'int',
53
-		'disabled' => 'int',
54
-		'category' => 'int',
55
-		'wrap' => 'int',
56
-		'locked' => 'int',
57
-		'enable_resource' => 'int',
58
-		'createdon' => 'int',
59
-		'editedon' => 'int',
60
-		'enable_sharedparams' => 'int'
61
-	];
51
+    protected $casts = [
52
+        'editor_type' => 'int',
53
+        'disabled' => 'int',
54
+        'category' => 'int',
55
+        'wrap' => 'int',
56
+        'locked' => 'int',
57
+        'enable_resource' => 'int',
58
+        'createdon' => 'int',
59
+        'editedon' => 'int',
60
+        'enable_sharedparams' => 'int'
61
+    ];
62 62
 
63
-	protected $fillable = [
64
-		'name',
65
-		'description',
66
-		'editor_type',
67
-		'disabled',
68
-		'category',
69
-		'wrap',
70
-		'locked',
71
-		'icon',
72
-		'enable_resource',
73
-		'resourcefile',
74
-		'guid',
75
-		'enable_sharedparams',
76
-		'properties',
77
-		'modulecode'
78
-	];
63
+    protected $fillable = [
64
+        'name',
65
+        'description',
66
+        'editor_type',
67
+        'disabled',
68
+        'category',
69
+        'wrap',
70
+        'locked',
71
+        'icon',
72
+        'enable_resource',
73
+        'resourcefile',
74
+        'guid',
75
+        'enable_sharedparams',
76
+        'properties',
77
+        'modulecode'
78
+    ];
79 79
 
80
-	protected $managerActionsMap = [
80
+    protected $managerActionsMap = [
81 81
         'actions.cancel' => 76,
82 82
         'actions.new' => 107,
83 83
         'id' => [
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@
 block discarded – undo
131 131
         return array_key_exists($this->getKey(), self::getLockedElements());
132 132
     }
133 133
 
134
-    public function getAlreadyEditInfoAttribute() :? array
134
+    public function getAlreadyEditInfoAttribute() : ? array
135 135
     {
136 136
         return $this->isAlreadyEdit ? self::getLockedElements()[$this->getKey()] : null;
137 137
     }
Please login to merge, or discard this patch.
core/src/Models/SitePlugin.php 4 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php namespace EvolutionCMS\Models;
2 2
 
3
-use Illuminate\Database\Eloquent;
4 3
 use EvolutionCMS\Traits;
4
+use Illuminate\Database\Eloquent;
5 5
 
6 6
 /**
7 7
  * EvolutionCMS\Models\SitePlugin
Please login to merge, or discard this patch.
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -45,32 +45,32 @@  discard block
 block discarded – undo
45 45
     use Traits\Models\ManagerActions,
46 46
         Traits\Models\TimeMutator;
47 47
 
48
-	const CREATED_AT = 'createdon';
49
-	const UPDATED_AT = 'editedon';
48
+    const CREATED_AT = 'createdon';
49
+    const UPDATED_AT = 'editedon';
50 50
     protected $dateFormat = 'U';
51 51
 
52
-	protected $casts = [
53
-		'editor_type' => 'int',
54
-		'category' => 'int',
55
-		'cache_type' => 'bool',
56
-		'locked' => 'int',
57
-		'disabled' => 'int',
58
-		'createdon' => 'int',
59
-		'editedon' => 'int'
60
-	];
61
-
62
-	protected $fillable = [
63
-		'name',
64
-		'description',
65
-		'editor_type',
66
-		'category',
67
-		'cache_type',
68
-		'plugincode',
69
-		'locked',
70
-		'properties',
71
-		'disabled',
72
-		'moduleguid'
73
-	];
52
+    protected $casts = [
53
+        'editor_type' => 'int',
54
+        'category' => 'int',
55
+        'cache_type' => 'bool',
56
+        'locked' => 'int',
57
+        'disabled' => 'int',
58
+        'createdon' => 'int',
59
+        'editedon' => 'int'
60
+    ];
61
+
62
+    protected $fillable = [
63
+        'name',
64
+        'description',
65
+        'editor_type',
66
+        'category',
67
+        'cache_type',
68
+        'plugincode',
69
+        'locked',
70
+        'properties',
71
+        'disabled',
72
+        'moduleguid'
73
+    ];
74 74
 
75 75
     protected $managerActionsMap = [
76 76
         'actions.cancel' => 76,
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         ]
86 86
     ];
87 87
 
88
-	public function scopeActivePhx(Eloquent\Builder $builder)
88
+    public function scopeActivePhx(Eloquent\Builder $builder)
89 89
     {
90 90
         return $builder->where('disabled', '!=', 1)
91 91
             ->whereRaw('plugincode LIKE "%phx.parser.class.inc.php%OnParseDocument();%"');
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
     public function scopeDisabledAlternative(Eloquent\Builder $builder)
132 132
     {
133 133
         return $builder->lockedView()->where('disabled', '=', '0')
134
-            ->whereHas('alternative', function (Eloquent\Builder $builder) {
134
+            ->whereHas('alternative', function(Eloquent\Builder $builder){
135 135
                 return $builder->lockedView()->where('disabled', '=', '1');
136 136
             });
137 137
     }
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
         return array_key_exists($this->getKey(), self::getLockedElements());
147 147
     }
148 148
 
149
-    public function getAlreadyEditInfoAttribute() :? array
149
+    public function getAlreadyEditInfoAttribute() : ? array
150 150
     {
151 151
         return $this->isAlreadyEdit ? self::getLockedElements()[$this->getKey()] : null;
152 152
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     ];
87 87
 
88 88
 	public function scopeActivePhx(Eloquent\Builder $builder)
89
-    {
89
+	{
90 90
         return $builder->where('disabled', '!=', 1)
91 91
             ->whereRaw('plugincode LIKE "%phx.parser.class.inc.php%OnParseDocument();%"');
92 92
     }
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
     public function scopeDisabledAlternative(Eloquent\Builder $builder)
132 132
     {
133 133
         return $builder->lockedView()->where('disabled', '=', '0')
134
-            ->whereHas('alternative', function (Eloquent\Builder $builder) {
134
+            ->whereHas('alternative', function (Eloquent\Builder $builder){
135 135
                 return $builder->lockedView()->where('disabled', '=', '1');
136 136
             });
137 137
     }
Please login to merge, or discard this patch.
core/src/Models/SiteSnippet.php 4 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php namespace EvolutionCMS\Models;
2 2
 
3
-use Illuminate\Database\Eloquent;
4 3
 use EvolutionCMS\Traits;
4
+use Illuminate\Database\Eloquent;
5 5
 
6 6
 /**
7 7
  * EvolutionCMS\Models\SiteSnippet
Please login to merge, or discard this patch.
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -45,32 +45,32 @@
 block discarded – undo
45 45
     use Traits\Models\ManagerActions,
46 46
         Traits\Models\TimeMutator;
47 47
 
48
-	const CREATED_AT = 'createdon';
49
-	const UPDATED_AT = 'editedon';
48
+    const CREATED_AT = 'createdon';
49
+    const UPDATED_AT = 'editedon';
50 50
     protected $dateFormat = 'U';
51 51
 
52
-	protected $casts = [
53
-		'editor_type' => 'int',
54
-		'category' => 'int',
55
-		'cache_type' => 'bool',
56
-		'locked' => 'int',
57
-		'createdon' => 'int',
58
-		'editedon' => 'int',
59
-		'disabled' => 'int'
60
-	];
61
-
62
-	protected $fillable = [
63
-		'name',
64
-		'description',
65
-		'editor_type',
66
-		'category',
67
-		'cache_type',
68
-		'snippet',
69
-		'locked',
70
-		'properties',
71
-		'moduleguid',
72
-		'disabled'
73
-	];
52
+    protected $casts = [
53
+        'editor_type' => 'int',
54
+        'category' => 'int',
55
+        'cache_type' => 'bool',
56
+        'locked' => 'int',
57
+        'createdon' => 'int',
58
+        'editedon' => 'int',
59
+        'disabled' => 'int'
60
+    ];
61
+
62
+    protected $fillable = [
63
+        'name',
64
+        'description',
65
+        'editor_type',
66
+        'category',
67
+        'cache_type',
68
+        'snippet',
69
+        'locked',
70
+        'properties',
71
+        'moduleguid',
72
+        'disabled'
73
+    ];
74 74
 
75 75
     protected $managerActionsMap = [
76 76
         'actions.cancel' => 76,
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
         return array_key_exists($this->getKey(), self::getLockedElements());
125 125
     }
126 126
 
127
-    public function getAlreadyEditInfoAttribute() :? array
127
+    public function getAlreadyEditInfoAttribute() : ? array
128 128
     {
129 129
         return $this->isAlreadyEdit ? self::getLockedElements()[$this->getKey()] : null;
130 130
     }
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 
137 137
     public function setGuidAttribute($value)
138 138
     {
139
-        $this->moduleguid = (string)$value;
139
+        $this->moduleguid = (string) $value;
140 140
     }
141 141
 
142 142
     public function getHasModuleAttribute() : bool
@@ -156,6 +156,6 @@  discard block
 block discarded – undo
156 156
     }
157 157
 
158 158
     public function getSourceCodeAttribute(){
159
-        return '<?php' . "\n" . trim($this->snippet) . "\n";
159
+        return '<?php'."\n".trim($this->snippet)."\n";
160 160
     }
161 161
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -155,7 +155,8 @@
 block discarded – undo
155 155
             ->where('disabled', '=', 0);
156 156
     }
157 157
 
158
-    public function getSourceCodeAttribute(){
158
+    public function getSourceCodeAttribute()
159
+    {
159 160
         return '<?php' . "\n" . trim($this->snippet) . "\n";
160 161
     }
161 162
 }
Please login to merge, or discard this patch.
core/src/Models/SiteTemplate.php 4 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php namespace EvolutionCMS\Models;
2 2
 
3
-use Illuminate\Database\Eloquent;
4 3
 use EvolutionCMS\Traits;
4
+use Illuminate\Database\Eloquent;
5 5
 
6 6
 /**
7 7
  * EvolutionCMS\Models\SiteTemplate
Please login to merge, or discard this patch.
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -43,31 +43,31 @@  discard block
 block discarded – undo
43 43
     use Traits\Models\ManagerActions,
44 44
         Traits\Models\TimeMutator;
45 45
 
46
-	const CREATED_AT = 'createdon';
47
-	const UPDATED_AT = 'editedon';
46
+    const CREATED_AT = 'createdon';
47
+    const UPDATED_AT = 'editedon';
48 48
     protected $dateFormat = 'U';
49 49
 
50
-	protected $casts = [
51
-		'editor_type' => 'int',
52
-		'category' => 'int',
53
-		'template_type' => 'int',
54
-		'locked' => 'int',
55
-		'selectable' => 'int',
56
-		'createdon' => 'int',
57
-		'editedon' => 'int'
58
-	];
59
-
60
-	protected $fillable = [
61
-		'templatename',
62
-		'description',
63
-		'editor_type',
64
-		'category',
65
-		'icon',
66
-		'template_type',
67
-		'content',
68
-		'locked',
69
-		'selectable'
70
-	];
50
+    protected $casts = [
51
+        'editor_type' => 'int',
52
+        'category' => 'int',
53
+        'template_type' => 'int',
54
+        'locked' => 'int',
55
+        'selectable' => 'int',
56
+        'createdon' => 'int',
57
+        'editedon' => 'int'
58
+    ];
59
+
60
+    protected $fillable = [
61
+        'templatename',
62
+        'description',
63
+        'editor_type',
64
+        'category',
65
+        'icon',
66
+        'template_type',
67
+        'content',
68
+        'locked',
69
+        'selectable'
70
+    ];
71 71
 
72 72
     protected $managerActionsMap = [
73 73
         'actions.cancel' => 76,
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         ]
81 81
     ];
82 82
 
83
-	public function getNameAttribute()
83
+    public function getNameAttribute()
84 84
     {
85 85
         return $this->templatename;
86 86
     }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@
 block discarded – undo
146 146
         return array_key_exists($this->getKey(), self::getLockedElements());
147 147
     }
148 148
 
149
-    public function getAlreadyEditInfoAttribute() :? array
149
+    public function getAlreadyEditInfoAttribute() : ? array
150 150
     {
151 151
         return $this->isAlreadyEdit ? self::getLockedElements()[$this->getKey()] : null;
152 152
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@
 block discarded – undo
81 81
     ];
82 82
 
83 83
 	public function getNameAttribute()
84
-    {
84
+	{
85 85
         return $this->templatename;
86 86
     }
87 87
 
Please login to merge, or discard this patch.