setParam() публичный Метод

Add a param tag
public setParam ( string $type, string $var = null, string $desc = null ) : DocblockGenerator
$type string
$var string
$desc string
Результат DocblockGenerator
Пример #1
0
 /**
  * Add a function argument
  *
  * @param string  $name
  * @param mixed   $value
  * @param string  $type
  * @return \Pop\Code\Generator\FunctionGenerator
  */
 public function addArgument($name, $value = null, $type = null)
 {
     $typeHintsNotAllowed = array('int', 'integer', 'boolean', 'float', 'string', 'mixed');
     $argType = !in_array($type, $typeHintsNotAllowed) ? $type : null;
     $this->arguments[$name] = array('value' => $value, 'type' => $argType);
     if (null === $this->docblock) {
         $this->docblock = new DocblockGenerator(null, $this->indent);
     }
     if (null !== $type) {
         if (substr($name, 0, 1) != '$') {
             $name = '$' . $name;
         }
         $this->docblock->setParam($type, $name);
     }
     return $this;
 }