Completed
Push — develop ( d0bb9b...5613ed )
by Maxim
05:28
created
index.php 1 patch
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -50,17 +50,23 @@  discard block
 block discarded – undo
50 50
 	include_once($autoloader);
51 51
 }
52 52
 
53
-if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true);
53
+if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) {
54
+    $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true);
55
+}
54 56
 
55 57
 $base_path = str_replace('\\','/',dirname(__FILE__)) . '/';
56
-if(is_file($base_path . 'assets/cache/siteManager.php'))
58
+if(is_file($base_path . 'assets/cache/siteManager.php')) {
57 59
     include_once($base_path . 'assets/cache/siteManager.php');
58
-if(!defined('MGR_DIR') && is_dir("{$base_path}manager"))
60
+}
61
+if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) {
59 62
 	define('MGR_DIR', 'manager');
60
-if(is_file($base_path . 'assets/cache/siteHostnames.php'))
63
+}
64
+if(is_file($base_path . 'assets/cache/siteHostnames.php')) {
61 65
     include_once($base_path . 'assets/cache/siteHostnames.php');
62
-if(!defined('MODX_SITE_HOSTNAMES'))
66
+}
67
+if(!defined('MODX_SITE_HOSTNAMES')) {
63 68
 	define('MODX_SITE_HOSTNAMES', '');
69
+}
64 70
 
65 71
 // get start time
66 72
 $mstart = memory_get_usage();
@@ -129,7 +135,7 @@  discard block
 block discarded – undo
129 135
     @ini_set("display_errors","0");
130 136
 }
131 137
 
132
-if(MODX_CLI){
138
+if(MODX_CLI) {
133 139
     @set_time_limit(0);
134 140
     @ini_set('max_execution_time',0);
135 141
 }
Please login to merge, or discard this patch.
manager/includes/document.parser.class.inc.php 1 patch
Doc Comments   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
      * MODX_MANAGER_PATH."includes/extenders/ex_{$extname}.inc.php"
281 281
      * $extname - extension name in lowercase
282 282
      *
283
-     * @param $extname
283
+     * @param string $extname
284 284
      * @param bool $reload
285 285
      * @return bool
286 286
      */
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
      * @param int $count_attempts
326 326
      * @param string $type $type
327 327
      * @param string $responseCode
328
-     * @return bool|null
328
+     * @return false|null
329 329
      * @global string $base_url
330 330
      * @global string $site_url
331 331
      */
@@ -1042,7 +1042,7 @@  discard block
 block discarded – undo
1042 1042
     }
1043 1043
 
1044 1044
     /**
1045
-     * @param $contents
1045
+     * @param string $contents
1046 1046
      * @return mixed
1047 1047
      */
1048 1048
     public function RecoveryEscapedTags($contents)
@@ -1068,7 +1068,7 @@  discard block
 block discarded – undo
1068 1068
     }
1069 1069
 
1070 1070
     /**
1071
-     * @param $tstart
1071
+     * @param double $tstart
1072 1072
      * @return array
1073 1073
      */
1074 1074
     public function getTimerStats($tstart)
@@ -1851,7 +1851,7 @@  discard block
 block discarded – undo
1851 1851
 
1852 1852
     /**
1853 1853
      * Remove Comment-Tags from output like <!--@- Comment -@-->
1854
-     * @param $content
1854
+     * @param string $content
1855 1855
      * @param string $left
1856 1856
      * @param string $right
1857 1857
      * @return mixed
@@ -2029,7 +2029,7 @@  discard block
 block discarded – undo
2029 2029
     /**
2030 2030
      * Run snippets as per the tags in $documentSource and replace the tags with the returned values.
2031 2031
      *
2032
-     * @param $content
2032
+     * @param string $content
2033 2033
      * @return string
2034 2034
      * @internal param string $documentSource
2035 2035
      */
@@ -3098,7 +3098,7 @@  discard block
 block discarded – undo
3098 3098
 
3099 3099
     /**
3100 3100
      * @param $templateID
3101
-     * @return mixed
3101
+     * @return string
3102 3102
      */
3103 3103
     public function _getTemplateCodeFromDB($templateID)
