Skip to content

Commit 4ea6e81

Browse files
committed
remove old comments.
1 parent 3a97332 commit 4ea6e81

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

src/Php/PhpMethod.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ class PhpMethod
2323

2424
public function __construct(ClassMethod $method, PhpClass $class)
2525
{
26-
// $docString = '';
27-
// $doc = $method->getDocComment();
28-
// if (!empty($doc)) {
29-
// $docString = $doc->getText();
30-
// }
3126
$params = array_map(function (Param $x) use ($class, $method) {
3227
$type = PhpTypeExpression::buildByMethodParam($x, $class->getNamespace(), $method, $x->var->name, $class->getUses());
3328
return new PhpMethodParameter($x->var->name, $type);

src/Php/PhpTypeExpression.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,6 @@ public static function buildByMethodParam(
9292
): self {
9393
$doc = new PhpDocComment($method);
9494
$typeString = $doc->getParamTypeName($paramName);
95-
// if (!empty($docString)) {
96-
// if (preg_match(sprintf('/@%s\s+(\S+)(\b|\s)\s*\$%s.*/', 'param', $paramName), $docString, $matches)) {
97-
// $typeString = $matches[1];
98-
// }
99-
// }
10095
return new self($stmt, self::PARAM, $currentNamespace, $typeString, $uses);
10196
}
10297

@@ -111,14 +106,8 @@ public static function buildByMethodReturn(
111106
array $currentNamespace,
112107
array $uses
113108
): self {
114-
$doc = $stmt->getDocComment();
115-
$typeString = '';
116-
if ($doc instanceof Doc) {
117-
$docString = $doc->getText();
118-
if (preg_match(sprintf('/@%s\s+(\S+)(\b|\s).*/', 'return'), $docString, $matches)) {
119-
$typeString = $matches[1];
120-
}
121-
}
109+
$doc = new PhpDocComment($stmt);
110+
$typeString = $doc->getReturnTypeName();
122111
return new self($stmt, self::RETURN_TYPE, $currentNamespace, $typeString, $uses);
123112
}
124113

0 commit comments

Comments
 (0)