Updated Rector to commit 449e5ff7e0b30d9cb15e5b31e9cb96d31f4556a7

449e5ff7e0 [Privatization] Skip magic method on PrivatizeFinalClassMethodRector (#6734)
This commit is contained in:
Tomas Votruba 2025-02-13 09:09:11 +00:00
parent c0e2ec7e5c
commit d8deb2ab52
7 changed files with 26 additions and 23 deletions

View File

@ -117,6 +117,9 @@ CODE_SAMPLE
if (!$classMethod->isProtected()) {
return \true;
}
if ($classMethod->isMagic()) {
return \true;
}
// if has parent call, its probably overriding parent one → skip it
$hasParentCall = (bool) $this->betterNodeFinder->findFirst((array) $classMethod->stmts, function (Node $node) : bool {
if (!$node instanceof StaticCall) {

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'e1841aebb73cb1fdc6f330b91555433cbb69ab34';
public const PACKAGE_VERSION = '449e5ff7e0b30d9cb15e5b31e9cb96d31f4556a7';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2025-02-12 00:22:14';
public const RELEASE_DATE = '2025-02-13 16:06:26';
/**
* @var int
*/

View File

@ -244,13 +244,13 @@ final class LazyContainerFactory
$rectorConfig = new RectorConfig();
$rectorConfig->import(__DIR__ . '/../../config/config.php');
$rectorConfig->singleton(Application::class, static function (Container $container) : Application {
$application = $container->make(ConsoleApplication::class);
$consoleApplication = $container->make(ConsoleApplication::class);
$commandNamesToHide = ['list', 'completion', 'help', 'worker'];
foreach ($commandNamesToHide as $commandNameToHide) {
$commandToHide = $application->get($commandNameToHide);
$commandToHide = $consoleApplication->get($commandNameToHide);
$commandToHide->setHidden();
}
return $application;
return $consoleApplication;
});
$rectorConfig->when(ConsoleApplication::class)->needs('$commands')->giveTagged(Command::class);
$rectorConfig->singleton(Inflector::class, static function () : Inflector {
@ -335,8 +335,8 @@ final class LazyContainerFactory
$rectorConfig->when(OutputFormatterCollector::class)->needs('$outputFormatters')->giveTagged(OutputFormatterInterface::class);
// required-like setter
$rectorConfig->afterResolving(ArrayAnnotationToAttributeMapper::class, static function (ArrayAnnotationToAttributeMapper $arrayAnnotationToAttributeMapper, Container $container) : void {
$annotationToAttributesMapper = $container->make(AnnotationToAttributeMapper::class);
$arrayAnnotationToAttributeMapper->autowire($annotationToAttributesMapper);
$annotationToAttributeMapper = $container->make(AnnotationToAttributeMapper::class);
$arrayAnnotationToAttributeMapper->autowire($annotationToAttributeMapper);
});
$rectorConfig->afterResolving(ArrayItemNodeAnnotationToAttributeMapper::class, static function (ArrayItemNodeAnnotationToAttributeMapper $arrayItemNodeAnnotationToAttributeMapper, Container $container) : void {
$annotationToAttributeMapper = $container->make(AnnotationToAttributeMapper::class);
@ -375,17 +375,17 @@ final class LazyContainerFactory
private function createPHPStanServices(RectorConfig $rectorConfig) : void
{
$rectorConfig->singleton(Parser::class, static function (Container $container) {
$phpstanServiceFactory = $container->make(PHPStanServicesFactory::class);
return $phpstanServiceFactory->createPHPStanParser();
$phpStanServicesFactory = $container->make(PHPStanServicesFactory::class);
return $phpStanServicesFactory->createPHPStanParser();
});
$rectorConfig->singleton(Lexer::class, static function (Container $container) {
$phpstanServiceFactory = $container->make(PHPStanServicesFactory::class);
return $phpstanServiceFactory->createEmulativeLexer();
$phpStanServicesFactory = $container->make(PHPStanServicesFactory::class);
return $phpStanServicesFactory->createEmulativeLexer();
});
foreach (self::PUBLIC_PHPSTAN_SERVICE_TYPES as $publicPhpstanServiceType) {
$rectorConfig->singleton($publicPhpstanServiceType, static function (Container $container) use($publicPhpstanServiceType) {
$phpstanServiceFactory = $container->make(PHPStanServicesFactory::class);
return $phpstanServiceFactory->getByType($publicPhpstanServiceType);
$phpStanServicesFactory = $container->make(PHPStanServicesFactory::class);
return $phpStanServicesFactory->getByType($publicPhpstanServiceType);
});
}
}

View File

@ -29,12 +29,12 @@ if (!\function_exists('dump_node')) {
*/
function dump_node($node) : void
{
$symfonyStyle = Container::getInstance()->make(SymfonyStyleFactory::class)->create();
$rectorStyle = Container::getInstance()->make(SymfonyStyleFactory::class)->create();
// we turn up the verbosity so it's visible in tests overriding the
// default which is to be quite during tests
$symfonyStyle->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
$symfonyStyle->newLine();
$nodePrinter = new NodePrinter($symfonyStyle);
$rectorStyle->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
$rectorStyle->newLine();
$nodePrinter = new NodePrinter($rectorStyle);
$nodePrinter->printNodes($node);
}
}

View File

@ -512,8 +512,8 @@
},
{
"name": "illuminate\/container",
"version": "v11.42.0",
"version_normalized": "11.42.0.0",
"version": "v11.42.1",
"version_normalized": "11.42.1.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/illuminate\/container.git",
@ -569,8 +569,8 @@
},
{
"name": "illuminate\/contracts",
"version": "v11.42.0",
"version_normalized": "11.42.0.0",
"version": "v11.42.1",
"version_normalized": "11.42.1.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/illuminate\/contracts.git",

File diff suppressed because one or more lines are too long

View File

@ -14,7 +14,7 @@ $loader = (static function () {
// Restore the backup and ensure the excluded files are properly marked as loaded
$GLOBALS['__composer_autoload_files'] = \array_merge(
$existingComposerAutoloadFiles,
\array_fill_keys(['5928a00fa978807cf85d90ec3f4b0147', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a'], true)
\array_fill_keys(['0e6d7bf4a5811bfa5cf40c5ccd6fae6a', '5928a00fa978807cf85d90ec3f4b0147'], true)
);
return $loader;