1
0
mirror of https://github.com/rectorphp/rector.git synced 2025-04-24 17:36:02 +02:00

Updated Rector to commit 7078b51a7cfe02d85474a38192caf797beedcfd6

7078b51a7c [TypeDeclaration] Add ReturnTypeFromStrictFluentReturnRector ()
This commit is contained in:
Tomas Votruba 2023-08-31 19:02:42 +00:00
parent 3d97937140
commit 8be31113be
7 changed files with 25 additions and 31 deletions
vendor
autoload.php
composer
rector
extension-installer/src
rector-downgrade-php/rules/DowngradePhp80/Rector/Class_

2
vendor/autoload.php vendored

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

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

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit55a7c732ac749acb9a4af5714241c0ec
class ComposerStaticInitc8f25d1081a53688d7f33993bb4d0220
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -2608,9 +2608,9 @@ class ComposerStaticInit55a7c732ac749acb9a4af5714241c0ec
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit55a7c732ac749acb9a4af5714241c0ec::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit55a7c732ac749acb9a4af5714241c0ec::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit55a7c732ac749acb9a4af5714241c0ec::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitc8f25d1081a53688d7f33993bb4d0220::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitc8f25d1081a53688d7f33993bb4d0220::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitc8f25d1081a53688d7f33993bb4d0220::$classMap;
}, null, ClassLoader::class);
}

@ -1812,12 +1812,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-downgrade-php.git",
"reference": "6fbdefd4bc48ab26033932aad45b0d7846120efa"
"reference": "910d9423aaf0b2536ce8ff7ba3d6751a8ca0346a"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/6fbdefd4bc48ab26033932aad45b0d7846120efa",
"reference": "6fbdefd4bc48ab26033932aad45b0d7846120efa",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/910d9423aaf0b2536ce8ff7ba3d6751a8ca0346a",
"reference": "910d9423aaf0b2536ce8ff7ba3d6751a8ca0346a",
"shasum": ""
},
"require": {
@ -1843,7 +1843,7 @@
"tomasvotruba\/type-coverage": "^0.2",
"tomasvotruba\/unused-public": "^0.1"
},
"time": "2023-08-26T07:12:27+00:00",
"time": "2023-08-31T18:58:17+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {

File diff suppressed because one or more lines are too long

@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
*/
final class GeneratedConfig
{
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main fabb300'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 6fbdefd'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main e6dd6a0'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 0f327da'));
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main fabb300'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 910d942'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main e6dd6a0'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 0f327da'));
private function __construct()
{
}

@ -79,14 +79,16 @@ CODE_SAMPLE
*/
public function refactor(Node $node) : ?Node
{
$oldComments = $this->getOldComments($node);
$promotedParams = $this->resolvePromotedParams($node);
$constructorClassMethod = $node->getMethod(MethodName::CONSTRUCT);
if (!$constructorClassMethod instanceof ClassMethod) {
return null;
}
$oldComments = $this->getOldComments($constructorClassMethod);
$promotedParams = $this->resolvePromotedParams($constructorClassMethod);
if ($promotedParams === []) {
return null;
}
/** @var ClassMethod $constructClassMethod */
$constructClassMethod = $node->getMethod(MethodName::CONSTRUCT);
$properties = $this->resolvePropertiesFromPromotedParams($constructClassMethod, $promotedParams, $node);
$properties = $this->resolvePropertiesFromPromotedParams($constructorClassMethod, $promotedParams, $node);
$this->addPropertyAssignsToConstructorClassMethod($properties, $node, $oldComments);
foreach ($promotedParams as $promotedParam) {
$promotedParam->flags = 0;
@ -96,12 +98,8 @@ CODE_SAMPLE
/**
* @return array<string, Comment|null>
*/
private function getOldComments(Class_ $class) : array
private function getOldComments(ClassMethod $constructorClassMethod) : array
{
$constructorClassMethod = $class->getMethod(MethodName::CONSTRUCT);
if (!$constructorClassMethod instanceof ClassMethod) {
return [];
}
$oldComments = [];
foreach ($constructorClassMethod->params as $param) {
$oldComments[$this->getName($param->var)] = $param->getAttribute(AttributeKey::COMMENTS);
@ -111,12 +109,8 @@ CODE_SAMPLE
/**
* @return Param[]
*/
private function resolvePromotedParams(Class_ $class) : array
private function resolvePromotedParams(ClassMethod $constructorClassMethod) : array
{
$constructorClassMethod = $class->getMethod(MethodName::CONSTRUCT);
if (!$constructorClassMethod instanceof ClassMethod) {
return [];
}
$promotedParams = [];
foreach ($constructorClassMethod->params as $param) {
if ($param->flags === 0) {