mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-03 09:50:49 +00:00
Updated Rector to commit e7c028396b
e7c028396b
[Php81] Skip has unset property fetch on ReadOnlyPropertyRector (#1953)
This commit is contained in:
parent
7c43a401a4
commit
59c2c1ddec
|
@ -16,11 +16,11 @@ final class VersionResolver
|
|||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'a0178a72d46df1626b50481b4367a921011de8c1';
|
||||
public const PACKAGE_VERSION = 'e7c028396bdd50b7cdbb765cdadab6878730295e';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2022-03-21 19:47:08';
|
||||
public const RELEASE_DATE = '2022-03-21 21:06:38';
|
||||
public static function resolvePackageVersion() : string
|
||||
{
|
||||
$process = new \RectorPrefix20220321\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);
|
||||
|
|
|
@ -24,6 +24,7 @@ use PhpParser\Node\Stmt\ClassLike;
|
|||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
use PhpParser\Node\Stmt\Interface_;
|
||||
use PhpParser\Node\Stmt\Property;
|
||||
use PhpParser\Node\Stmt\Unset_;
|
||||
use PHPStan\Reflection\ParametersAcceptorSelector;
|
||||
use PHPStan\Type\Type;
|
||||
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
|
||||
|
@ -197,12 +198,16 @@ final class PropertyManipulator
|
|||
}
|
||||
// skip for constructor? it is allowed to set value in constructor method
|
||||
$classMethod = $this->betterNodeFinder->findParentType($propertyFetch, \PhpParser\Node\Stmt\ClassMethod::class);
|
||||
if ($classMethod instanceof \PhpParser\Node\Stmt\ClassMethod && $this->isInlineStmtWithConstructMethod($propertyFetch, $classMethod)) {
|
||||
if ($this->isInlineStmtWithConstructMethod($propertyFetch, $classMethod)) {
|
||||
continue;
|
||||
}
|
||||
if ($this->assignManipulator->isLeftPartOfAssign($propertyFetch)) {
|
||||
return \true;
|
||||
}
|
||||
$isInUnset = (bool) $this->betterNodeFinder->findParentType($propertyFetch, \PhpParser\Node\Stmt\Unset_::class);
|
||||
if ($isInUnset) {
|
||||
return \true;
|
||||
}
|
||||
}
|
||||
return \false;
|
||||
}
|
||||
|
@ -241,8 +246,11 @@ final class PropertyManipulator
|
|||
/**
|
||||
* @param \PhpParser\Node\Expr\PropertyFetch|\PhpParser\Node\Expr\StaticPropertyFetch $propertyFetch
|
||||
*/
|
||||
private function isInlineStmtWithConstructMethod($propertyFetch, \PhpParser\Node\Stmt\ClassMethod $classMethod) : bool
|
||||
private function isInlineStmtWithConstructMethod($propertyFetch, ?\PhpParser\Node\Stmt\ClassMethod $classMethod) : bool
|
||||
{
|
||||
if (!$classMethod instanceof \PhpParser\Node\Stmt\ClassMethod) {
|
||||
return \false;
|
||||
}
|
||||
if (!$this->nodeNameResolver->isName($classMethod->name, \Rector\Core\ValueObject\MethodName::CONSTRUCT)) {
|
||||
return \false;
|
||||
}
|
||||
|
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
|
@ -4,4 +4,4 @@
|
|||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit232f5e3c546e62bd6889d33e974c0554::getLoader();
|
||||
return ComposerAutoloaderInitbfb055ff1b21a7df641d6b57154865dc::getLoader();
|
||||
|
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
|
@ -2,7 +2,7 @@
|
|||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit232f5e3c546e62bd6889d33e974c0554
|
||||
class ComposerAutoloaderInitbfb055ff1b21a7df641d6b57154865dc
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
|
@ -22,15 +22,15 @@ class ComposerAutoloaderInit232f5e3c546e62bd6889d33e974c0554
|
|||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit232f5e3c546e62bd6889d33e974c0554', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitbfb055ff1b21a7df641d6b57154865dc', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit232f5e3c546e62bd6889d33e974c0554', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitbfb055ff1b21a7df641d6b57154865dc', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit232f5e3c546e62bd6889d33e974c0554::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitbfb055ff1b21a7df641d6b57154865dc::getInitializer($loader));
|
||||
} else {
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
|
@ -42,12 +42,12 @@ class ComposerAutoloaderInit232f5e3c546e62bd6889d33e974c0554
|
|||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInit232f5e3c546e62bd6889d33e974c0554::$files;
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInitbfb055ff1b21a7df641d6b57154865dc::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire232f5e3c546e62bd6889d33e974c0554($fileIdentifier, $file);
|
||||
composerRequirebfb055ff1b21a7df641d6b57154865dc($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
|
@ -59,7 +59,7 @@ class ComposerAutoloaderInit232f5e3c546e62bd6889d33e974c0554
|
|||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
function composerRequire232f5e3c546e62bd6889d33e974c0554($fileIdentifier, $file)
|
||||
function composerRequirebfb055ff1b21a7df641d6b57154865dc($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit232f5e3c546e62bd6889d33e974c0554
|
||||
class ComposerStaticInitbfb055ff1b21a7df641d6b57154865dc
|
||||
{
|
||||
public static $files = array (
|
||||
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
|
||||
|
@ -3845,9 +3845,9 @@ class ComposerStaticInit232f5e3c546e62bd6889d33e974c0554
|
|||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit232f5e3c546e62bd6889d33e974c0554::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit232f5e3c546e62bd6889d33e974c0554::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit232f5e3c546e62bd6889d33e974c0554::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitbfb055ff1b21a7df641d6b57154865dc::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitbfb055ff1b21a7df641d6b57154865dc::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitbfb055ff1b21a7df641d6b57154865dc::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
|
10
vendor/scoper-autoload.php
vendored
10
vendor/scoper-autoload.php
vendored
|
@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php';
|
|||
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
|
||||
spl_autoload_call('RectorPrefix20220321\AutoloadIncluder');
|
||||
}
|
||||
if (!class_exists('ComposerAutoloaderInit232f5e3c546e62bd6889d33e974c0554', false) && !interface_exists('ComposerAutoloaderInit232f5e3c546e62bd6889d33e974c0554', false) && !trait_exists('ComposerAutoloaderInit232f5e3c546e62bd6889d33e974c0554', false)) {
|
||||
spl_autoload_call('RectorPrefix20220321\ComposerAutoloaderInit232f5e3c546e62bd6889d33e974c0554');
|
||||
if (!class_exists('ComposerAutoloaderInitbfb055ff1b21a7df641d6b57154865dc', false) && !interface_exists('ComposerAutoloaderInitbfb055ff1b21a7df641d6b57154865dc', false) && !trait_exists('ComposerAutoloaderInitbfb055ff1b21a7df641d6b57154865dc', false)) {
|
||||
spl_autoload_call('RectorPrefix20220321\ComposerAutoloaderInitbfb055ff1b21a7df641d6b57154865dc');
|
||||
}
|
||||
if (!class_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !interface_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !trait_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false)) {
|
||||
spl_autoload_call('RectorPrefix20220321\Helmich\TypoScriptParser\Parser\AST\Statement');
|
||||
|
@ -59,9 +59,9 @@ if (!function_exists('print_node')) {
|
|||
return \RectorPrefix20220321\print_node(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('composerRequire232f5e3c546e62bd6889d33e974c0554')) {
|
||||
function composerRequire232f5e3c546e62bd6889d33e974c0554() {
|
||||
return \RectorPrefix20220321\composerRequire232f5e3c546e62bd6889d33e974c0554(...func_get_args());
|
||||
if (!function_exists('composerRequirebfb055ff1b21a7df641d6b57154865dc')) {
|
||||
function composerRequirebfb055ff1b21a7df641d6b57154865dc() {
|
||||
return \RectorPrefix20220321\composerRequirebfb055ff1b21a7df641d6b57154865dc(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('scanPath')) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user