Browse Source

optionnal parameters

tags/0.1.0
Robin Thoni 9 years ago
parent
commit
5d158ab5e9
1 changed files with 7 additions and 3 deletions
  1. 7
    3
      src/Doc/Business/LuDocBusiness.php

+ 7
- 3
src/Doc/Business/LuDocBusiness.php View File

157
 
157
 
158
         $parameters = [];
158
         $parameters = [];
159
         foreach ($reflection->getParameters() as $param) {
159
         foreach ($reflection->getParameters() as $param) {
160
-            $p["name"] = $param->getName();
160
+            $p = [];
161
 
161
 
162
             if (!is_null($docParser) && isset($docParser->all_params[$param->getName()])) {
162
             if (!is_null($docParser) && isset($docParser->all_params[$param->getName()])) {
163
                 $p = $docParser->all_params[$param->getName()];
163
                 $p = $docParser->all_params[$param->getName()];
164
-                $p["annotations"] = "";
165
             }
164
             }
166
             else {
165
             else {
167
                 $p["description"] = "No description available";
166
                 $p["description"] = "No description available";
168
                 $p["type"] = "Unknown";
167
                 $p["type"] = "Unknown";
169
-                $p["annotations"] = "";
168
+            }
169
+            $p["name"] = $param->getName();
170
+            $p["annotations"] = "";
171
+
172
+            if ($param->isOptional()) {
173
+                $p["annotations"] = "Optional. Default value: " . $param->getDefaultValue();
170
             }
174
             }
171
 
175
 
172
             $parameters[] = $p;
176
             $parameters[] = $p;

Loading…
Cancel
Save