From 93ccfb777ca92a624ed3774544d3ecc3b54c7e81 Mon Sep 17 00:00:00 2001 From: mdomba Date: Fri, 14 Jan 2011 11:38:43 +0000 Subject: [PATCH] Automatically set getter/setter documentation for the public methods table documentation --- build/commands/api/ApiModel.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/build/commands/api/ApiModel.php b/build/commands/api/ApiModel.php index 807a47f858..6f80bc53f0 100644 --- a/build/commands/api/ApiModel.php +++ b/build/commands/api/ApiModel.php @@ -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); } @@ -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) {