Skip to content

Commit c777863

Browse files
committed
remove union/intersection scope
1 parent e228b77 commit c777863

1 file changed

Lines changed: 0 additions & 15 deletions

File tree

‎src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@
3636
use PhpParser\Node\Expr\MethodCall;
3737
use PhpParser\Node\Expr\New_;
3838
use PhpParser\Node\Expr\NullsafeMethodCall;
39-
use PhpParser\Node\Expr\PostDec;
40-
use PhpParser\Node\Expr\PostInc;
41-
use PhpParser\Node\Expr\PreDec;
42-
use PhpParser\Node\Expr\PreInc;
4339
use PhpParser\Node\Expr\Print_;
4440
use PhpParser\Node\Expr\PropertyFetch;
4541
use PhpParser\Node\Expr\StaticCall;
@@ -52,7 +48,6 @@
5248
use PhpParser\Node\Expr\Yield_;
5349
use PhpParser\Node\Expr\YieldFrom;
5450
use PhpParser\Node\Identifier;
55-
use PhpParser\Node\IntersectionType;
5651
use PhpParser\Node\Name;
5752
use PhpParser\Node\NullableType;
5853
use PhpParser\Node\Stmt;
@@ -75,7 +70,6 @@
7570
use PhpParser\Node\Stmt\TryCatch;
7671
use PhpParser\Node\Stmt\Unset_;
7772
use PhpParser\Node\Stmt\While_;
78-
use PhpParser\Node\UnionType;
7973
use PhpParser\NodeTraverser;
8074
use PHPStan\Analyser\MutatingScope;
8175
use PHPStan\Analyser\NodeCallbackScope;
@@ -102,7 +96,6 @@
10296
use Rector\NodeTypeResolver\Node\AttributeKey;
10397
use Rector\PhpParser\Node\FileNode;
10498
use Rector\Util\Reflection\PrivatesAccessor;
105-
use Webmozart\Assert\Assert;
10699

107100
/**
108101
* @inspired by https://github.com/silverstripe/silverstripe-upgrader/blob/532182b23e854d02e0b27e68ebc394f436de0682/src/UpgradeRule/PHP/Visitor/PHPStanScopeVisitor.php
@@ -310,14 +303,6 @@ private function fillScope(array $stmts, string $filePath, MutatingScope $scope)
310303
return;
311304
}
312305

313-
if ($node instanceof UnionType || $node instanceof IntersectionType) {
314-
foreach ($node->types as $type) {
315-
$type->setAttribute(AttributeKey::SCOPE, $mutatingScope);
316-
}
317-
318-
return;
319-
}
320-
321306
if ($node instanceof StaticPropertyFetch || $node instanceof ClassConstFetch) {
322307
$node->class->setAttribute(AttributeKey::SCOPE, $mutatingScope);
323308
$node->name->setAttribute(AttributeKey::SCOPE, $mutatingScope);

0 commit comments

Comments
 (0)