@@ 55-67 (lines=13) @@ | ||
52 | * |
|
53 | * @return string |
|
54 | */ |
|
55 | public function writeType(IReflectionProperty $property) |
|
56 | { |
|
57 | $type = ''; |
|
58 | preg_match('/\*\h+@var\h+([^\h]+)/', (string) $property->getDocComment(), $matches); |
|
59 | if (isset($matches[1])) { |
|
60 | $type = $matches[1]; |
|
61 | if ($property->getDeclaringClass()) { |
|
62 | $type = $this->expandNamespaceAlias($property->getDeclaringClass(), $type); |
|
63 | } |
|
64 | $type = ' : ' . $this->formatClassName($type); |
|
65 | } |
|
66 | return $type; |
|
67 | } |
|
68 | ||
69 | /** |
|
70 | * @param IReflectionProperty $property |
@@ 96-108 (lines=13) @@ | ||
93 | * @param \TokenReflection\IReflectionMethod $method |
|
94 | * @return string |
|
95 | */ |
|
96 | private function writeReturnType(IReflectionMethod $method) |
|
97 | { |
|
98 | $returnType = ''; |
|
99 | preg_match('/\*\h+@return\h+([^\h]+)/', (string) $method->getDocComment(), $matches); |
|
100 | if (isset($matches[1])) { |
|
101 | $returnType = $matches[1]; |
|
102 | if ($method->getDeclaringClass()) { |
|
103 | $returnType = $this->expandNamespaceAlias($method->getDeclaringClass(), $returnType); |
|
104 | } |
|
105 | $returnType = ' : ' . $this->formatClassName($returnType); |
|
106 | } |
|
107 | return $returnType; |
|
108 | } |
|
109 | ||
110 | /** |
|
111 | * Overide format line if needed |