Updated Rector to commit a63ad695ca6b86b460c425a65762778329ca577f

a63ad695ca [TypeDeclaration] Skip has parent class method on AddParamTypeFromPropertyTypeRector (#4627)
This commit is contained in:
Tomas Votruba 2023-08-02 08:12:09 +00:00
parent aae549741f
commit c0798d5cca
9 changed files with 38 additions and 28 deletions

View File

@ -17,6 +17,7 @@ use Rector\Core\ValueObject\PhpVersionFeature;
use Rector\NodeTypeResolver\PHPStan\Type\TypeFactory;
use Rector\PhpDocParser\NodeTraverser\SimpleCallableNodeTraverser;
use Rector\PHPStanStaticTypeMapper\Enum\TypeKind;
use Rector\VendorLocker\ParentClassMethodTypeOverrideGuard;
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
@ -40,15 +41,21 @@ final class AddParamTypeFromPropertyTypeRector extends AbstractRector implements
* @var \Rector\NodeTypeResolver\PHPStan\Type\TypeFactory
*/
private $typeFactory;
/**
* @readonly
* @var \Rector\VendorLocker\ParentClassMethodTypeOverrideGuard
*/
private $parentClassMethodTypeOverrideGuard;
/**
* @var string
*/
private const ERROR_MESSAGE = 'Adds param type declaration based on property type the value is assigned to PHPUnit provider return type declaration';
public function __construct(PropertyFetchAnalyzer $propertyFetchAnalyzer, SimpleCallableNodeTraverser $simpleCallableNodeTraverser, TypeFactory $typeFactory)
public function __construct(PropertyFetchAnalyzer $propertyFetchAnalyzer, SimpleCallableNodeTraverser $simpleCallableNodeTraverser, TypeFactory $typeFactory, ParentClassMethodTypeOverrideGuard $parentClassMethodTypeOverrideGuard)
{
$this->propertyFetchAnalyzer = $propertyFetchAnalyzer;
$this->simpleCallableNodeTraverser = $simpleCallableNodeTraverser;
$this->typeFactory = $typeFactory;
$this->parentClassMethodTypeOverrideGuard = $parentClassMethodTypeOverrideGuard;
}
public function getRuleDefinition() : RuleDefinition
{
@ -114,6 +121,9 @@ CODE_SAMPLE
if (!$paramType instanceof Node) {
continue;
}
if ($this->parentClassMethodTypeOverrideGuard->hasParentClassMethod($node)) {
return null;
}
$param->type = $paramType;
$hasChanged = \true;
}

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '0cb3fd0feb464b4568e07607a05c794637aa2862';
public const PACKAGE_VERSION = 'a63ad695ca6b86b460c425a65762778329ca577f';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-08-01 17:50:30';
public const RELEASE_DATE = '2023-08-02 15:08:40';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

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

View File

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

View File

@ -504,8 +504,8 @@
},
{
"name": "illuminate\/container",
"version": "v10.16.1",
"version_normalized": "10.16.1.0",
"version": "v10.17.0",
"version_normalized": "10.17.0.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/illuminate\/container.git",
@ -558,17 +558,17 @@
},
{
"name": "illuminate\/contracts",
"version": "v10.16.1",
"version_normalized": "10.16.1.0",
"version": "v10.17.0",
"version_normalized": "10.17.0.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/illuminate\/contracts.git",
"reference": "ec47d1aa1a1b1a679d8553836b417343881b8215"
"reference": "eb1a7e72e159136a832f2c0467de5570bdc208ae"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/illuminate\/contracts\/zipball\/ec47d1aa1a1b1a679d8553836b417343881b8215",
"reference": "ec47d1aa1a1b1a679d8553836b417343881b8215",
"url": "https:\/\/api.github.com\/repos\/illuminate\/contracts\/zipball\/eb1a7e72e159136a832f2c0467de5570bdc208ae",
"reference": "eb1a7e72e159136a832f2c0467de5570bdc208ae",
"shasum": ""
},
"require": {
@ -576,7 +576,7 @@
"psr\/container": "^1.1.1|^2.0.1",
"psr\/simple-cache": "^1.0|^2.0|^3.0"
},
"time": "2023-06-27T14:35:49+00:00",
"time": "2023-07-26T21:27:34+00:00",
"type": "library",
"extra": {
"branch-alias": {
@ -1986,12 +1986,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-downgrade-php.git",
"reference": "89173a280c66cba1d58a6a720cbaf933f8d56e71"
"reference": "c3857d1b11ef1edc94c62085c4cab3c4413e5f94"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/89173a280c66cba1d58a6a720cbaf933f8d56e71",
"reference": "89173a280c66cba1d58a6a720cbaf933f8d56e71",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/c3857d1b11ef1edc94c62085c4cab3c4413e5f94",
"reference": "c3857d1b11ef1edc94c62085c4cab3c4413e5f94",
"shasum": ""
},
"require": {
@ -2016,7 +2016,7 @@
"tomasvotruba\/type-coverage": "^0.2",
"tomasvotruba\/unused-public": "^0.1"
},
"time": "2023-07-25T09:43:20+00:00",
"time": "2023-08-01T11:13:39+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {

File diff suppressed because one or more lines are too long

View File

@ -41,7 +41,7 @@ interface Filesystem
* Write the contents of a file.
*
* @param string $path
* @param string|resource $contents
* @param \Psr\Http\Message\StreamInterface|\Illuminate\Http\File|\Illuminate\Http\UploadedFile|string|resource $contents
* @param mixed $options
* @return bool
*/

View File

@ -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 1c50ebb'), '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 89173a2'), '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 0438162'), '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 a0af12a'));
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 1c50ebb'), '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 c3857d1'), '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 0438162'), '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 a0af12a'));
private function __construct()
{
}