Passed
Push — master ( ade1c9...725b43 )
by kill
02:33
created
function.php 2 patches
Doc Comments   +6 added lines, -1 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 }
95 95
 /**
96 96
  * session管理函数
97
- * @param string|array $name session名称 如果为数组则表示进行session设置
97
+ * @param string $name session名称 如果为数组则表示进行session设置
98 98
  * @param mixed $value session值
99 99
  * @return mixed
100 100
  */
@@ -407,6 +407,11 @@  discard block
 block discarded – undo
407 407
         $value .= ' ';
408 408
     }
409 409
 }
410
+/**
411
+ * @param string $name
412
+ *
413
+ * @return string|null
414
+ */
410 415
 function config($name=null,$value=null,$default=null){
411 416
     $config=\puck\Conf::load();
412 417
     if ($name===null){
Please login to merge, or discard this patch.
Braces   +4 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,8 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
     if(isset($arr['status']) && $type==2){
42 42
         $ret=$arr;
43
-    }
44
-    else{
43
+    } else{
45 44
         $ret['status'] = $type;
46 45
         $ret['data'] = $arr;
47 46
     }
@@ -156,7 +155,7 @@  discard block
 block discarded – undo
156 155
                 // 重新生成id
157 156
                 session_regenerate_id();
158 157
             }
159
-        }else {
158
+        } else {
160 159
             if (strpos($name, '.')) {
161 160
                 list($name1, $name2) = explode('.', $name);
162 161
                 return isset($_SESSION[$name1][$name2]) ? $_SESSION[$name1][$name2] : null;
@@ -328,12 +327,11 @@  discard block
 block discarded – undo
328 327
         if ($filters) {
329 328
             if (is_string($filters)) {
330 329
                 $filters = explode(',', $filters);
331
-            }
332
-            else if (is_array($filters)){
330
+            } else if (is_array($filters)){
333 331
                 foreach ($filters as $filter) {
334 332
                     $data = array_map_recursive($filter, $data); // 参数过滤
335 333
                 }
336
-            }else{
334
+            } else{
337 335
                 throw new \RuntimeException('$filters must be an array or string.');
338 336
             }
339 337
         }
Please login to merge, or discard this patch.