Пример #1
0
 /**
  * @param IReflectionProperty $property
  *
  * @return string
  */
 public function writeType(IReflectionProperty $property)
 {
     $type = '';
     preg_match('/\\*\\h+@var\\h+([^\\h]+)/', (string) $property->getDocComment(), $matches);
     if (isset($matches[1])) {
         $type = $matches[1];
         if ($property->getDeclaringClass()) {
             $type = $this->expandNamespaceAlias($property->getDeclaringClass(), $type);
         }
         $type = ' : ' . $this->formatClassName($type);
     }
     return $type;
 }
Пример #2
0
 protected function getParser()
 {
     return new CommentParser($this->reflection->getDocComment());
 }