Parcourir la source

detailed page template update

tags/0.1.0
Robin Thoni il y a 8 ans
Parent
révision
c93e9714eb
1 fichiers modifiés avec 21 ajouts et 2 suppressions
  1. 21
    2
      src/Doc/Business/LuDocBusiness.php

+ 21
- 2
src/Doc/Business/LuDocBusiness.php Voir le fichier

146
 
146
 
147
         $reflection = new ReflectionMethod($business->getBusinessClass(), $business->getBusinessMethod());
147
         $reflection = new ReflectionMethod($business->getBusinessClass(), $business->getBusinessMethod());
148
         $description = $reflection->getDocComment();
148
         $description = $reflection->getDocComment();
149
+        $docParser = null;
149
         if ($description === false) {
150
         if ($description === false) {
150
             $description = "No description available";
151
             $description = "No description available";
151
         }
152
         }
154
             $description = $docParser->description;
155
             $description = $docParser->description;
155
         }
156
         }
156
 
157
 
158
+        $parameters = [];
159
+        foreach ($reflection->getParameters() as $param) {
160
+            $p = [];
161
+
162
+            $p["name"] = $param->getName();
163
+            if (!is_null($docParser) && isset($docParser->all_params[$param->getName()])) {
164
+                $p["description"] = $docParser->all_params[$param->getName()];
165
+                $p["type"] = "Unknown";
166
+                $p["annotations"] = "";
167
+            }
168
+            else {
169
+                $p["description"] = $description;
170
+                $p["type"] = "Unknown";
171
+                $p["annotations"] = "";
172
+            }
173
+
174
+            $parameters[] = $p;
175
+        }
157
 
176
 
158
         self::printTwig("method.html", array(
177
         self::printTwig("method.html", array(
159
-            "description" => $description,
178
+            "description" => str_replace("\n", "<br />", $description),
160
             "url" => $business->getUrl(),
179
             "url" => $business->getUrl(),
161
             "method" => $business->getMethod(),
180
             "method" => $business->getMethod(),
162
-            "parameters" => []));
181
+            "parameters" => $parameters));
163
     }
182
     }
164
 }
183
 }

Chargement…
Annuler
Enregistrer