Updated Rector to commit 4ef31e92b88053cf22ca1f379fc92ecc3d45f371

4ef31e92b8 Remove deprecated TemplateResolverInterface, RectorServiceConfigurator (#3351)
This commit is contained in:
Tomas Votruba 2023-02-06 19:28:33 +00:00
parent f923fd0998
commit baf4489760
8 changed files with 34 additions and 79 deletions

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '43dd2efc5d663bc16327911fe31c6f6ecf60e753';
public const PACKAGE_VERSION = '4ef31e92b88053cf22ca1f379fc92ecc3d45f371';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-02-06 19:19:06';
public const RELEASE_DATE = '2023-02-06 19:24:14';
/**
* @var int
*/

View File

@ -16,7 +16,7 @@ final class Option
*/
public const AUTOLOAD_FILE = 'autoload-file';
/**
* @deprecated Use @see \Rector\Config\RectorConfig::bootstrapFiles() instead
* @internal Use @see \Rector\Config\RectorConfig::bootstrapFiles() instead
* @var string
*/
public const BOOTSTRAP_FILES = 'bootstrap_files';
@ -37,32 +37,32 @@ final class Option
*/
public const NO_PROGRESS_BAR = 'no-progress-bar';
/**
* @deprecated Use @see \Rector\Config\RectorConfig::phpVersion() instead
* @internal Use @see \Rector\Config\RectorConfig::phpVersion() instead
* @var string
*/
public const PHP_VERSION_FEATURES = 'php_version_features';
/**
* @deprecated Use @see \Rector\Config\RectorConfig::importNames() instead
* @internal Use @see \Rector\Config\RectorConfig::importNames() instead
* @var string
*/
public const AUTO_IMPORT_NAMES = 'auto_import_names';
/**
* @deprecated Use @see \Rector\Config\RectorConfig::importNames() instead
* @internal Use @see \Rector\Config\RectorConfig::importNames() instead
* @var string
*/
public const AUTO_IMPORT_DOC_BLOCK_NAMES = 'auto_import_doc_block_names';
/**
* @deprecated Use @see \Rector\Config\RectorConfig::importShortClasses() instead
* @internal Use @see \Rector\Config\RectorConfig::importShortClasses() instead
* @var string
*/
public const IMPORT_SHORT_CLASSES = 'import_short_classes';
/**
* @deprecated Use @see \Rector\Config\RectorConfig::symfonyContainerXml() instead
* @internal Use @see \Rector\Config\RectorConfig::symfonyContainerXml() instead
* @var string
*/
public const SYMFONY_CONTAINER_XML_PATH_PARAMETER = 'symfony_container_xml_path';
/**
* @deprecated Use @see \Rector\Config\RectorConfig::symfonyContainerPhp()
* @internal Use @see \Rector\Config\RectorConfig::symfonyContainerPhp()
* @var string
*/
public const SYMFONY_CONTAINER_PHP_PATH_PARAMETER = 'symfony_container_php_path';
@ -71,43 +71,43 @@ final class Option
*/
public const CLEAR_CACHE = 'clear-cache';
/**
* @deprecated Use @see \Rector\Config\RectorConfig::parallel() instead
* @internal Use @see \Rector\Config\RectorConfig::parallel() instead
* @var string
*/
public const PARALLEL = 'parallel';
/**
* @deprecated Use @see \Rector\Config\RectorConfig::paths() instead
* @internal Use @see \Rector\Config\RectorConfig::paths() instead
* @var string
*/
public const PATHS = 'paths';
/**
* @deprecated Use @see \Rector\Config\RectorConfig::autoloadPaths() instead
* @internal Use @see \Rector\Config\RectorConfig::autoloadPaths() instead
* @var string
*/
public const AUTOLOAD_PATHS = 'autoload_paths';
/**
* @deprecated Use @see \Rector\Config\RectorConfig::skip() instead
* @internal Use @see \Rector\Config\RectorConfig::skip() instead
* @var string
*/
public const SKIP = 'skip';
/**
* @deprecated Use RectorConfig::fileExtensions() instead
* @internal Use RectorConfig::fileExtensions() instead
* @var string
*/
public const FILE_EXTENSIONS = 'file_extensions';
/**
* @deprecated Use RectorConfig::nestedChainMethodCallLimit() instead
* @internal Use RectorConfig::nestedChainMethodCallLimit() instead
* @var string
*/
public const NESTED_CHAIN_METHOD_CALL_LIMIT = 'nested_chain_method_call_limit';
/**
* @deprecated Use RectorConfig::cacheDirectory() instead
* @internal Use RectorConfig::cacheDirectory() instead
* @var string
*/
public const CACHE_DIR = 'cache_dir';
/**
* Cache backend. Most of the time we cache in files, but in ephemeral environment (e.g. CI), a faster `MemoryCacheStorage` can be usefull.
* @deprecated Use RectorConfig::cacheClass() instead
* @internal Use RectorConfig::cacheClass() instead
*
* @var class-string<CacheStorageInterface>
* @internal
@ -126,7 +126,7 @@ final class Option
*/
public const CONFIG = 'config';
/**
* @deprecated Use @see \Rector\Config\RectorConfig::phpstanConfig() instead
* @internal Use @see \Rector\Config\RectorConfig::phpstanConfig() instead
* @var string
*/
public const PHPSTAN_FOR_RECTOR_PATH = 'phpstan_for_rector_path';
@ -147,17 +147,17 @@ final class Option
*/
public const PARALLEL_PORT = 'port';
/**
* @deprecated Use @see \Rector\Config\RectorConfig::parallel() instead with pass int $jobSize parameter
* @internal Use @see \Rector\Config\RectorConfig::parallel() instead with pass int $jobSize parameter
* @var string
*/
public const PARALLEL_JOB_SIZE = 'parallel-job-size';
/**
* @deprecated Use @see \Rector\Config\RectorConfig::parallel() instead with pass int $maxNumberOfProcess parameter
* @internal Use @see \Rector\Config\RectorConfig::parallel() instead with pass int $maxNumberOfProcess parameter
* @var string
*/
public const PARALLEL_MAX_NUMBER_OF_PROCESSES = 'parallel-max-number-of-processes';
/**
* @deprecated Use @see \Rector\Config\RectorConfig::parallel() instead with pass int $seconds parameter
* @internal Use @see \Rector\Config\RectorConfig::parallel() instead with pass int $seconds parameter
* @var string
*/
public const PARALLEL_TIMEOUT_IN_SECONDS = 'parallel-timeout-in-seconds';
@ -166,12 +166,12 @@ final class Option
*/
public const MEMORY_LIMIT = 'memory-limit';
/**
* @deprecated Use @see \Rector\Config\RectorConfig::indent() method
* @internal Use @see \Rector\Config\RectorConfig::indent() method
* @var string
*/
public const INDENT_CHAR = 'indent-char';
/**
* @deprecated Use @see \Rector\Config\RectorConfig::indent() method
* @internal Use @see \Rector\Config\RectorConfig::indent() method
* @var string
*/
public const INDENT_SIZE = 'indent-size';

View File

@ -1,13 +0,0 @@
<?php
declare (strict_types=1);
namespace Rector\Core\Contract\Template;
/**
* @deprecated This know-how should be mentioned in framework-specific documentation of the package instead.
*/
interface TemplateResolverInterface
{
public function provide() : string;
public function supports(string $type) : bool;
}

View File

@ -3,41 +3,11 @@
declare (strict_types=1);
namespace Rector\Core\DependencyInjection\Loader\Configurator;
use Rector\Core\Configuration\ValueObjectInliner;
use Rector\Core\Contract\Rector\ConfigurableRectorInterface;
use RectorPrefix202302\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
use RectorPrefix202302\Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator;
/**
* @api
* Same as Symfony service configurator, with extra "configure()" method for easier DX
* Same as Symfony service configurator
*/
final class RectorServiceConfigurator extends ServiceConfigurator
{
/**
* @deprecated Use @see \Rector\Config\RectorConfig instead
* @param mixed[] $configuration
*/
public function configure(array $configuration) : self
{
$this->ensureClassIsConfigurable($this->id);
// decorate with value object inliner so Symfony understands, see https://getrector.org/blog/2020/09/07/how-to-inline-value-object-in-symfony-php-config
\array_walk_recursive($configuration, static function (&$value) {
if (\is_object($value)) {
$value = ValueObjectInliner::inline($value);
}
return $value;
});
$this->call('configure', [$configuration]);
return $this;
}
private function ensureClassIsConfigurable(?string $class) : void
{
if ($class === null) {
throw new InvalidConfigurationException('The class is missing');
}
if (!\is_a($class, ConfigurableRectorInterface::class, \true)) {
$errorMessage = \sprintf('The service "%s" is not configurable. Make it implement "%s" or remove "configure()" call.', $class, ConfigurableRectorInterface::class);
throw new InvalidConfigurationException($errorMessage);
}
}
}

2
vendor/autoload.php vendored
View File

@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit0981c60dbbbe9cbbd670a2dacb4bcce4::getLoader();
return ComposerAutoloaderInit9fea5958f2b1662b9650f5dfbb2db631::getLoader();

View File

@ -1381,7 +1381,6 @@ return array(
'Rector\\Core\\Contract\\Rector\\PhpRectorInterface' => $baseDir . '/src/Contract/Rector/PhpRectorInterface.php',
'Rector\\Core\\Contract\\Rector\\RectorInterface' => $baseDir . '/src/Contract/Rector/RectorInterface.php',
'Rector\\Core\\Contract\\Rector\\ScopeAwarePhpRectorInterface' => $baseDir . '/src/Contract/Rector/ScopeAwarePhpRectorInterface.php',
'Rector\\Core\\Contract\\Template\\TemplateResolverInterface' => $baseDir . '/src/Contract/Template/TemplateResolverInterface.php',
'Rector\\Core\\DependencyInjection\\Collector\\ConfigureCallValuesCollector' => $baseDir . '/src/DependencyInjection/Collector/ConfigureCallValuesCollector.php',
'Rector\\Core\\DependencyInjection\\CompilerPass\\AutowireArrayParameterCompilerPass' => $baseDir . '/src/DependencyInjection/CompilerPass/AutowireArrayParameterCompilerPass.php',
'Rector\\Core\\DependencyInjection\\CompilerPass\\AutowireRectorCompilerPass' => $baseDir . '/src/DependencyInjection/CompilerPass/AutowireRectorCompilerPass.php',

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit0981c60dbbbe9cbbd670a2dacb4bcce4
class ComposerAutoloaderInit9fea5958f2b1662b9650f5dfbb2db631
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInit0981c60dbbbe9cbbd670a2dacb4bcce4
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit0981c60dbbbe9cbbd670a2dacb4bcce4', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit9fea5958f2b1662b9650f5dfbb2db631', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit0981c60dbbbe9cbbd670a2dacb4bcce4', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit9fea5958f2b1662b9650f5dfbb2db631', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit0981c60dbbbe9cbbd670a2dacb4bcce4::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit9fea5958f2b1662b9650f5dfbb2db631::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInit0981c60dbbbe9cbbd670a2dacb4bcce4::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit9fea5958f2b1662b9650f5dfbb2db631::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit0981c60dbbbe9cbbd670a2dacb4bcce4
class ComposerStaticInit9fea5958f2b1662b9650f5dfbb2db631
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -1626,7 +1626,6 @@ class ComposerStaticInit0981c60dbbbe9cbbd670a2dacb4bcce4
'Rector\\Core\\Contract\\Rector\\PhpRectorInterface' => __DIR__ . '/../..' . '/src/Contract/Rector/PhpRectorInterface.php',
'Rector\\Core\\Contract\\Rector\\RectorInterface' => __DIR__ . '/../..' . '/src/Contract/Rector/RectorInterface.php',
'Rector\\Core\\Contract\\Rector\\ScopeAwarePhpRectorInterface' => __DIR__ . '/../..' . '/src/Contract/Rector/ScopeAwarePhpRectorInterface.php',
'Rector\\Core\\Contract\\Template\\TemplateResolverInterface' => __DIR__ . '/../..' . '/src/Contract/Template/TemplateResolverInterface.php',
'Rector\\Core\\DependencyInjection\\Collector\\ConfigureCallValuesCollector' => __DIR__ . '/../..' . '/src/DependencyInjection/Collector/ConfigureCallValuesCollector.php',
'Rector\\Core\\DependencyInjection\\CompilerPass\\AutowireArrayParameterCompilerPass' => __DIR__ . '/../..' . '/src/DependencyInjection/CompilerPass/AutowireArrayParameterCompilerPass.php',
'Rector\\Core\\DependencyInjection\\CompilerPass\\AutowireRectorCompilerPass' => __DIR__ . '/../..' . '/src/DependencyInjection/CompilerPass/AutowireRectorCompilerPass.php',
@ -3081,9 +3080,9 @@ class ComposerStaticInit0981c60dbbbe9cbbd670a2dacb4bcce4
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit0981c60dbbbe9cbbd670a2dacb4bcce4::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit0981c60dbbbe9cbbd670a2dacb4bcce4::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit0981c60dbbbe9cbbd670a2dacb4bcce4::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit9fea5958f2b1662b9650f5dfbb2db631::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit9fea5958f2b1662b9650f5dfbb2db631::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit9fea5958f2b1662b9650f5dfbb2db631::$classMap;
}, null, ClassLoader::class);
}