浏览代码

hide injected params; empty description block

tags/0.1.0
Robin Thoni 9 年前
父节点
当前提交
b0261d7624
共有 2 个文件被更改,包括 13 次插入6 次删除
  1. 7
    5
      src/Doc/Business/DocBlock.php
  2. 6
    1
      src/Doc/Business/LuDocBusiness.php

+ 7
- 5
src/Doc/Business/DocBlock.php 查看文件

@@ -93,11 +93,13 @@ class DocBlock {
93 93
                     $value = $matches[3];
94 94
                     $param_name = substr($param_name, 1);
95 95
 
96
-                    $this->all_params[$param_name] = [
97
-                        "name" => $param_name,
98
-                        "type" => $param_type,
99
-                        "description" => $value
100
-                    ];
96
+                    if (strpos($param_name, "_") !== 0) {
97
+                        $this->all_params[$param_name] = [
98
+                            "name" => $param_name,
99
+                            "type" => $param_type,
100
+                            "description" => $value
101
+                        ];
102
+                    }
101 103
                 }
102 104
             }
103 105
         }

+ 6
- 1
src/Doc/Business/LuDocBusiness.php 查看文件

@@ -152,7 +152,12 @@ class LuDocBusiness
152 152
         }
153 153
         else {
154 154
             $docParser = new DocBlock($description);
155
-            $description = $docParser->description;
155
+            if (trim($docParser->description) != "") {
156
+                $description = $docParser->description;
157
+            }
158
+            else {
159
+                $description = "No description available";
160
+            }
156 161
         }
157 162
 
158 163
         $parameters = [];

正在加载...
取消
保存