Update docdown to fix doc bugs related to params that are properties of other params. [ci skip]

This commit is contained in:
John-David Dalton
2013-12-19 00:00:00 -08:00
parent 1d8b152758
commit bbc0c97329
3 changed files with 29 additions and 22 deletions

View File

@@ -141,12 +141,16 @@ class Entry {
// compose parts
$result = array($result);
$params = $this->getParams();
$paramNames = array();
foreach ($params as $param) {
// skip params that are properties of other params (e.g. `options.leading`)
if (!preg_match('/\w+\.[\w.]+\s*=/', $param[1])) {
preg_match('/\w+(?=\.[\w.]+)/', $param[1], $parentParam);
$parentParam = $parentParam[0];
if (!in_array($parentParam, $paramNames)) {
$result[] = $param[1];
}
$paramNames[] = preg_replace('/^\[|\]$/', '', $param[1]);
}
// format
$result = $name .'('. implode(array_slice($result, 1), ', ') .')';