Skip to content

Commit

Permalink
Automatically set getter/setter documentation for the public methods …
Browse files Browse the repository at this point in the history
…table documentation
  • Loading branch information
mdomba committed Jan 14, 2011
1 parent 4f5ed81 commit 93ccfb7
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions build/commands/api/ApiModel.php
Expand Up @@ -419,6 +419,11 @@ protected function tagParam($object,$comment)
*/
$segs[1]=trim(preg_replace('/^\$\w+/','',$segs[1]));
$param->description=$this->processDescription($segs[1]);
if(empty($object->introduction))
{
if(substr($object->name,0,3)=='set')
$object->introduction='Sets '.$param->description;
}
}
next($object->input);
}
Expand All @@ -433,7 +438,22 @@ protected function tagReturn($object,$comment)
$object->output=new ParamDoc;
$object->output->type=$segs[0];
if(isset($segs[1]))
{
$object->output->description=$this->processDescription($segs[1]);
if(empty($object->introduction))
{
/*
* If no custom introduction, add automatically
* with this getters introduction displayed in public methods table is resolved
*/
if(substr($object->name,0,5)=='getIs')
$object->introduction='Checks '.$object->output->description;
elseif(substr($object->name,0,3)=='get')
$object->introduction='Returns '.$object->output->description;
elseif(substr($object->name,0,3)=='has')
$object->introduction='Determines '.$object->output->description;
}
}
}
else if($object instanceof PropertyDoc)
{
Expand Down

0 comments on commit 93ccfb7

Please sign in to comment.