Skip to content

Commit

Permalink
Merge pull request #2695 from sabbelasichon/tv-type-methods-update
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Oct 7, 2021
2 parents f1d5f33 + 2cd9582 commit d03a5a8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/Helper/Typo3NodeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,7 @@ private function isPropertyFetchOnParentVariableOfType(Node $node, string $type)
return false;
}

$objectType = $this->nodeTypeResolver->resolve($parentNode->expr->var);

$objectType = $this->nodeTypeResolver->getType($parentNode->expr->var);
if (! $objectType instanceof ObjectType) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function getRuleDefinition(): RuleDefinition

private function refactorMethodSetBody(MethodCall $node): ?MethodCall
{
$bodyType = $this->nodeTypeResolver->resolve($node->args[0]->value);
$bodyType = $this->nodeTypeResolver->getType($node->args[0]->value);
$contentType = isset($node->args[1]) ? $this->valueResolver->getValue($node->args[1]->value) : null;

if (! $bodyType instanceof StringType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ private function alreadyResponseReturnType(ClassMethod $node): bool
continue;
}

$returnType = $this->nodeTypeResolver->getStaticType($return->expr);
$returnType = $this->getType($return->expr);
if ($returnType->isSuperTypeOf($responseObjectType)->yes()) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function getRuleDefinition(): RuleDefinition

private function shouldSkip(MethodCall $node): bool
{
$staticType = $this->getStaticType($node->var);
$staticType = $this->getType($node->var);
if ($staticType instanceof TypeWithClassName && 'TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer' === $staticType->getClassName()) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Rector/v9/v3/RemoveColPosParameterRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function refactor(Node $node): ?Node
}

// must be number type
$secondArgType = $this->getStaticType($node->args[1]->value);
$secondArgType = $this->getType($node->args[1]->value);
if (! $secondArgType instanceof IntegerType) {
return null;
}
Expand Down

0 comments on commit d03a5a8

Please sign in to comment.