Updated Rector to commit e6cc503e24bbbc362d6e05b4f4a322ff97c09457

e6cc503e24 remove memory limit (#2639)
This commit is contained in:
Tomas Votruba 2022-07-06 19:24:32 +00:00
parent 920b431195
commit 331fec3c26
15 changed files with 48 additions and 83 deletions

View File

@ -17,12 +17,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '53bddfb185b596a354ac946cec2788a169ae4fe6';
public const PACKAGE_VERSION = 'e6cc503e24bbbc362d6e05b4f4a322ff97c09457';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2022-07-06 14:53:10';
public const RELEASE_DATE = '2022-07-06 19:18:29';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

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

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit740c6756957ccbba165e0f8db1ae5fc1
class ComposerAutoloaderInitcf7a9ee10b9d0ab9f5be42c9a1db419b
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInit740c6756957ccbba165e0f8db1ae5fc1
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit740c6756957ccbba165e0f8db1ae5fc1', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitcf7a9ee10b9d0ab9f5be42c9a1db419b', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit740c6756957ccbba165e0f8db1ae5fc1', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitcf7a9ee10b9d0ab9f5be42c9a1db419b', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit740c6756957ccbba165e0f8db1ae5fc1::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitcf7a9ee10b9d0ab9f5be42c9a1db419b::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInit740c6756957ccbba165e0f8db1ae5fc1::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInitcf7a9ee10b9d0ab9f5be42c9a1db419b::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire740c6756957ccbba165e0f8db1ae5fc1($fileIdentifier, $file);
composerRequirecf7a9ee10b9d0ab9f5be42c9a1db419b($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInit740c6756957ccbba165e0f8db1ae5fc1
* @param string $file
* @return void
*/
function composerRequire740c6756957ccbba165e0f8db1ae5fc1($fileIdentifier, $file)
function composerRequirecf7a9ee10b9d0ab9f5be42c9a1db419b($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 ComposerStaticInit740c6756957ccbba165e0f8db1ae5fc1
class ComposerStaticInitcf7a9ee10b9d0ab9f5be42c9a1db419b
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
@ -3410,9 +3410,9 @@ class ComposerStaticInit740c6756957ccbba165e0f8db1ae5fc1
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit740c6756957ccbba165e0f8db1ae5fc1::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit740c6756957ccbba165e0f8db1ae5fc1::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit740c6756957ccbba165e0f8db1ae5fc1::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitcf7a9ee10b9d0ab9f5be42c9a1db419b::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitcf7a9ee10b9d0ab9f5be42c9a1db419b::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitcf7a9ee10b9d0ab9f5be42c9a1db419b::$classMap;
}, null, ClassLoader::class);
}

View File

@ -1923,12 +1923,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-doctrine.git",
"reference": "b177492fe3c50627937ee144397aaf77fece1dd6"
"reference": "c0ff68c2e0b13c920c1c8a207e262a3909b6cf5e"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/b177492fe3c50627937ee144397aaf77fece1dd6",
"reference": "b177492fe3c50627937ee144397aaf77fece1dd6",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/c0ff68c2e0b13c920c1c8a207e262a3909b6cf5e",
"reference": "c0ff68c2e0b13c920c1c8a207e262a3909b6cf5e",
"shasum": ""
},
"require": {
@ -1953,7 +1953,7 @@
"symplify\/rule-doc-generator": "^11.0",
"symplify\/vendor-patches": "^11.0"
},
"time": "2022-07-01T09:38:07+00:00",
"time": "2022-07-06T19:11:45+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
*/
final class GeneratedConfig
{
public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 86ab8c3'), '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 b177492'), '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 97f49a2'), 'rector/rector-generator' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-generator', 'relative_install_path' => '../../rector-generator', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 644d45b'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 425881a'), 'rector/rector-nette' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-nette', 'relative_install_path' => '../../rector-nette', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main bee7c19'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main d826618'), '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 81f779a'), '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 d4e61a1'));
public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 86ab8c3'), '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 c0ff68c'), '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 97f49a2'), 'rector/rector-generator' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-generator', 'relative_install_path' => '../../rector-generator', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 644d45b'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 425881a'), 'rector/rector-nette' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-nette', 'relative_install_path' => '../../rector-nette', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main bee7c19'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main d826618'), '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 81f779a'), '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 d4e61a1'));
private function __construct()
{
}

View File

@ -43,22 +43,6 @@ final class AttributeFinder
}
return $this->findArgByName($attribute, $argName);
}
/**
* @return \PhpParser\Node\Expr|null
*/
public function findArgByName(Attribute $attribute, string $argName)
{
foreach ($attribute->args as $arg) {
if ($arg->name === null) {
continue;
}
if (!$this->nodeNameResolver->isName($arg->name, $argName)) {
continue;
}
return $arg->value;
}
return null;
}
/**
* @param class-string $attributeClass
* @param \PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Stmt\Property|\PhpParser\Node\Stmt\ClassLike|\PhpParser\Node\Param $node
@ -92,4 +76,20 @@ final class AttributeFinder
}
return null;
}
/**
* @return \PhpParser\Node\Expr|null
*/
private function findArgByName(Attribute $attribute, string $argName)
{
foreach ($attribute->args as $arg) {
if ($arg->name === null) {
continue;
}
if (!$this->nodeNameResolver->isName($arg->name, $argName)) {
continue;
}
return $arg->value;
}
return null;
}
}

View File

