Completed
Push — develop ( cb7ecf...5e631f )
by Dmytro
17s
created
manager/includes/manager.lockout.inc.php 1 patch
Braces   +8 added lines, -13 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6
-if($modx->getManagerApi()->action!='8' && isset($_SESSION['mgrValidated'])){
6
+if($modx->getManagerApi()->action!='8' && isset($_SESSION['mgrValidated'])) {
7 7
 
8 8
     $homeurl = $modx->makeUrl($manager_login_startup>0 ? $manager_login_startup:$site_start);
9 9
     $logouturl = MODX_MANAGER_URL.'index.php?a=8';
@@ -35,8 +35,7 @@  discard block
 block discarded – undo
35 35
     	if(substr($target,0,6)==='@CHUNK') {
36 36
     		$target = trim(substr($target,7));
37 37
     		$lockout_tpl = $modx->getChunk($target);
38
-    	}
39
-    	elseif(substr($target,0,5)==='@FILE') {
38
+    	} elseif(substr($target,0,5)==='@FILE') {
40 39
     		$target = trim(substr($target,6));
41 40
     		$lockout_tpl = file_get_contents($target);
42 41
     	}
@@ -44,24 +43,20 @@  discard block
 block discarded – undo
44 43
     	$chunk = $modx->getChunk($target);
45 44
     	if($chunk!==false && !empty($chunk)) {
46 45
     		$lockout_tpl = $chunk;
47
-    	}
48
-    	elseif(is_file(MODX_BASE_PATH . $target)) {
46
+    	} elseif(is_file(MODX_BASE_PATH . $target)) {
49 47
     		$target = MODX_BASE_PATH . $target;
50 48
     		$lockout_tpl = file_get_contents($target);
51
-    	}
52
-    	elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) {
49
+    	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) {
53 50
     		$target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl';
54 51
     		$lockout_tpl = file_get_contents($target);
55
-    	}
56
-	elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) {
52
+    	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) {
57 53
 		$target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl';
58 54
 		$login_tpl = file_get_contents($target);
59
-	}
60
-    	elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) { // ClipperCMS compatible
55
+	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) {
56
+// ClipperCMS compatible
61 57
     		$target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html';
62 58
     		$lockout_tpl = file_get_contents($target);
63
-    	}
64
-    	else {
59
+    	} else {
65 60
     		$target = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl';
66 61
     		$lockout_tpl = file_get_contents($target);
67 62
     	}
Please login to merge, or discard this patch.
manager/includes/config_check.inc.php 1 patch
Braces   +22 added lines, -9 removed lines patch added patch discarded remove patch
@@ -19,12 +19,12 @@  discard block
 block discarded – undo
19 19
 $warningspresent = 0;
20 20
 
21 21
 $sysfiles_check = $modx->getManagerApi()->checkSystemChecksum();
