Updated Rector to commit feffd813a316ea0d9f1e0dd6ba45b90b88ae72c3

feffd813a3 [DX] Hide default symfony commands, show only rector ones (#4938)
This commit is contained in:
Tomas Votruba 2023-09-08 13:46:57 +00:00
parent df5f31835a
commit e844be2688
7 changed files with 22 additions and 33 deletions

View File

@ -7,11 +7,11 @@ use RectorPrefix202309\Nette\Utils\Json;
use Rector\ChangesReporting\Output\JsonOutputFormatter;
use Rector\Core\Bootstrap\RectorConfigsResolver;
use Rector\Core\Configuration\Option;
use Rector\Core\Console\ConsoleApplication;
use Rector\Core\Console\Style\SymfonyStyleFactory;
use Rector\Core\DependencyInjection\LazyContainerFactory;
use Rector\Core\DependencyInjection\RectorContainerFactory;
use Rector\Core\Util\Reflection\PrivatesAccessor;
use RectorPrefix202309\Symfony\Component\Console\Application;
use RectorPrefix202309\Symfony\Component\Console\Command\Command;
use RectorPrefix202309\Symfony\Component\Console\Input\ArgvInput;
// @ intentionally: continue anyway
@ -127,6 +127,6 @@ try {
}
exit(Command::FAILURE);
}
/** @var ConsoleApplication $application */
$application = $container->get(ConsoleApplication::class);
/** @var Application $application */
$application = $container->get(Application::class);
exit($application->run());

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '099994eb803ebf550ae77bbd5ebcac1263d6571a';
public const PACKAGE_VERSION = 'feffd813a316ea0d9f1e0dd6ba45b90b88ae72c3';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-09-08 12:16:43';
public const RELEASE_DATE = '2023-09-08 13:44:20';
/**
* @var int
*/

View File

@ -7,7 +7,6 @@ use RectorPrefix202309\Composer\XdebugHandler\XdebugHandler;
use Rector\ChangesReporting\Output\ConsoleOutputFormatter;
use Rector\Core\Application\VersionResolver;
use Rector\Core\Configuration\Option;
use Rector\Core\Util\Reflection\PrivatesAccessor;
use RectorPrefix202309\Symfony\Component\Console\Application;
use RectorPrefix202309\Symfony\Component\Console\Command\Command;
use RectorPrefix202309\Symfony\Component\Console\Input\InputDefinition;
@ -30,13 +29,6 @@ final class ConsoleApplication extends Application
Assert::notEmpty($commands);
Assert::allIsInstanceOf($commands, Command::class);
$this->addCommands($commands);
// remove unused commands
$privatesAccessor = new PrivatesAccessor();
$privatesAccessor->propertyClosure($this, 'commands', static function (array $commands) : array {
unset($commands['completion']);
unset($commands['help']);
return $commands;
});
// run this command, if no command name is provided
$this->setDefaultCommand('process');
}

View File

@ -69,7 +69,6 @@ use Rector\Core\PhpParser\Node\Value\ValueResolver;
use Rector\Core\PhpParser\NodeTraverser\RectorNodeTraverser;
use Rector\Core\Provider\CurrentFileProvider;
use Rector\Core\Rector\AbstractRector;
use Rector\Core\Util\Reflection\PrivatesAccessor;
use Rector\NodeNameResolver\Contract\NodeNameResolverInterface;
use Rector\NodeNameResolver\NodeNameResolver;
use Rector\NodeNameResolver\NodeNameResolver\ClassConstFetchNameResolver;
@ -258,17 +257,15 @@ final class LazyContainerFactory
$rectorConfig->cacheDirectory(\sys_get_temp_dir() . '/rector_cached_files');
$rectorConfig->containerCacheDirectory(\sys_get_temp_dir());
// make use of https://github.com/symplify/easy-parallel
$rectorConfig->singleton(Application::class, static function () : Application {
$application = new Application();
$privatesAccessor = new PrivatesAccessor();
$privatesAccessor->propertyClosure($application, 'commands', static function (array $commands) : array {
unset($commands['completion']);
unset($commands['help']);
return $commands;
});
$rectorConfig->singleton(Application::class, static function (Container $container) : Application {
$application = $container->make(ConsoleApplication::class);
$commandNamesToHide = ['list', 'completion', 'help'];
foreach ($commandNamesToHide as $commandNameToHide) {
$commandToHide = $application->get($commandNameToHide);
$commandToHide->setHidden();
}
return $application;
});
$rectorConfig->singleton(ConsoleApplication::class, ConsoleApplication::class);
$rectorConfig->when(ConsoleApplication::class)->needs('$commands')->giveTagged(Command::class);
$rectorConfig->singleton(Inflector::class, static function () : Inflector {
$inflectorFactory = new InflectorFactory();

2
vendor/autoload.php vendored
View File

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

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitfdc9248fe3af80f7aa4f0074e437d7c1
class ComposerAutoloaderInit56c2a4d46c77657e873b077661ba525a
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInitfdc9248fe3af80f7aa4f0074e437d7c1
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitfdc9248fe3af80f7aa4f0074e437d7c1', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit56c2a4d46c77657e873b077661ba525a', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitfdc9248fe3af80f7aa4f0074e437d7c1', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit56c2a4d46c77657e873b077661ba525a', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitfdc9248fe3af80f7aa4f0074e437d7c1::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit56c2a4d46c77657e873b077661ba525a::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInitfdc9248fe3af80f7aa4f0074e437d7c1::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit56c2a4d46c77657e873b077661ba525a::$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 ComposerStaticInitfdc9248fe3af80f7aa4f0074e437d7c1
class ComposerStaticInit56c2a4d46c77657e873b077661ba525a
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -2603,9 +2603,9 @@ class ComposerStaticInitfdc9248fe3af80f7aa4f0074e437d7c1
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitfdc9248fe3af80f7aa4f0074e437d7c1::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitfdc9248fe3af80f7aa4f0074e437d7c1::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitfdc9248fe3af80f7aa4f0074e437d7c1::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit56c2a4d46c77657e873b077661ba525a::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit56c2a4d46c77657e873b077661ba525a::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit56c2a4d46c77657e873b077661ba525a::$classMap;
}, null, ClassLoader::class);
}