Skip to content

Commit

Permalink
Updated Rector to commit 59585ae75aafa8c5e2666b047a84f13ab35fb59f
Browse files Browse the repository at this point in the history
rectorphp/rector-src@59585ae [Experiment] [NodeTypeResolver] Remove no longer needed deep Expr visitor ExprScopeFromStmtNodeVisitor (#6223)
  • Loading branch information
TomasVotruba committed Aug 7, 2024
1 parent d40c7c4 commit cbfdee3
Show file tree
Hide file tree
Showing 21 changed files with 271 additions and 115 deletions.
2 changes: 1 addition & 1 deletion 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
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'e4708c58a4ddb167511d61dff636d9edcdd0e805';
public const PACKAGE_VERSION = '59585ae75aafa8c5e2666b047a84f13ab35fb59f';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-08-06 21:18:42';
public const RELEASE_DATE = '2024-08-07 08:05:18';
/**
* @var int
*/
Expand Down
4 changes: 0 additions & 4 deletions src/NodeTypeResolver/Node/AttributeKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,6 @@ final class AttributeKey
* @var string
*/
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 @@ -58,7 +58,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 @@ -137,7 +136,6 @@ public function processNodes(array $stmts, string $filePath, ?MutatingScope $for
Assert::allIsInstanceOf($stmts, Stmt::class);
$this->nodeTraverser->traverse($stmts);
$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, $filePath, &$hasUnreachableStatementNode) : void {
// the class reflection is resolved AFTER entering to class node
Expand Down Expand Up @@ -257,7 +255,6 @@ public function processNodes(array $stmts, string $filePath, ?MutatingScope $for
$this->nodeScopeResolverProcessNodes($stmts, $scope, $nodeCallback);
$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
79 changes: 0 additions & 79 deletions src/PHPStan/NodeVisitor/ExprScopeFromStmtNodeVisitor.php

This file was deleted.

2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInite9e62f8370526a5f08ea47a490713455::getLoader();
return ComposerAutoloaderInit4bcaef4da4b0314c67dae59e30837b25::getLoader();
10 changes: 9 additions & 1 deletion vendor/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,15 @@
'RectorPrefix202408\\Fidry\\CpuCoreCounter\\Finder\\WmicPhysicalFinder' => $vendorDir . '/fidry/cpu-core-counter/src/Finder/WmicPhysicalFinder.php',
'RectorPrefix202408\\Fidry\\CpuCoreCounter\\Finder\\_NProcessorFinder' => $vendorDir . '/fidry/cpu-core-counter/src/Finder/_NProcessorFinder.php',
'RectorPrefix202408\\Fidry\\CpuCoreCounter\\NumberOfCpuCoreNotFound' => $vendorDir . '/fidry/cpu-core-counter/src/NumberOfCpuCoreNotFound.php',
'RectorPrefix202408\\Illuminate\\Container\\Attributes\\Auth' => $vendorDir . '/illuminate/container/Attributes/Auth.php',
'RectorPrefix202408\\Illuminate\\Container\\Attributes\\Authenticated' => $vendorDir . '/illuminate/container/Attributes/Authenticated.php',
'RectorPrefix202408\\Illuminate\\Container\\Attributes\\Cache' => $vendorDir . '/illuminate/container/Attributes/Cache.php',
'RectorPrefix202408\\Illuminate\\Container\\Attributes\\Config' => $vendorDir . '/illuminate/container/Attributes/Config.php',
'RectorPrefix202408\\Illuminate\\Container\\Attributes\\CurrentUser' => $vendorDir . '/illuminate/container/Attributes/CurrentUser.php',
'RectorPrefix202408\\Illuminate\\Container\\Attributes\\DB' => $vendorDir . '/illuminate/container/Attributes/DB.php',
'RectorPrefix202408\\Illuminate\\Container\\Attributes\\Database' => $vendorDir . '/illuminate/container/Attributes/Database.php',
'RectorPrefix202408\\Illuminate\\Container\\Attributes\\Log' => $vendorDir . '/illuminate/container/Attributes/Log.php',
'RectorPrefix202408\\Illuminate\\Container\\Attributes\\Storage' => $vendorDir . '/illuminate/container/Attributes/Storage.php',
'RectorPrefix202408\\Illuminate\\Container\\BoundMethod' => $vendorDir . '/illuminate/container/BoundMethod.php',
'RectorPrefix202408\\Illuminate\\Container\\Container' => $vendorDir . '/illuminate/container/Container.php',
'RectorPrefix202408\\Illuminate\\Container\\ContextualBindingBuilder' => $vendorDir . '/illuminate/container/ContextualBindingBuilder.php',
Expand Down Expand Up @@ -506,6 +514,7 @@
'RectorPrefix202408\\Illuminate\\Contracts\\Database\\Query\\ConditionExpression' => $vendorDir . '/illuminate/contracts/Database/Query/ConditionExpression.php',
'RectorPrefix202408\\Illuminate\\Contracts\\Database\\Query\\Expression' => $vendorDir . '/illuminate/contracts/Database/Query/Expression.php',
'RectorPrefix202408\\Illuminate\\Contracts\\Debug\\ExceptionHandler' => $vendorDir . '/illuminate/contracts/Debug/ExceptionHandler.php',
'RectorPrefix202408\\Illuminate\\Contracts\\Debug\\ShouldntReport' => $vendorDir . '/illuminate/contracts/Debug/ShouldntReport.php',
'RectorPrefix202408\\Illuminate\\Contracts\\Encryption\\DecryptException' => $vendorDir . '/illuminate/contracts/Encryption/DecryptException.php',
'RectorPrefix202408\\Illuminate\\Contracts\\Encryption\\EncryptException' => $vendorDir . '/illuminate/contracts/Encryption/EncryptException.php',
'RectorPrefix202408\\Illuminate\\Contracts\\Encryption\\Encrypter' => $vendorDir . '/illuminate/contracts/Encryption/Encrypter.php',
Expand Down Expand Up @@ -1722,7 +1731,6 @@
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\UnionTypeMapper' => $baseDir . '/src/PHPStanStaticTypeMapper/TypeMapper/UnionTypeMapper.php',
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\VoidTypeMapper' => $baseDir . '/src/PHPStanStaticTypeMapper/TypeMapper/VoidTypeMapper.php',
'Rector\\PHPStanStaticTypeMapper\\Utils\\TypeUnwrapper' => $baseDir . '/src/PHPStanStaticTypeMapper/Utils/TypeUnwrapper.php',
'Rector\\PHPStan\\NodeVisitor\\ExprScopeFromStmtNodeVisitor' => $baseDir . '/src/PHPStan/NodeVisitor/ExprScopeFromStmtNodeVisitor.php',
'Rector\\PHPStan\\NodeVisitor\\UnreachableStatementNodeVisitor' => $baseDir . '/src/PHPStan/NodeVisitor/UnreachableStatementNodeVisitor.php',
'Rector\\PHPStan\\NodeVisitor\\WrappedNodeRestoringNodeVisitor' => $baseDir . '/src/PHPStan/NodeVisitor/WrappedNodeRestoringNodeVisitor.php',
'Rector\\PHPUnit\\AnnotationsToAttributes\\Rector\\ClassMethod\\DataProviderAnnotationToAttributeRector' => $vendorDir . '/rector/rector-phpunit/rules/AnnotationsToAttributes/Rector/ClassMethod/DataProviderAnnotationToAttributeRector.php',
Expand Down
10 changes: 5 additions & 5 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInite9e62f8370526a5f08ea47a490713455
class ComposerAutoloaderInit4bcaef4da4b0314c67dae59e30837b25
{
private static $loader;

Expand All @@ -22,17 +22,17 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInite9e62f8370526a5f08ea47a490713455', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit4bcaef4da4b0314c67dae59e30837b25', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInite9e62f8370526a5f08ea47a490713455', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit4bcaef4da4b0314c67dae59e30837b25', 'loadClassLoader'));

require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInite9e62f8370526a5f08ea47a490713455::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit4bcaef4da4b0314c67dae59e30837b25::getInitializer($loader));

$loader->setClassMapAuthoritative(true);
$loader->register(true);

$filesToLoad = \Composer\Autoload\ComposerStaticInite9e62f8370526a5f08ea47a490713455::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit4bcaef4da4b0314c67dae59e30837b25::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
Expand Down
18 changes: 13 additions & 5 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInite9e62f8370526a5f08ea47a490713455
class ComposerStaticInit4bcaef4da4b0314c67dae59e30837b25
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
Expand Down Expand Up @@ -666,7 +666,15 @@ class ComposerStaticInite9e62f8370526a5f08ea47a490713455
'RectorPrefix202408\\Fidry\\CpuCoreCounter\\Finder\\WmicPhysicalFinder' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Finder/WmicPhysicalFinder.php',
'RectorPrefix202408\\Fidry\\CpuCoreCounter\\Finder\\_NProcessorFinder' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Finder/_NProcessorFinder.php',
'RectorPrefix202408\\Fidry\\CpuCoreCounter\\NumberOfCpuCoreNotFound' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/NumberOfCpuCoreNotFound.php',
'RectorPrefix202408\\Illuminate\\Container\\Attributes\\Auth' => __DIR__ . '/..' . '/illuminate/container/Attributes/Auth.php',
'RectorPrefix202408\\Illuminate\\Container\\Attributes\\Authenticated' => __DIR__ . '/..' . '/illuminate/container/Attributes/Authenticated.php',
'RectorPrefix202408\\Illuminate\\Container\\Attributes\\Cache' => __DIR__ . '/..' . '/illuminate/container/Attributes/Cache.php',
'RectorPrefix202408\\Illuminate\\Container\\Attributes\\Config' => __DIR__ . '/..' . '/illuminate/container/Attributes/Config.php',
'RectorPrefix202408\\Illuminate\\Container\\Attributes\\CurrentUser' => __DIR__ . '/..' . '/illuminate/container/Attributes/CurrentUser.php',
'RectorPrefix202408\\Illuminate\\Container\\Attributes\\DB' => __DIR__ . '/..' . '/illuminate/container/Attributes/DB.php',
'RectorPrefix202408\\Illuminate\\Container\\Attributes\\Database' => __DIR__ . '/..' . '/illuminate/container/Attributes/Database.php',
'RectorPrefix202408\\Illuminate\\Container\\Attributes\\Log' => __DIR__ . '/..' . '/illuminate/container/Attributes/Log.php',
'RectorPrefix202408\\Illuminate\\Container\\Attributes\\Storage' => __DIR__ . '/..' . '/illuminate/container/Attributes/Storage.php',
'RectorPrefix202408\\Illuminate\\Container\\BoundMethod' => __DIR__ . '/..' . '/illuminate/container/BoundMethod.php',
'RectorPrefix202408\\Illuminate\\Container\\Container' => __DIR__ . '/..' . '/illuminate/container/Container.php',
'RectorPrefix202408\\Illuminate\\Container\\ContextualBindingBuilder' => __DIR__ . '/..' . '/illuminate/container/ContextualBindingBuilder.php',
Expand Down Expand Up @@ -725,6 +733,7 @@ class ComposerStaticInite9e62f8370526a5f08ea47a490713455
'RectorPrefix202408\\Illuminate\\Contracts\\Database\\Query\\ConditionExpression' => __DIR__ . '/..' . '/illuminate/contracts/Database/Query/ConditionExpression.php',
'RectorPrefix202408\\Illuminate\\Contracts\\Database\\Query\\Expression' => __DIR__ . '/..' . '/illuminate/contracts/Database/Query/Expression.php',
'RectorPrefix202408\\Illuminate\\Contracts\\Debug\\ExceptionHandler' => __DIR__ . '/..' . '/illuminate/contracts/Debug/ExceptionHandler.php',
'RectorPrefix202408\\Illuminate\\Contracts\\Debug\\ShouldntReport' => __DIR__ . '/..' . '/illuminate/contracts/Debug/ShouldntReport.php',
'RectorPrefix202408\\Illuminate\\Contracts\\Encryption\\DecryptException' => __DIR__ . '/..' . '/illuminate/contracts/Encryption/DecryptException.php',
'RectorPrefix202408\\Illuminate\\Contracts\\Encryption\\EncryptException' => __DIR__ . '/..' . '/illuminate/contracts/Encryption/EncryptException.php',
'RectorPrefix202408\\Illuminate\\Contracts\\Encryption\\Encrypter' => __DIR__ . '/..' . '/illuminate/contracts/Encryption/Encrypter.php',
Expand Down Expand Up @@ -1941,7 +1950,6 @@ class ComposerStaticInite9e62f8370526a5f08ea47a490713455
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\UnionTypeMapper' => __DIR__ . '/../..' . '/src/PHPStanStaticTypeMapper/TypeMapper/UnionTypeMapper.php',
'Rector\\PHPStanStaticTypeMapper\\TypeMapper\\VoidTypeMapper' => __DIR__ . '/../..' . '/src/PHPStanStaticTypeMapper/TypeMapper/VoidTypeMapper.php',
'Rector\\PHPStanStaticTypeMapper\\Utils\\TypeUnwrapper' => __DIR__ . '/../..' . '/src/PHPStanStaticTypeMapper/Utils/TypeUnwrapper.php',
'Rector\\PHPStan\\NodeVisitor\\ExprScopeFromStmtNodeVisitor' => __DIR__ . '/../..' . '/src/PHPStan/NodeVisitor/ExprScopeFromStmtNodeVisitor.php',
'Rector\\PHPStan\\NodeVisitor\\UnreachableStatementNodeVisitor' => __DIR__ . '/../..' . '/src/PHPStan/NodeVisitor/UnreachableStatementNodeVisitor.php',
'Rector\\PHPStan\\NodeVisitor\\WrappedNodeRestoringNodeVisitor' => __DIR__ . '/../..' . '/src/PHPStan/NodeVisitor/WrappedNodeRestoringNodeVisitor.php',
'Rector\\PHPUnit\\AnnotationsToAttributes\\Rector\\ClassMethod\\DataProviderAnnotationToAttributeRector' => __DIR__ . '/..' . '/rector/rector-phpunit/rules/AnnotationsToAttributes/Rector/ClassMethod/DataProviderAnnotationToAttributeRector.php',
Expand Down Expand Up @@ -2789,9 +2797,9 @@ class ComposerStaticInite9e62f8370526a5f08ea47a490713455
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInite9e62f8370526a5f08ea47a490713455::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInite9e62f8370526a5f08ea47a490713455::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInite9e62f8370526a5f08ea47a490713455::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit4bcaef4da4b0314c67dae59e30837b25::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit4bcaef4da4b0314c67dae59e30837b25::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit4bcaef4da4b0314c67dae59e30837b25::$classMap;

}, null, ClassLoader::class);
}
Expand Down
24 changes: 12 additions & 12 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -512,17 +512,17 @@
},
{
"name": "illuminate\/container",
"version": "v11.19.0",
"version_normalized": "11.19.0.0",
"version": "v11.20.0",
"version_normalized": "11.20.0.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/illuminate\/container.git",
"reference": "122c62229b209678013c0833793d7cf94d14bbbd"
"reference": "f47be671981a4438257c4fbfc3ad257f4e3e929a"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/illuminate\/container\/zipball\/122c62229b209678013c0833793d7cf94d14bbbd",
"reference": "122c62229b209678013c0833793d7cf94d14bbbd",
"url": "https:\/\/api.github.com\/repos\/illuminate\/container\/zipball\/f47be671981a4438257c4fbfc3ad257f4e3e929a",
"reference": "f47be671981a4438257c4fbfc3ad257f4e3e929a",
"shasum": ""
},
"require": {
Expand All @@ -533,7 +533,7 @@
"provide": {
"psr\/container-implementation": "1.1|2.0"
},
"time": "2024-07-26T06:12:27+00:00",
"time": "2024-08-05T15:04:01+00:00",
"type": "library",
"extra": {
"branch-alias": {
Expand Down Expand Up @@ -569,25 +569,25 @@
},
{
"name": "illuminate\/contracts",
"version": "v11.19.0",
"version_normalized": "11.19.0.0",
"version": "v11.20.0",
"version_normalized": "11.20.0.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/illuminate\/contracts.git",
"reference": "ebe2b8d69b8fb1c07111e3500d464e77dfab3202"
"reference": "34ead9385e0eab7e947807d77da66faf9bdf95ff"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/illuminate\/contracts\/zipball\/ebe2b8d69b8fb1c07111e3500d464e77dfab3202",
"reference": "ebe2b8d69b8fb1c07111e3500d464e77dfab3202",
"url": "https:\/\/api.github.com\/repos\/illuminate\/contracts\/zipball\/34ead9385e0eab7e947807d77da66faf9bdf95ff",
"reference": "34ead9385e0eab7e947807d77da66faf9bdf95ff",
"shasum": ""
},
"require": {
"php": "^8.2",
"psr\/container": "^1.1.1|^2.0.1",
"psr\/simple-cache": "^1.0|^2.0|^3.0"
},
"time": "2024-07-29T06:48:51+00:00",
"time": "2024-08-01T19:08:33+00:00",
"type": "library",
"extra": {
"branch-alias": {
Expand Down
Loading

0 comments on commit cbfdee3

Please sign in to comment.