22
-if ($sysfiles_check!=='0'){
22
+if ($sysfiles_check!=='0') {
23 23
       $warningspresent = 1;
24 24
       $warnings[] = array($_lang['configcheck_sysfiles_mod']);
25 25
 }
26 26
 
27
-if (is_writable("includes/config.inc.php")){
27
+if (is_writable("includes/config.inc.php")) {
28 28
     // Warn if world writable
29 29
     if(@fileperms('includes/config.inc.php') & 0x0002) {
30 30
       $warningspresent = 1;
@@ -120,7 +120,8 @@  discard block
 block discarded – undo
120 120
     /**
121 121
      * @return bool
122 122
      */
123
-    function checkSiteCache() {
123
+    function checkSiteCache()
124
+    {
124 125
         $modx = evolutionCMS();
125 126
         $checked= true;
126 127
         if (file_exists($modx->config['base_path'] . 'assets/cache/siteCache.idx.php')) {
@@ -159,26 +160,36 @@  discard block
 block discarded – undo
159 160
 
160 161
 if ($warningspresent==1) {
161 162
 
162
-if(!isset($modx->config['send_errormail'])) $modx->config['send_errormail']='3';
163
+if(!isset($modx->config['send_errormail'])) {
164
+    $modx->config['send_errormail']='3';
165
+}
163 166
 $config_check_results = "<h3>".$_lang['configcheck_notok']."</h3>";
164 167
 
165 168
 for ($i=0;$i<count($warnings);$i++) {
166 169
     switch ($warnings[$i][0]) {
167 170
         case $_lang['configcheck_configinc'];
168 171
             $warnings[$i][1] = $_lang['configcheck_configinc_msg'];
169
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_configinc']);
172
+            if(!$_SESSION["mgrConfigCheck"]) {
173
+                $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_configinc']);
174
+            }
170 175
             break;
171 176
         case $_lang['configcheck_installer'] :
172 177
             $warnings[$i][1] = $_lang['configcheck_installer_msg'];
173
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_installer']);
178
+            if(!$_SESSION["mgrConfigCheck"]) {
179
+                $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_installer']);
180
+            }
174 181
             break;
175 182
         case $_lang['configcheck_cache'] :
176 183
             $warnings[$i][1] = $_lang['configcheck_cache_msg'];
177
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_cache']);
184
+            if(!$_SESSION["mgrConfigCheck"]) {
185
+                $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_cache']);
186
+            }
178 187
             break;
179 188
         case $_lang['configcheck_images'] :
180 189
             $warnings[$i][1] = $_lang['configcheck_images_msg'];
181
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_images']);
190
+            if(!$_SESSION["mgrConfigCheck"]) {
191
+                $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_images']);
192
+            }
182 193
             break;
183 194
         case $_lang['configcheck_sysfiles_mod']:
184 195
             $warnings[$i][1] = $_lang["configcheck_sysfiles_mod_msg"];
@@ -186,7 +197,9 @@  discard block
 block discarded – undo
186 197
 			if($modx->hasPermission('settings')) {
187 198
 				$warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>';
188 199
 			}
189
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']);
200
+            if(!$_SESSION["mgrConfigCheck"]) {
201
+                $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']);
202
+            }
190 203
             break;
191 204
         case $_lang['configcheck_lang_difference'] :
192 205
             $warnings[$i][1] = $_lang['configcheck_lang_difference_msg'];
Please login to merge, or discard this patch.
manager/includes/src/Legacy/mgrResources.php 1 patch
Braces   +23 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php namespace EvolutionCMS\Legacy;
2 2
 
3
-class mgrResources {
3
+class mgrResources
4
+{
4 5
     /**
5 6
      * @var array
6 7
      */
@@ -21,7 +22,8 @@  discard block
 block discarded – undo
21 22
     /**
22 23
      * mgrResources constructor.
23 24
      */
24
-    public function __construct() {
25
+    public function __construct()
26
+    {
25 27
         $this->setTypes();
26 28
         $this->queryItemsFromDB();
27 29
         $this->prepareCategoryArrays();
@@ -30,7 +32,8 @@  discard block
 block discarded – undo
30 32
     /**
31 33
      * @return void
32 34
      */
33
-    public function setTypes() {
35
+    public function setTypes()
36
+    {
34 37
         global $_lang;
35 38
         $this->types['site_templates']    = array(
36 39
             'title'=>$_lang["manage_templates"],
@@ -68,7 +71,8 @@  discard block
 block discarded – undo
68 71
     /**
69 72
      * @return void
70 73
      */
71
-    public function queryItemsFromDB() {
74
+    public function queryItemsFromDB()
75
+    {
72 76
         foreach($this->types as $resourceTable=>$type) {
73 77
             if($this->hasAnyPermissions($type['permissions'])) {
74 78
                 $nameField = isset($type['name']) ? $type['name'] : 'name';
@@ -81,11 +85,13 @@  discard block
 block discarded – undo
81 85
      * @param array $permissions
82 86
      * @return bool
83 87
      */
84
-    public function hasAnyPermissions($permissions) {
88
+    public function hasAnyPermissions($permissions)
89
+    {
85 90
         $modx = evolutionCMS();
86 91
 
87
-        foreach($permissions as $p)
88
-            if($modx->hasPermission($p)) return true;
92
+        foreach($permissions as $p) {
93
+                    if($modx->hasPermission($p)) return true;
94
+        }
89 95
 
90 96
         return false;
91 97
     }
@@ -95,7 +101,8 @@  discard block
 block discarded – undo
95 101
      * @param string $nameField
96 102
      * @return array|bool
97 103
      */
98
-    public function queryResources($resourceTable, $nameField = 'name') {
104
+    public function queryResources($resourceTable, $nameField = 'name')
105
+    {
99 106
         $modx = evolutionCMS(); global $_lang;
100 107
 
101 108
         $allowed = array(
@@ -112,8 +119,9 @@  discard block
 block discarded – undo
112 119
             $tvsql    = 'site_tmplvars.caption, ';
113 120
             $tvjoin   = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates'));
114 121
             $sttfield = 'IF(stt.templateid,1,0) AS reltpl,';
122
+        } else {
123
+            $sttfield = '';
115 124
         }
116
-        else $sttfield = '';
117 125
 
118 126
         $selectableTemplates = $resourceTable === 'site_templates' ? "{$resourceTable}.selectable, " : "";
119 127
 
@@ -126,7 +134,9 @@  discard block
 block discarded – undo
126 134
         );
127 135
         $limit = $modx->getDatabase()->getRecordCount($rs);
128 136
 
129
-        if($limit < 1) return false;
137
+        if($limit < 1) {
138
+            return false;
139
+        }
130 140
 
131 141
         $result = array();
132 142
         while ($row = $modx->getDatabase()->getRow($rs)) {
@@ -138,7 +148,8 @@  discard block
 block discarded – undo
138 148
     /**
139 149
      * @return void
140 150
      */
141
-    public function prepareCategoryArrays() {
151
+    public function prepareCategoryArrays()
152
+    {
142 153
         foreach($this->items as $type=>$items) {
143 154
             foreach((array)$items as $item) {
144 155
                 $catid = $item['catid'] ? $item['catid'] : 0;
@@ -154,7 +165,7 @@  discard block
 block discarded – undo
154 165
 
155 166
         // Now sort by name
156 167
         foreach($this->itemsPerCategory as $catid=>$items) {
157
-            usort($this->itemsPerCategory[$catid], function ($a, $b) {
168
+            usort($this->itemsPerCategory[$catid], function ($a, $b){
158 169
                 return strcasecmp($a['name'], $b['name']);
159 170
             });
160 171
         }
Please login to merge, or discard this patch.
manager/includes/src/Exceptions/ServiceNotFoundException.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,4 +2,6 @@
 block discarded – undo
2 2
 
3 3
 use Exception;
4 4
 
5
-class ServiceNotFoundException extends Exception{}
5
+class ServiceNotFoundException extends Exception
6
+{
7
+}
Please login to merge, or discard this patch.
manager/includes/src/Exceptions/ContainerException.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,4 +2,6 @@
 block discarded – undo
2 2
 
3 3
 use Exception;
4 4
 
5
-class ContainerException extends Exception{}
5
+class ContainerException extends Exception
6
+{
7
+}
Please login to merge, or discard this patch.
manager/includes/src/Core.php 1 patch
Braces   +62 added lines, -31 removed lines patch added patch discarded remove patch
@@ -282,7 +282,8 @@  discard block
 block discarded – undo
282 282
         return $service;
283 283
     }
284 284
 
285
-    private function checkServiceAlias($name){
285
+    private function checkServiceAlias($name)
286
+    {
286 287
         foreach ($this->providerAliases as $alias => $interface) {
287 288
             if($name === $interface) {
288 289
                 return $alias;
@@ -962,13 +963,15 @@  discard block
 block discarded – undo
962 963
             $this->virtualDir = '';
963 964
         }
964 965
 
965
-        if (preg_match('@^[1-9][0-9]*$@', $q) && !isset($this->documentListing[$q])) { /* we got an ID returned, check to make sure it's not an alias */
966
+        if (preg_match('@^[1-9][0-9]*$@', $q) && !isset($this->documentListing[$q])) {
967
+/* we got an ID returned, check to make sure it's not an alias */
966 968
             /* FS#476 and FS#308: check that id is valid in terms of virtualDir structure */
967 969
             if ($this->config['use_alias_path'] == 1) {
968 970
                 if (($this->virtualDir != '' && !isset($this->documentListing[$this->virtualDir . '/' . $q]) || ($this->virtualDir == '' && !isset($this->documentListing[$q]))) && (($this->virtualDir != '' && isset($this->documentListing[$this->virtualDir]) && in_array($q, $this->getChildIds($this->documentListing[$this->virtualDir], 1))) || ($this->virtualDir == '' && in_array($q, $this->getChildIds(0, 1))))) {
969 971
                     $this->documentMethod = 'id';
970 972
                     return $q;
971
-                } else { /* not a valid id in terms of virtualDir, treat as alias */
973
+                } else {
974
+/* not a valid id in terms of virtualDir, treat as alias */
972 975
                     $this->documentMethod = 'alias';
973 976
                     return $q;
974 977
                 }
@@ -976,7 +979,8 @@  discard block
 block discarded – undo
976 979
                 $this->documentMethod = 'id';
977 980
                 return $q;
978 981
             }
979
-        } else { /* we didn't get an ID back, so instead we assume it's an alias */
982
+        } else {
983
+/* we didn't get an ID back, so instead we assume it's an alias */
980 984
             if ($this->config['friendly_alias_urls'] != 1) {
981 985
                 $q = $qOrig;
982 986
             }
@@ -1006,13 +1010,14 @@  discard block
 block discarded – undo
1006 1010
      * @param $id
1007 1011
      * @return array|mixed|null|string
1008 1012
      */
1009
-    public function makePageCacheKey($id){
1013
+    public function makePageCacheKey($id)
1014
+    {
1010 1015
         $hash = $id;
1011 1016
         $tmp = null;
1012 1017
         $params = array();
1013
-        if(!empty($this->systemCacheKey)){
1018
+        if(!empty($this->systemCacheKey)) {
1014 1019
             $hash = $this->systemCacheKey;
1015
-        }else {
1020
+        } else {
1016 1021
             if (!empty($_GET)) {
1017 1022
                 // Sort GET parameters so that the order of parameters on the HTTP request don't affect the generated cache ID.
1018 1023
                 $params = $_GET;
@@ -1021,7 +1026,7 @@  discard block
 block discarded – undo
1021 1026
             }
1022 1027
         }
1023 1028
         $evtOut = $this->invokeEvent("OnMakePageCacheKey", array ("hash" => $hash, "id" => $id, 'params' => $params));
1024
-        if (is_array($evtOut) && count($evtOut) > 0){
1029
+        if (is_array($evtOut) && count($evtOut) > 0) {
1025 1030
             $tmp = array_pop($evtOut);
1026 1031
         }
1027 1032
         return empty($tmp) ? $hash : $tmp;
@@ -1348,7 +1353,8 @@  discard block
 block discarded – undo
1348 1353
         $where = "pub_date <= {$timeNow} AND pub_date!=0 AND published=0";
1349 1354
         $result_pub = $this->getDatabase()->select( 'id', '[+prefix+]site_content',  $where);
1350 1355
         $this->getDatabase()->update($field, '[+prefix+]site_content', $where);
1351
-        if ($this->getDatabase()->getRecordCount($result_pub) >= 1) { //Event unPublished doc
1356
+        if ($this->getDatabase()->getRecordCount($result_pub) >= 1) {
1357
+//Event unPublished doc
1352 1358
             while ($row_pub = $this->getDatabase()->getRow($result_pub)) {
1353 1359
                 $this->invokeEvent("OnDocUnPublished", array(
1354 1360
                     "docid" => $row_pub['id']
@@ -1361,7 +1367,8 @@  discard block
 block discarded – undo
1361 1367
         $where = "unpub_date <= {$timeNow} AND unpub_date!=0 AND published=1";
1362 1368
         $result_unpub = $this->getDatabase()->select( 'id', '[+prefix+]site_content',  $where);
1363 1369
         $this->getDatabase()->update($field, '[+prefix+]site_content', $where);
1364
-        if ($this->getDatabase()->getRecordCount($result_unpub) >= 1) { //Event unPublished doc
1370
+        if ($this->getDatabase()->getRecordCount($result_unpub) >= 1) {
1371
+//Event unPublished doc
1365 1372
             while ($row_unpub = $this->getDatabase()->getRow($result_unpub)) {
1366 1373
                 $this->invokeEvent("OnDocUnPublished", array(
1367 1374
                     "docid" => $row_unpub['id']
@@ -1448,10 +1455,18 @@  discard block
 block discarded – undo
1448 1455
             return array();
1449 1456
         }
1450 1457
         $spacer = md5('<<<EVO>>>');
1451
-        if($left==='{{' && strpos($content,';}}')!==false)  $content = str_replace(';}}', sprintf(';}%s}',   $spacer),$content);
1452
-        if($left==='{{' && strpos($content,'{{}}')!==false) $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content);
1453
-        if($left==='[[' && strpos($content,']]]]')!==false) $content = str_replace(']]]]',sprintf(']]%s]]',  $spacer),$content);
1454
-        if($left==='[[' && strpos($content,']]]')!==false)  $content = str_replace(']]]', sprintf(']%s]]',   $spacer),$content);
1458
+        if($left==='{{' && strpos($content,';}}')!==false) {
1459
+            $content = str_replace(';}}', sprintf(';}%s}',   $spacer),$content);
1460
+        }
1461
+        if($left==='{{' && strpos($content,'{{}}')!==false) {
1462
+            $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content);
1463
+        }
1464
+        if($left==='[[' && strpos($content,']]]]')!==false) {
1465
+            $content = str_replace(']]]]',sprintf(']]%s]]',  $spacer),$content);
1466
+        }
1467
+        if($left==='[[' && strpos($content,']]]')!==false) {
1468
+            $content = str_replace(']]]', sprintf(']%s]]',   $spacer),$content);
1469
+        }
1455 1470
 
1456 1471
         $pos['<![CDATA['] = strpos($content, '<![CDATA[');
1457 1472
         $pos[']]>'] = strpos($content, ']]>');
@@ -1504,7 +1519,8 @@  discard block
 block discarded – undo
1504 1519
                         }
1505 1520
                     }
1506 1521
 
1507
-                    if (!in_array($fetch, $tags)) {  // Avoid double Matches
1522
+                    if (!in_array($fetch, $tags)) {
1523
+// Avoid double Matches
1508 1524
                         $tags[] = $fetch; // Fetch
1509 1525
                     };
1510 1526
                     $fetch = ''; // and reset
@@ -1522,7 +1538,9 @@  discard block
 block discarded – undo
1522 1538
             }
1523 1539
         }
1524 1540
         foreach($tags as $i=>$tag) {
1525
-            if(strpos($tag,$spacer)!==false) $tags[$i] = str_replace($spacer, '', $tag);
1541
+            if(strpos($tag,$spacer)!==false) {
1542
+                $tags[$i] = str_replace($spacer, '', $tag);
1543
+            }
1526 1544
         }
1527 1545
         return $tags;
1528 1546
     }
@@ -1562,7 +1580,10 @@  discard block
 block discarded – undo
1562 1580
         }
1563 1581
 
1564 1582
         foreach ($matches[1] as $i => $key) {
1565
-            if(strpos($key,'[+')!==false) continue; // Allow chunk {{chunk?&param=`xxx`}} with [*tv_name_[+param+]*] as content
1583
+            if(strpos($key,'[+')!==false) {
1584
+                continue;
1585
+            }
1586
+            // Allow chunk {{chunk?&param=`xxx`}} with [*tv_name_[+param+]*] as content
1566 1587
             if (substr($key, 0, 1) == '#') {
1567 1588
                 $key = substr($key, 1);
1568 1589
             } // remove # for QuickEdit format
@@ -2288,7 +2309,8 @@  discard block
 block discarded – undo
2288 2309
      * @return mixed|string
2289 2310
      */
2290 2311
     public function _getSGVar($value)
2291
-    { // Get super globals
2312
+    {
2313
+// Get super globals
2292 2314
         $key = $value;
2293 2315
         $_ = $this->config['enable_filter'];
2294 2316
         $this->config['enable_filter'] = 1;
@@ -2693,7 +2715,8 @@  discard block
 block discarded – undo
2693 2715
         if ($this->config['friendly_urls'] == 1) {
2694 2716
             $aliases = array();
2695 2717
             if (is_array($this->documentListing)) {
2696
-                foreach ($this->documentListing as $path => $docid) { // This is big Loop on large site!
2718
+                foreach ($this->documentListing as $path => $docid) {
2719
+// This is big Loop on large site!
2697 2720
                     $aliases[$docid] = $path;
2698 2721
                     $isfolder[$docid] = $this->aliasListing[$docid]['isfolder'];
2699 2722
                 }
@@ -2726,7 +2749,7 @@  discard block
 block discarded – undo
2726 2749
             $isfriendly = ($this->config['friendly_alias_urls'] == 1 ? 1 : 0);
2727 2750
             $pref = $this->config['friendly_url_prefix'];
2728 2751
             $suff = $this->config['friendly_url_suffix'];
2729
-            $documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) {
2752
+            $documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff){
2730 2753
                 global $modx;
2731 2754
                 $thealias = $aliases[$m[1]];
2732 2755
                 $thefolder = $isfolder[$m[1]];
@@ -4509,7 +4532,8 @@  discard block
 block discarded – undo
4509 4532
         if (isset ($this->snippetCache[$snippetName])) {
4510 4533
             $snippet = $this->snippetCache[$snippetName];
4511 4534
             $properties = !empty($this->snippetCache[$snippetName . "Props"]) ? $this->snippetCache[$snippetName . "Props"] : '';
4512
-        } else { // not in cache so let's check the db
4535
+        } else {
4536
+// not in cache so let's check the db
4513 4537
             $sql = "SELECT ss.`name`, ss.`snippet`, ss.`properties`, sm.properties as `sharedproperties` FROM " . $this->getFullTableName("site_snippets") . " as ss LEFT JOIN " . $this->getFullTableName('site_modules') . " as sm on sm.guid=ss.moduleguid WHERE ss.`name`='" . $this->getDatabase()->escape($snippetName) . "'  AND ss.disabled=0;";
4514 4538
             $result = $this->getDatabase()->query($sql);
4515 4539
             if ($this->getDatabase()->getRecordCount($result) == 1) {
@@ -5010,7 +5034,7 @@  discard block
 block discarded – undo
5010 5034
             $result = $this->getDatabase()->makeArray($rs);
5011 5035
 
5012 5036
             // get default/built-in template variables
5013
-            if(is_array($docRow)){
5037
+            if(is_array($docRow)) {
5014 5038
                 ksort($docRow);
5015 5039
 
5016 5040
                 foreach ($docRow as $key => $value) {
@@ -5485,12 +5509,16 @@  discard block
 block discarded – undo
5485 5509
             return '';
5486 5510
         } // nothing to register
5487 5511
         if (!is_array($options)) {
5488
-            if (is_bool($options))  // backward compatibility with old plaintext parameter
5512
+            if (is_bool($options)) {
5513
+                // backward compatibility with old plaintext parameter
5489 5514
             {
5490 5515
                 $options = array('plaintext' => $options);
5491
-            } elseif (is_string($options)) // Also allow script name as 2nd param
5516
+            }
5517
+            } elseif (is_string($options)) {
5518
+                // Also allow script name as 2nd param
5492 5519
             {
5493 5520
                 $options = array('name' => $options);
5521
+            }
5494 5522
             } else {
5495 5523
                 $options = array();
5496 5524
             }
@@ -5502,7 +5530,8 @@  discard block
 block discarded – undo
5502 5530
         unset($overwritepos); // probably unnecessary--just making sure
5503 5531
 
5504 5532
         $useThisVer = true;
5505
-        if (isset($this->loadedjscripts[$key])) { // a matching script was found
5533
+        if (isset($this->loadedjscripts[$key])) {
5534
+// a matching script was found
5506 5535
             // if existing script is a startup script, make sure the candidate is also a startup script
5507 5536
             if ($this->loadedjscripts[$key]['startup']) {
5508 5537
                 $startup = true;
@@ -5522,7 +5551,8 @@  discard block
 block discarded – undo
5522 5551
                     // overwrite the old script (the position may be important for dependent scripts)
5523 5552
                     $overwritepos = $this->loadedjscripts[$key]['pos'];
5524 5553
                 }
5525
-            } else { // Use the original version
5554
+            } else {
5555
+// Use the original version
5526 5556
                 if ($startup == true && $this->loadedjscripts[$key]['startup'] == false) {
5527 5557
                     // need to move the exisiting script to the head
5528 5558
                     $version = $this->loadedjscripts[$key][$version];
@@ -5647,7 +5677,8 @@  discard block
 block discarded – undo
5647 5677
         }
5648 5678
 
5649 5679
         $results = null;
5650
-        foreach ($this->pluginEvent[$evtName] as $pluginName) { // start for loop
5680
+        foreach ($this->pluginEvent[$evtName] as $pluginName) {
5681
+// start for loop
5651 5682
             if ($this->dumpPlugins) {
5652 5683
                 $eventtime = $this->getMicroTime();
5653 5684
             }
@@ -5793,8 +5824,7 @@  discard block
 block discarded – undo
5793 5824
                     }
5794 5825
                 }
5795 5826
             }
5796
-        }
5797
-        elseif(\is_array($propertyString)) {
5827
+        } elseif(\is_array($propertyString)) {
5798 5828
             $property = $propertyString;
5799 5829
         }
5800 5830
         if (!empty($elementName) && !empty($elementType)) {
@@ -6241,7 +6271,8 @@  discard block
 block discarded – undo
6241 6271
      * @return bool
6242 6272
      */
6243 6273
     public function isSafeCode($phpcode = '', $safe_functions = '')
6244
-    { // return true or false
6274
+    {
6275
+// return true or false
6245 6276
         if ($safe_functions == '') {
6246 6277
             return false;
6247 6278
         }
@@ -6650,7 +6681,7 @@  discard block
 block discarded – undo
6650 6681
             $args = array_pad(array(), $_, '$var');
6651 6682
             $args = implode(", ", $args);
6652 6683
             $modx = &$this;
6653
-            $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val) {
6684
+            $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val){
6654 6685
                 $arg = $val['args'][$tmp - 1];
6655 6686
                 switch (true) {
6656 6687
                     case is_null($arg): {
Please login to merge, or discard this patch.
manager/includes/src/Interfaces/ManagerApiInterface.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,3 +1,5 @@
 block discarded – undo
1 1
 <?php namespace EvolutionCMS\Interfaces;
2 2
 
3
-interface ManagerApiInterface{}
3
+interface ManagerApiInterface
4
+{
5
+}
Please login to merge, or discard this patch.
manager/includes/src/Interfaces/ServiceProviderInterface.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,3 +1,5 @@
 block discarded – undo
1 1
 <?php namespace EvolutionCMS\Interfaces;
2 2
 
3
-interface ServiceProviderInterface{}
3
+interface ServiceProviderInterface
4
+{
5
+}
Please login to merge, or discard this patch.
manager/includes/src/Interfaces/PasswordHashInterface.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,3 +1,5 @@
 block discarded – undo
1 1
 <?php namespace EvolutionCMS\Interfaces;
2 2
 
3
-interface PasswordHashInterface{}
3
+interface PasswordHashInterface
4
+{
5
+}
Please login to merge, or discard this patch.