@ -29,6 +29,7 @@ final class AttrinationFinder
$this->attributeFinder = $attributeFinder;
}
/**
* @api
* @param class-string $name
* @param \PhpParser\Node\Stmt\Property|\PhpParser\Node\Stmt\Class_|\PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Param $node
* @return \Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode|\PhpParser\Node\Attribute|null

View File

@ -61,7 +61,7 @@ final class ParamFactory
/**
* @param string[] $optionalParamNames
*/
public function createFromPropertyFetch(PropertyFetch $propertyFetch, array $optionalParamNames) : Param
private function createFromPropertyFetch(PropertyFetch $propertyFetch, array $optionalParamNames) : Param
{
$propertyName = $this->nodeNameResolver->getName($propertyFetch->name);
if ($propertyName === null) {

View File

@ -14,12 +14,6 @@ use PhpParser\Node\Scalar\String_;
use PhpParser\Node\Stmt\Expression;
final class ValueAssignFactory
{
public function createDefaultDateTimeAssign(string $propertyName) : Expression
{
$propertyFetch = $this->createPropertyFetch($propertyName);
$assign = new Assign($propertyFetch, $this->createNewDateTime());
return new Expression($assign);
}
public function createDefaultDateTimeWithValueAssign(string $propertyName, Expr $defaultExpr) : Expression
{
$propertyFetch = $this->createPropertyFetch($propertyName);

View File

@ -5,11 +5,8 @@ namespace Rector\Doctrine\PhpDocParser;
use PhpParser\Node;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\Property;
use Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory;
use Rector\Core\PhpParser\Node\BetterNodeFinder;
use Rector\Doctrine\PhpDoc\ShortClassExpander;
final class DoctrineDocBlockResolver
{
/**
@ -17,40 +14,16 @@ final class DoctrineDocBlockResolver
* @var \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory
*/
private $phpDocInfoFactory;
/**
* @readonly
* @var \Rector\Doctrine\PhpDoc\ShortClassExpander
*/
private $shortClassExpander;
/**
* @readonly
* @var \Rector\Core\PhpParser\Node\BetterNodeFinder
*/
private $betterNodeFinder;
public function __construct(PhpDocInfoFactory $phpDocInfoFactory, ShortClassExpander $shortClassExpander, BetterNodeFinder $betterNodeFinder)
public function __construct(PhpDocInfoFactory $phpDocInfoFactory, BetterNodeFinder $betterNodeFinder)
{
$this->phpDocInfoFactory = $phpDocInfoFactory;
$this->shortClassExpander = $shortClassExpander;
$this->betterNodeFinder = $betterNodeFinder;
}
public function isDoctrineEntityClass(Class_ $class) : bool
{
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($class);
return $phpDocInfo->hasByAnnotationClasses(['Doctrine\\ORM\\Mapping\\Entity', 'Doctrine\\ORM\\Mapping\\Embeddable']);
}
public function getTargetEntity(Property $property) : ?string
{
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($property);
$doctrineAnnotationTagValueNode = $phpDocInfo->getByAnnotationClasses(['Doctrine\\ORM\\Mapping\\OneToMany', 'Doctrine\\ORM\\Mapping\\ManyToMany', 'Doctrine\\ORM\\Mapping\\OneToOne', 'Doctrine\\ORM\\Mapping\\ManyToOne']);
if (!$doctrineAnnotationTagValueNode instanceof DoctrineAnnotationTagValueNode) {
return null;
}
$targetEntity = $doctrineAnnotationTagValueNode->getValue('targetEntity');
if (!\is_string($targetEntity)) {
return null;
}
return $this->shortClassExpander->resolveFqnTargetEntity($targetEntity, $property);
}
public function isInDoctrineEntityClass(Node $node) : bool
{
$class = $this->betterNodeFinder->findParentType($node, Class_::class);
@ -59,4 +32,9 @@ final class DoctrineDocBlockResolver
}
return $this->isDoctrineEntityClass($class);
}
private function isDoctrineEntityClass(Class_ $class) : bool
{
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($class);
return $phpDocInfo->hasByAnnotationClasses(['Doctrine\\ORM\\Mapping\\Entity', 'Doctrine\\ORM\\Mapping\\Embeddable']);
}
}

View File

@ -20,6 +20,7 @@ use RectorPrefix202207\Webmozart\Assert\Assert;
final class AddEntityIdByConditionRector extends AbstractRector implements ConfigurableRectorInterface
{
/**
* @api
* @var string
*/
public const DETECTED_TRAITS = 'detected_traits';

View File

@ -4,6 +4,9 @@ declare (strict_types=1);
namespace Rector\Doctrine\Set;
use Rector\Set\Contract\SetListInterface;
/**
* @api
*/
final class DoctrineSetList implements SetListInterface
{
/**

View File

@ -3,7 +3,6 @@
declare (strict_types=1);
namespace Rector\Doctrine\ValueObject;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
final class PropertyNamesAndPhpDocInfos
{
/**
@ -18,17 +17,6 @@ final class PropertyNamesAndPhpDocInfos
{
$this->propertyNameAndPhpDocInfos = $propertyNameAndPhpDocInfos;
}
/**
* @return PhpDocInfo[]
*/
public function getPhpDocInfos() : array
{
$phpDocInfos = [];
foreach ($this->propertyNameAndPhpDocInfos as $propertyNameAndPhpDocInfo) {
$phpDocInfos[] = $propertyNameAndPhpDocInfo->getPhpDocInfo();
}
return $phpDocInfos;
}
/**
* @return string[]
*/