getDocBlock() public method

public getDocBlock ( ) : Zend\Code\Generator\DocBlockGenerator
return Zend\Code\Generator\DocBlockGenerator
Ejemplo n.º 1
0
 protected function handleSetter(Generator\ClassGenerator $generator, PHPProperty $prop, PHPClass $class)
 {
     $name = "set" . Inflector::classify($prop->getName());
     $type = $this->getPropertyType($prop);
     $namespace = explode("\\", $type);
     $namespaceClass = array_pop($namespace);
     $namespace = implode("\\", $namespace);
     if ($namespace == $class->getNamespace() || $namespace == "\\" . $class->getNamespace()) {
         $type = $namespaceClass;
     }
     if (substr($type, -2) == "[]") {
         $type = "array";
     }
     $fullName = "method {$class->getName()} {$name}({$type} \${$prop->getName()})";
     $docblock = $generator->getDocBlock();
     $docblock->setWordWrap(false);
     $tag = new Generator\DocBlock\Tag();
     $tag->setName($fullName);
     $docblock->setTag($tag);
     return;
 }