3104 3104
     {
@@ -3142,7 +3142,7 @@  discard block
 block discarded – undo
3142 3142
     /**
3143 3143
      * @param $id
3144 3144
      * @param int $top
3145
-     * @return mixed
3145
+     * @return string
3146 3146
      */
3147 3147
     public function getUltimateParentId($id, $top = 0)
3148 3148
     {
@@ -3482,7 +3482,7 @@  discard block
 block discarded – undo
3482 3482
      *
3483 3483
      * @param int $type Types: 1=template, 2=tv, 3=chunk, 4=snippet, 5=plugin, 6=module, 7=resource, 8=role
3484 3484
      * @param int $id Element- / Resource-id
3485
-     * @return bool
3485
+     * @return false|null
3486 3486
      */
3487 3487
     public function lockElement($type, $id)
3488 3488
     {
@@ -3505,7 +3505,7 @@  discard block
 block discarded – undo
3505 3505
      * @param int $type Types: 1=template, 2=tv, 3=chunk, 4=snippet, 5=plugin, 6=module, 7=resource, 8=role
3506 3506
      * @param int $id Element- / Resource-id
3507 3507
      * @param bool $includeAllUsers true = Deletes not only own user-locks
3508
-     * @return bool
3508
+     * @return false|null
3509 3509
      */
3510 3510
     public function unlockElement($type, $id, $includeAllUsers = false)
3511 3511
     {
@@ -3616,7 +3616,7 @@  discard block
 block discarded – undo
3616 3616
      * @param array $params
3617 3617
      * @param string $msg
3618 3618
      * @param array $files
3619
-     * @return mixed
3619
+     * @return boolean
3620 3620
      */
3621 3621
     public function sendmail($params = array(), $msg = '', $files = array())
3622 3622
     {
@@ -4053,7 +4053,7 @@  discard block
 block discarded – undo
4053 4053
      *                     Default: 1
4054 4054
      * @param string $fields List of fields
4055 4055
      *                       Default: id, pagetitle, description, alias
4056
-     * @return boolean|array
4056
+     * @return string
4057 4057
      */
4058 4058
     public function getPageInfo($pageid = -1, $active = 1, $fields = 'id, pagetitle, description, alias')
4059 4059
     {
@@ -4151,7 +4151,7 @@  discard block
 block discarded – undo
4151 4151
      *
4152 4152
      * @param string $type
4153 4153
      * @param bool $report
4154
-     * @return bool
4154
+     * @return boolean|null
4155 4155
      */
4156 4156
     public function clearCache($type = '', $report = false)
4157 4157
     {
@@ -4524,7 +4524,7 @@  discard block
 block discarded – undo
4524 4524
      * - Placeholders prefix. Default: '{'.
4525 4525
      * @param string $suffix {string}
4526 4526
      * - Placeholders suffix. Default: '}'.
4527
-     * @return bool|mixed|string {string; false} - Parsed chunk or false if $chunkArr is not array.
4527
+     * @return false|string {string; false} - Parsed chunk or false if $chunkArr is not array.
4528 4528
      * - Parsed chunk or false if $chunkArr is not array.
4529 4529
      */
4530 4530
     public function parseChunk($chunkName, $chunkArr, $prefix = '{', $suffix = '}')
@@ -5558,7 +5558,7 @@  discard block
 block discarded – undo
5558 5558
      * Remove event listener - only for use within the current execution cycle
5559 5559
      *
5560 5560
      * @param string $evtName
5561
-     * @return boolean
5561
+     * @return false|null
5562 5562
      */
5563 5563
     public function removeEventListener($evtName)
5564 5564
     {
@@ -5582,7 +5582,7 @@  discard block
 block discarded – undo
5582 5582
      *
5583 5583
      * @param string $evtName
5584 5584
      * @param array $extParams Parameters available to plugins. Each array key will be the PHP variable name, and the array value will be the variable value.
5585
-     * @return boolean|array
5585
+     * @return false|null
5586 5586
      */
5587 5587
     public function invokeEvent($evtName, $extParams = array())
5588 5588
     {
@@ -6204,7 +6204,7 @@  discard block
 block discarded – undo
6204 6204
 
6205 6205
     /**
6206 6206
      * @param string $str
6207
-     * @return bool|mixed|string
6207
+     * @return string
6208 6208
      */
6209 6209
     public function atBindFileContent($str = '')
6210 6210
     {
@@ -6261,8 +6261,8 @@  discard block
 block discarded – undo
6261 6261
     }
6262 6262
 
6263 6263
     /**
6264
-     * @param $str
6265
-     * @return bool|string
6264
+     * @param string $str
6265
+     * @return false|string
6266 6266
      */
6267 6267
     public function getExtFromFilename($str)
6268 6268
     {
@@ -6290,7 +6290,7 @@  discard block
 block discarded – undo
6290 6290
      * @param string $text Error message
6291 6291
      * @param string $file File where the error was detected
6292 6292
      * @param string $line Line number within $file
6293
-     * @return boolean
6293
+     * @return boolean|null
6294 6294
      */
6295 6295
     public function phpError($nr, $text, $file, $line)
6296 6296
     {
@@ -6342,7 +6342,7 @@  discard block
 block discarded – undo
6342 6342
      * @param string $text
6343 6343
      * @param string $line
6344 6344
      * @param string $output
6345
-     * @return bool
6345
+     * @return null|boolean
6346 6346
      */
6347 6347
     public function messageQuit(
6348 6348
         $msg = 'unspecified error',
@@ -6785,7 +6785,7 @@  discard block
 block discarded – undo
6785 6785
 
6786 6786
     /**
6787 6787
      * @param string $str
6788
-     * @return bool|mixed|string
6788
+     * @return string
6789 6789
      */
6790 6790
     public function atBindInclude($str = '')
6791 6791
     {
@@ -6837,7 +6837,7 @@  discard block
 block discarded – undo
6837 6837
      * @param $str
6838 6838
      * @param int $flags
6839 6839
      * @param string $encode
6840
-     * @return mixed
6840
+     * @return string
6841 6841
      */
6842 6842
     public function htmlspecialchars($str, $flags = ENT_COMPAT, $encode = '')
6843 6843
     {
@@ -6847,7 +6847,7 @@  discard block
 block discarded – undo
6847 6847
     }
6848 6848
 
6849 6849
     /**
6850
-     * @param $string
6850
+     * @param string $string
6851 6851
      * @param bool $returnData
6852 6852
      * @return bool|mixed
6853 6853
      */
Please login to merge, or discard this patch.
manager/includes/preload.functions.inc.php 1 patch
Braces   +23 added lines, -19 removed lines patch added patch discarded remove patch
@@ -4,14 +4,14 @@  discard block
 block discarded – undo
4 4
 $site_sessionname = genEvoSessionName(); // For legacy extras not using startCMSSession
5 5
 
6 6
 
7
-if( ! function_exists('evolutionCMS')) {
7
+if( ! function_exists('evolutionCMS')) {
8 8
     /**
9 9
      * @return DocumentParser
10 10
      */
11
-    function evolutionCMS()
12
-    {
13
-        if( ! defined('MODX_CLASS')) {
14
-            if( ! class_exists('DocumentParser')) {
11
+    function evolutionCMS()
12
+    {
13
+        if( ! defined('MODX_CLASS')) {
14
+            if( ! class_exists('DocumentParser')) {
15 15
                 throw new RuntimeException('MODX_CLASS not defined and DocumentParser class not exists');
16 16
             }
17 17
             define('MODX_CLASS', 'DocumentParser');
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
 /**
25 25
  * @return string
26 26
  */
27
-function genEvoSessionName()
28
-{
27
+function genEvoSessionName()
28
+{
29 29
     $_ = crc32(__FILE__);
30 30
     $_ = sprintf('%u', $_);
31 31
 
@@ -35,10 +35,12 @@  discard block
 block discarded – undo
35 35
 /**
36 36
  * @return void
37 37
  */
38
-function startCMSSession()
39
-{
38
+function startCMSSession()
39
+{
40 40
     global $site_sessionname, $https_port, $session_cookie_path, $session_cookie_domain;
41
-    if(MODX_CLI) return;
41
+    if(MODX_CLI) {
42
+        return;
43
+    }
42 44
 
43 45
     session_name($site_sessionname);
44 46
     removeInvalidCmsSessionIds($site_sessionname);
@@ -49,14 +51,14 @@  discard block
 block discarded – undo
49 51
     session_set_cookie_params($cookieExpiration, $cookiePath, $cookieDomain, $secure, true);
50 52
     session_start();
51 53
     $key = "modx.mgr.session.cookie.lifetime";
52
-    if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) {
54
+    if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) {
53 55
         $cookieLifetime = (int)$_SESSION[$key];
54
-        if ($cookieLifetime) {
56
+        if ($cookieLifetime) {
55 57
             $cookieExpiration = $_SERVER['REQUEST_TIME'] + $cookieLifetime;
56 58
         }
57 59
         setcookie(session_name(), session_id(), $cookieExpiration, $cookiePath, $cookieDomain, $secure, true);
58 60
     }
59
-    if (!isset($_SESSION['modx.session.created.time'])) {
61
+    if (!isset($_SESSION['modx.session.created.time'])) {
60 62
         $_SESSION['modx.session.created.time'] = $_SERVER['REQUEST_TIME'];
61 63
     }
62 64
 }
@@ -66,9 +68,9 @@  discard block
 block discarded – undo
66 68
  * @param $session_name
67 69
  * @return void
68 70
  */
69
-function removeInvalidCmsSessionFromStorage(&$storage, $session_name)
70
-{
71
-    if (isset($storage[$session_name]) && ($storage[$session_name] === '' || $storage[$session_name] === 'deleted')) {
71
+function removeInvalidCmsSessionFromStorage(&$storage, $session_name)
72
+{
73
+    if (isset($storage[$session_name]) && ($storage[$session_name] === '' || $storage[$session_name] === 'deleted')) {
72 74
         unset($storage[$session_name]);
73 75
     }
74 76
 }
@@ -77,9 +79,11 @@  discard block
 block discarded – undo
77 79
  * @param $session_name
78 80
  * @return void
79 81
  */
80
-function removeInvalidCmsSessionIds($session_name)
81
-{
82
-    if(MODX_CLI) return;
82
+function removeInvalidCmsSessionIds($session_name)
83
+{
84
+    if(MODX_CLI) {
85
+        return;
86
+    }
83 87
     // session ids is invalid iff it is empty string
84 88
     // storage priorioty can see in PHP source ext/session/session.c
85 89
     removeInvalidCmsSessionFromStorage($_COOKIE, $session_name);
Please login to merge, or discard this patch.