|
@@ 14-24 (lines=11) @@
|
| 11 |
|
* @param \TokenReflection\IReflectionClass $class |
| 12 |
|
* @return string |
| 13 |
|
*/ |
| 14 |
|
public function writeProperties(\TokenReflection\IReflectionClass $class) |
| 15 |
|
{ |
| 16 |
|
$written = ''; |
| 17 |
|
$docComment = (string)$class->getDocComment(); |
| 18 |
|
$matches = array(); |
| 19 |
|
preg_match_all('/\*\h+@property(?:-read|-write|)\h+([^\h]+)\h+\$([^\s]+)\s/', (string)$docComment, $matches); |
| 20 |
|
foreach($matches[2] as $i => $name) { |
| 21 |
|
$written .= $this->writeProperty($name, $matches[1][$i]); |
| 22 |
|
} |
| 23 |
|
return $written; |
| 24 |
|
} |
| 25 |
|
|
| 26 |
|
/** |
| 27 |
|
* @param \TokenReflection\IReflectionMethod $method |
|
@@ 57-67 (lines=11) @@
|
| 54 |
|
* @param \TokenReflection\IReflectionClass $class |
| 55 |
|
* @return string |
| 56 |
|
*/ |
| 57 |
|
public function writeMethods(IReflectionClass $class) |
| 58 |
|
{ |
| 59 |
|
$written = ''; |
| 60 |
|
$docComment = (string)$class->getDocComment(); |
| 61 |
|
$matches = array(); |
| 62 |
|
preg_match_all('/\*\h+@method\h+([^\h]+)\h+([^(\s]+)(?:\h*\(\h*([^)]*)\h*\))?\s/', (string)$docComment, $matches); |
| 63 |
|
foreach($matches[2] as $i => $name) { |
| 64 |
|
$written .= $this->writeMethod($name, $matches[3][$i], $matches[1][$i]); |
| 65 |
|
} |
| 66 |
|
return $written; |
| 67 |
|
} |
| 68 |
|
|
| 69 |
|
/** |
| 70 |
|
* @param \TokenReflection\IReflectionClass $class |