Skip to content

Commit

Permalink
[Experiment] [NodeTypeResolver] Remove no longer needed deep Expr vis…
Browse files Browse the repository at this point in the history
…itor ExprScopeFromStmtNodeVisitor (#6223)

* [NodeTypeResolver] Remove no longer used deep Expr visitor ExprScopeFromStmtNodeVisitor

* clean up old comment
  • Loading branch information
samsonasik authored Aug 7, 2024
1 parent e4708c5 commit 59585ae
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 93 deletions.
2 changes: 1 addition & 1 deletion build/target-repository/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"require": {
"php": "^7.2|^8.0",
"phpstan/phpstan": "^1.11.8"
"phpstan/phpstan": "^1.11.9"
},
"autoload": {
"files": [
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"nikic/php-parser": "^4.19.1",
"ondram/ci-detector": "^4.2",
"phpstan/phpdoc-parser": "^1.29",
"phpstan/phpstan": "^1.11.8",
"phpstan/phpstan": "^1.11.9",
"react/event-loop": "^1.5",
"react/promise": "^3.2",
"react/socket": "^1.15",
Expand Down
5 changes: 0 additions & 5 deletions src/NodeTypeResolver/Node/AttributeKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,6 @@ final class AttributeKey
*/
public const STATEMENT_DEPTH = 'statementDepth';

/**
* @var string
*/
public const EXPRESSION_DEPTH = 'expressionDepth';

/**
* @var string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\NodeTypeResolver\PHPStan\Scope\Contract\NodeVisitor\ScopeResolverNodeVisitorInterface;
use Rector\PhpParser\Node\CustomNode\FileWithoutNamespace;
use Rector\PHPStan\NodeVisitor\ExprScopeFromStmtNodeVisitor;
use Rector\PHPStan\NodeVisitor\UnreachableStatementNodeVisitor;
use Rector\PHPStan\NodeVisitor\WrappedNodeRestoringNodeVisitor;
use Rector\Util\Reflection\PrivatesAccessor;
Expand Down Expand Up @@ -117,7 +116,6 @@ public function processNodes(

$scope = $formerMutatingScope ?? $this->scopeFactory->createFromFile($filePath);

// skip chain method calls, performance issue: https://github.com/phpstan/phpstan/issues/254
$hasUnreachableStatementNode = false;
$nodeCallback = function (Node $node, MutatingScope $mutatingScope) use (
&$nodeCallback,
Expand Down Expand Up @@ -278,7 +276,6 @@ public function processNodes(

$nodeTraverser = new NodeTraverser();
$nodeTraverser->addVisitor(new WrappedNodeRestoringNodeVisitor());
$nodeTraverser->addVisitor(new ExprScopeFromStmtNodeVisitor($this, $filePath, $scope));

if ($hasUnreachableStatementNode) {
$nodeTraverser->addVisitor(new UnreachableStatementNodeVisitor($this, $filePath, $scope));
Expand Down
83 changes: 0 additions & 83 deletions src/PHPStan/NodeVisitor/ExprScopeFromStmtNodeVisitor.php

This file was deleted.

0 comments on commit 59585ae

Please sign in to comment.