Skip to content

Commit

Permalink
Updated Rector to commit 2fe68ad7649faf0ebec883dcdeb91ee6118297ce
Browse files Browse the repository at this point in the history
rectorphp/rector-src@2fe68ad [DI] Add resetable interface to reset services on new DI run (#4790)
  • Loading branch information
TomasVotruba committed Aug 14, 2023
1 parent 846609a commit 8216388
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
use PHPStan\Reflection\BetterReflection\SourceLocator\FileNodesFetcher;
use PHPStan\Reflection\BetterReflection\SourceLocator\OptimizedDirectorySourceLocator;
use PHPStan\Reflection\BetterReflection\SourceLocator\OptimizedSingleFileSourceLocator;
use Rector\Core\Contract\DependencyInjection\ResetableInterface;
use Rector\Testing\PHPUnit\StaticPHPUnitEnvironment;
use RectorPrefix202308\Webmozart\Assert\Assert;
/**
* @api phpstan external
*/
final class DynamicSourceLocatorProvider
final class DynamicSourceLocatorProvider implements ResetableInterface
{
/**
* @readonly
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 = '98b203a5d9caa1aacb75bb22a45617f228c3516a';
public const PACKAGE_VERSION = '2fe68ad7649faf0ebec883dcdeb91ee6118297ce';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-08-14 10:09:07';
public const RELEASE_DATE = '2023-08-14 13:42:14';
/**
* @var int
*/
Expand Down
7 changes: 6 additions & 1 deletion src/Configuration/RenamedClassesDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
namespace Rector\Core\Configuration;

use PHPStan\Type\ObjectType;
final class RenamedClassesDataCollector
use Rector\Core\Contract\DependencyInjection\ResetableInterface;
final class RenamedClassesDataCollector implements ResetableInterface
{
/**
* @var array<string, string>
Expand Down Expand Up @@ -46,4 +47,8 @@ public function getOldClasses() : array
{
return \array_keys($this->oldToNewClasses);
}
public function reset() : void
{
$this->oldToNewClasses = [];
}
}
9 changes: 9 additions & 0 deletions src/Contract/DependencyInjection/ResetableInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare (strict_types=1);
namespace Rector\Core\Contract\DependencyInjection;

interface ResetableInterface
{
public function reset() : void;
}
5 changes: 5 additions & 0 deletions src/DependencyInjection/LazyContainerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
use Rector\Core\Application\FileProcessor\PhpFileProcessor;
use Rector\Core\Configuration\ConfigInitializer;
use Rector\Core\Configuration\CurrentNodeProvider;
use Rector\Core\Configuration\RenamedClassesDataCollector;
use Rector\Core\Console\Command\ListRulesCommand;
use Rector\Core\Console\Command\ProcessCommand;
use Rector\Core\Console\Command\SetupCICommand;
Expand All @@ -55,6 +56,7 @@
use Rector\Core\Console\Output\OutputFormatterCollector;
use Rector\Core\Console\Style\RectorStyle;
use Rector\Core\Console\Style\SymfonyStyleFactory;
use Rector\Core\Contract\DependencyInjection\ResetableInterface;
use Rector\Core\Contract\Processor\FileProcessorInterface;
use Rector\Core\Contract\Rector\PhpRectorInterface;
use Rector\Core\Contract\Rector\RectorInterface;
Expand Down Expand Up @@ -292,6 +294,9 @@ public function create() : LazyRectorConfig
$phpStanServicesFactory = $container->make(PHPStanServicesFactory::class);
return $phpStanServicesFactory->createDynamicSourceLocatorProvider();
});
// resetables
$lazyRectorConfig->tag(DynamicSourceLocatorProvider::class, ResetableInterface::class);
$lazyRectorConfig->tag(RenamedClassesDataCollector::class, ResetableInterface::class);
// caching
$lazyRectorConfig->singleton(Cache::class, static function (Container $container) : Cache {
/** @var CacheFactory $cacheFactory */
Expand Down
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 ComposerAutoloaderInit2730a0a44b463269d6ca3be1f5a2a0f8::getLoader();
return ComposerAutoloaderInitef003b203866411843a8ebe2ebc6e04a::getLoader();
1 change: 1 addition & 0 deletions vendor/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -1486,6 +1486,7 @@
'Rector\\Core\\Console\\ProcessConfigureDecorator' => $baseDir . '/src/Console/ProcessConfigureDecorator.php',
'Rector\\Core\\Console\\Style\\RectorStyle' => $baseDir . '/src/Console/Style/RectorStyle.php',
'Rector\\Core\\Console\\Style\\SymfonyStyleFactory' => $baseDir . '/src/Console/Style/SymfonyStyleFactory.php',
'Rector\\Core\\Contract\\DependencyInjection\\ResetableInterface' => $baseDir . '/src/Contract/DependencyInjection/ResetableInterface.php',
'Rector\\Core\\Contract\\PHPStan\\Reflection\\TypeToCallReflectionResolver\\TypeToCallReflectionResolverInterface' => $baseDir . '/src/Contract/PHPStan/Reflection/TypeToCallReflectionResolver/TypeToCallReflectionResolverInterface.php',
'Rector\\Core\\Contract\\PhpParser\\Node\\StmtsAwareInterface' => $baseDir . '/src/Contract/PhpParser/Node/StmtsAwareInterface.php',
'Rector\\Core\\Contract\\Processor\\FileProcessorInterface' => $baseDir . '/src/Contract/Processor/FileProcessorInterface.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 ComposerAutoloaderInit2730a0a44b463269d6ca3be1f5a2a0f8
class ComposerAutoloaderInitef003b203866411843a8ebe2ebc6e04a
{
private static $loader;

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

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

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

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

$filesToLoad = \Composer\Autoload\ComposerStaticInit2730a0a44b463269d6ca3be1f5a2a0f8::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInitef003b203866411843a8ebe2ebc6e04a::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
Expand Down
9 changes: 5 additions & 4 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 ComposerStaticInit2730a0a44b463269d6ca3be1f5a2a0f8
class ComposerStaticInitef003b203866411843a8ebe2ebc6e04a
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
Expand Down Expand Up @@ -1739,6 +1739,7 @@ class ComposerStaticInit2730a0a44b463269d6ca3be1f5a2a0f8
'Rector\\Core\\Console\\ProcessConfigureDecorator' => __DIR__ . '/../..' . '/src/Console/ProcessConfigureDecorator.php',
'Rector\\Core\\Console\\Style\\RectorStyle' => __DIR__ . '/../..' . '/src/Console/Style/RectorStyle.php',
'Rector\\Core\\Console\\Style\\SymfonyStyleFactory' => __DIR__ . '/../..' . '/src/Console/Style/SymfonyStyleFactory.php',
'Rector\\Core\\Contract\\DependencyInjection\\ResetableInterface' => __DIR__ . '/../..' . '/src/Contract/DependencyInjection/ResetableInterface.php',
'Rector\\Core\\Contract\\PHPStan\\Reflection\\TypeToCallReflectionResolver\\TypeToCallReflectionResolverInterface' => __DIR__ . '/../..' . '/src/Contract/PHPStan/Reflection/TypeToCallReflectionResolver/TypeToCallReflectionResolverInterface.php',
'Rector\\Core\\Contract\\PhpParser\\Node\\StmtsAwareInterface' => __DIR__ . '/../..' . '/src/Contract/PhpParser/Node/StmtsAwareInterface.php',
'Rector\\Core\\Contract\\Processor\\FileProcessorInterface' => __DIR__ . '/../..' . '/src/Contract/Processor/FileProcessorInterface.php',
Expand Down Expand Up @@ -2958,9 +2959,9 @@ class ComposerStaticInit2730a0a44b463269d6ca3be1f5a2a0f8
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit2730a0a44b463269d6ca3be1f5a2a0f8::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit2730a0a44b463269d6ca3be1f5a2a0f8::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit2730a0a44b463269d6ca3be1f5a2a0f8::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitef003b203866411843a8ebe2ebc6e04a::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitef003b203866411843a8ebe2ebc6e04a::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitef003b203866411843a8ebe2ebc6e04a::$classMap;

}, null, ClassLoader::class);
}
Expand Down
12 changes: 6 additions & 6 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -908,17 +908,17 @@
},
{
"name": "phpstan\/phpstan",
"version": "1.10.28",
"version_normalized": "1.10.28.0",
"version": "1.10.29",
"version_normalized": "1.10.29.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/phpstan\/phpstan.git",
"reference": "e4545b55904ebef470423d3ddddb74fa7325497a"
"reference": "ee5d8f2d3977fb09e55603eee6fb53bdd76ee9c1"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpstan\/zipball\/e4545b55904ebef470423d3ddddb74fa7325497a",
"reference": "e4545b55904ebef470423d3ddddb74fa7325497a",
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpstan\/zipball\/ee5d8f2d3977fb09e55603eee6fb53bdd76ee9c1",
"reference": "ee5d8f2d3977fb09e55603eee6fb53bdd76ee9c1",
"shasum": ""
},
"require": {
Expand All @@ -927,7 +927,7 @@
"conflict": {
"phpstan\/phpstan-shim": "*"
},
"time": "2023-08-08T12:33:42+00:00",
"time": "2023-08-14T13:24:11+00:00",
"bin": [
"phpstan",
"phpstan.phar"
Expand Down
Loading

0 comments on commit 8216388

Please sign in to comment.