Skip to content

Commit

Permalink
Run php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-challis committed Jan 16, 2024
1 parent cc7b3a0 commit 46a0288
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Analyzer/NameResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function enterNode(Node $node)
{
if ($node instanceof Stmt\Namespace_) {
$this->nameContext->startNamespace($node->name);
} elseif ($node instanceof Stmt\Use_) {
} elseif ($node instanceof Use_) {
foreach ($node->uses as $use) {
$this->addAlias($use, $node->type, null);
}
Expand Down Expand Up @@ -161,14 +161,14 @@ public function enterNode(Node $node)
}

if (null !== $arrayItemType) {
$node->type = $this->resolveName(new Node\Name($arrayItemType), Use_::TYPE_NORMAL);
$node->type = $this->resolveName(new Name($arrayItemType), Use_::TYPE_NORMAL);

return;
}
}

foreach ($phpDocNode->getVarTagValues() as $tagValue) {
$type = $this->resolveName(new Node\Name((string) $tagValue->type), Use_::TYPE_NORMAL);
$type = $this->resolveName(new Name((string) $tagValue->type), Use_::TYPE_NORMAL);
$node->type = $type;
break;
}
Expand All @@ -177,7 +177,7 @@ public function enterNode(Node $node)
foreach ($phpDocNode->getTags() as $tagValue) {
if ('@' === $tagValue->name[0] && !str_contains($tagValue->name, '@var')) {
$customTag = str_replace('@', '', $tagValue->name);
$type = $this->resolveName(new Node\Name($customTag), Use_::TYPE_NORMAL);
$type = $this->resolveName(new Name($customTag), Use_::TYPE_NORMAL);
$node->type = $type;

break;
Expand Down Expand Up @@ -207,10 +207,10 @@ public function enterNode(Node $node)
}
} elseif ($node instanceof Expr\FuncCall) {
if ($node->name instanceof Name) {
$node->name = $this->resolveName($node->name, Stmt\Use_::TYPE_FUNCTION);
$node->name = $this->resolveName($node->name, Use_::TYPE_FUNCTION);
}
} elseif ($node instanceof Expr\ConstFetch) {
$node->name = $this->resolveName($node->name, Stmt\Use_::TYPE_CONSTANT);
$node->name = $this->resolveName($node->name, Use_::TYPE_CONSTANT);
} elseif ($node instanceof Stmt\TraitUse) {
foreach ($node->traits as &$trait) {
$trait = $this->resolveClassName($trait);
Expand Down Expand Up @@ -282,7 +282,7 @@ protected function resolveName(Name $name, int $type): Name

protected function resolveClassName(Name $name): Name
{
return $this->resolveName($name, Stmt\Use_::TYPE_NORMAL);
return $this->resolveName($name, Use_::TYPE_NORMAL);
}

/**
Expand Down Expand Up @@ -339,7 +339,7 @@ private function resolveSignature($node): void
$arrayItemType = $this->getArrayItemType($phpDocParam->type);

if (null !== $arrayItemType) {
$param->type = $this->resolveName(new Node\Name($arrayItemType), Use_::TYPE_NORMAL);
$param->type = $this->resolveName(new Name($arrayItemType), Use_::TYPE_NORMAL);
}
}
}
Expand All @@ -356,7 +356,7 @@ private function resolveSignature($node): void
}

if (null !== $arrayItemType) {
$node->returnType = $this->resolveName(new Node\Name($arrayItemType), Use_::TYPE_NORMAL);
$node->returnType = $this->resolveName(new Name($arrayItemType), Use_::TYPE_NORMAL);
}
}
}
Expand Down

0 comments on commit 46a0288

Please sign in to comment.