Skip to content

Commit

Permalink
remove NodeTypeAnalyzer (#3055)
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Nov 12, 2022
1 parent 64f4a55 commit 3fd129f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 48 deletions.
37 changes: 0 additions & 37 deletions rules/Php73/NodeTypeAnalyzer/NodeTypeAnalyzer.php

This file was deleted.

8 changes: 1 addition & 7 deletions rules/Php73/Rector/FuncCall/StringifyStrNeedlesRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use PHPStan\Type\StringType;
use Rector\Core\Rector\AbstractRector;
use Rector\Core\ValueObject\PhpVersionFeature;
use Rector\Php73\NodeTypeAnalyzer\NodeTypeAnalyzer;
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
Expand All @@ -39,11 +38,6 @@ final class StringifyStrNeedlesRector extends AbstractRector implements MinPhpVe
'stristr',
];

public function __construct(
private readonly NodeTypeAnalyzer $nodeTypeAnalyzer
) {
}

public function provideMinPhpVersion(): int
{
return PhpVersionFeature::DEPRECATE_INT_IN_STR_NEEDLES;
Expand Down Expand Up @@ -99,7 +93,7 @@ public function refactor(Node $node): ?Node
return null;
}

if ($this->nodeTypeAnalyzer->isStringyType($needleType)) {
if ($needleType->isString()->yes()) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
use Rector\Core\ValueObject\PhpVersionFeature;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\NodeTypeResolver\PHPStan\ParametersAcceptorSelectorVariantsWrapper;
use Rector\Php73\NodeTypeAnalyzer\NodeTypeAnalyzer;
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
Expand Down Expand Up @@ -331,8 +330,7 @@ final class NullToStrictStringFuncCallArgRector extends AbstractRector implement

public function __construct(
private readonly ReflectionResolver $reflectionResolver,
private readonly ArgsAnalyzer $argsAnalyzer,
private readonly NodeTypeAnalyzer $nodeTypeAnalyzer
private readonly ArgsAnalyzer $argsAnalyzer
) {
}

Expand Down Expand Up @@ -460,7 +458,7 @@ private function processNullToStrictStringOnNodePosition(
}

$type = $this->nodeTypeResolver->getType($argValue);
if ($this->nodeTypeAnalyzer->isStringyType($type)) {
if ($type->isString()->yes()) {
return null;
}

Expand Down

0 comments on commit 3fd129f

Please sign in to comment.