Skip to content

Commit 01c1d11

Browse files
wip
1 parent a37047b commit 01c1d11

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/Analyzer/DocblockTypesResolver.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,18 @@ private function resolveFunctionTypes(Node $node): void
119119
return;
120120
}
121121

122+
$this->resolveParamTypes($node, $docblock);
123+
124+
$this->resolveReturnValueType($node, $docblock);
125+
126+
$this->resolveThrowsValueType($node, $docblock);
127+
}
128+
129+
/**
130+
* @param Stmt\ClassMethod|Stmt\Function_|Expr\Closure|Expr\ArrowFunction $node
131+
*/
132+
private function resolveParamTypes(Node $node, Docblock $docblock): void
133+
{
122134
// extract param types from param tags
123135
foreach ($node->params as $param) {
124136
if (!$this->isTypeArray($param->type)) { // not an array, nothing to do
@@ -138,10 +150,6 @@ private function resolveFunctionTypes(Node $node): void
138150

139151
$param->type = $this->resolveName(new Name($type), Stmt\Use_::TYPE_NORMAL);
140152
}
141-
142-
$this->resolveReturnValueType($node, $docblock);
143-
144-
$this->resolveThrowsValueType($node, $docblock);
145153
}
146154

147155
/**

0 commit comments

Comments
 (0)