Updated Rector to commit ddb08dc9dd6e4a279dd0d88633cdd51ca14581e0

ddb08dc9dd Clean up PHPStan ignore errors (#2681)
This commit is contained in:
Tomas Votruba 2022-07-19 08:04:51 +00:00
parent e87c453b7e
commit 9244858669
15 changed files with 45 additions and 45 deletions

View File

@ -17,12 +17,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'a66e6530decedb25b89c0049da402ec5828034b3';
public const PACKAGE_VERSION = 'ddb08dc9dd6e4a279dd0d88633cdd51ca14581e0';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2022-07-19 01:30:53';
public const RELEASE_DATE = '2022-07-19 07:58:24';
/**
* @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 ComposerAutoloaderInit5af2329fe2afe50733c7ebc056ec1a82::getLoader();
return ComposerAutoloaderInit6d195f5475edef3834b1bfea329dd13a::getLoader();

View File

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

View File

@ -1923,12 +1923,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-doctrine.git",
"reference": "4539d7dcc5015d469f370f7e7c6d5a329e203237"
"reference": "04125394e5ad08756843d2801ac8c9d68ae98cca"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/4539d7dcc5015d469f370f7e7c6d5a329e203237",
"reference": "4539d7dcc5015d469f370f7e7c6d5a329e203237",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/04125394e5ad08756843d2801ac8c9d68ae98cca",
"reference": "04125394e5ad08756843d2801ac8c9d68ae98cca",
"shasum": ""
},
"require": {
@ -1953,7 +1953,7 @@
"symplify\/rule-doc-generator": "^11.0",
"symplify\/vendor-patches": "^11.0"
},
"time": "2022-07-15T12:52:50+00:00",
"time": "2022-07-19T06:53:19+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {
@ -2135,12 +2135,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-laravel.git",
"reference": "425881a502cc218aabb132e1641f97f7f6704e44"
"reference": "819a67cea26229fa9bc13b76f2b5711f2c8ddfef"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-laravel\/zipball\/425881a502cc218aabb132e1641f97f7f6704e44",
"reference": "425881a502cc218aabb132e1641f97f7f6704e44",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-laravel\/zipball\/819a67cea26229fa9bc13b76f2b5711f2c8ddfef",
"reference": "819a67cea26229fa9bc13b76f2b5711f2c8ddfef",
"shasum": ""
},
"require": {
@ -2151,7 +2151,7 @@
},
"require-dev": {
"phpstan\/extension-installer": "^1.1",
"phpstan\/phpstan": "^1.8",
"phpstan\/phpstan": "^1.8.2",
"phpstan\/phpstan-strict-rules": "^1.2",
"phpstan\/phpstan-webmozart-assert": "^1.1",
"phpunit\/phpunit": "^9.5",
@ -2164,7 +2164,7 @@
"symplify\/rule-doc-generator": "^11.0",
"symplify\/vendor-patches": "^11.0"
},
"time": "2022-07-03T22:03:57+00:00",
"time": "2022-07-18T23:55:32+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 4539d7d'), '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 7ee4e58'), '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 be4b95a'), '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 b44203e'), '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 2053a16'));
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 0412539'), '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 7ee4e58'), '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 be4b95a'), '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 819a67c'), '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 b44203e'), '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 2053a16'));
private function __construct()
{
}

View File

@ -42,9 +42,9 @@ final class EntityObjectTypeResolver
}
public function resolveFromRepositoryClass(Class_ $repositoryClass) : SubtractableType
{
$entityType = $this->resolveFromParentConstruct($repositoryClass);
if (!$entityType instanceof MixedType) {
return $entityType;
$subtractableType = $this->resolveFromParentConstruct($repositoryClass);
if (!$subtractableType instanceof MixedType) {
return $subtractableType;
}
$getterReturnType = $this->resolveFromGetterReturnType($repositoryClass);
if (!$getterReturnType instanceof MixedType) {

View File

@ -38,16 +38,16 @@ final class RepositoryAssignFactory
*/
public function create(Class_ $repositoryClass) : Assign
{
$entityObjectType = $this->entityObjectTypeResolver->resolveFromRepositoryClass($repositoryClass);
$subtractableType = $this->entityObjectTypeResolver->resolveFromRepositoryClass($repositoryClass);
$className = $this->nodeNameResolver->getName($repositoryClass);
if (!\is_string($className)) {
throw new ShouldNotHappenException();
}
$repositoryClassName = $className;
if (!$entityObjectType instanceof TypeWithClassName) {
if (!$subtractableType instanceof TypeWithClassName) {
throw new ShouldNotHappenException(\sprintf('An entity was not found for "%s" repository.', $repositoryClassName));
}
$classConstFetch = $this->nodeFactory->createClassConstReference($entityObjectType->getClassName());
$classConstFetch = $this->nodeFactory->createClassConstReference($subtractableType->getClassName());
$methodCall = $this->nodeFactory->createMethodCall('entityManager', 'getRepository', [$classConstFetch]);
return $this->nodeFactory->createPropertyAssignmentWithExpr('repository', $methodCall);
}

View File

@ -98,9 +98,9 @@ final class ColumnPropertyTypeResolver
}
public function resolve(Property $property, bool $isNullable) : ?Type
{
$argValue = $this->attributeFinder->findAttributeByClassArgByName($property, self::COLUMN_CLASS, 'type');
if ($argValue instanceof String_) {
return $this->createPHPStanTypeFromDoctrineStringType($argValue->value, $isNullable);
$expr = $this->attributeFinder->findAttributeByClassArgByName($property, self::COLUMN_CLASS, 'type');
if ($expr instanceof String_) {
return $this->createPHPStanTypeFromDoctrineStringType($expr->value, $isNullable);
}
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($property);
return $this->resolveFromPhpDocInfo($phpDocInfo, $isNullable);

View File

@ -57,11 +57,11 @@ final class ToManyRelationPropertyTypeResolver
if ($doctrineAnnotationTagValueNode !== null) {
return $this->processToManyRelation($property, $doctrineAnnotationTagValueNode);
}
$targetEntity = $this->attributeFinder->findAttributeByClassesArgByName($property, self::TO_MANY_ANNOTATION_CLASSES, 'targetEntity');
if (!$targetEntity instanceof Expr) {
$expr = $this->attributeFinder->findAttributeByClassesArgByName($property, self::TO_MANY_ANNOTATION_CLASSES, 'targetEntity');
if (!$expr instanceof Expr) {
return null;
}
return $this->resolveTypeFromTargetEntity($targetEntity, $property);
return $this->resolveTypeFromTargetEntity($expr, $property);
}
/**
* @return \PHPStan\Type\Type|null

View File

@ -65,11 +65,11 @@ final class ToOneRelationPropertyTypeResolver
if ($doctrineAnnotationTagValueNode instanceof DoctrineAnnotationTagValueNode) {
return $this->resolveFromDocBlock($phpDocInfo, $property, $doctrineAnnotationTagValueNode);
}
$targetEntity = $this->attributeFinder->findAttributeByClassesArgByName($property, self::TO_ONE_ANNOTATION_CLASSES, 'targetEntity');
if (!$targetEntity instanceof Expr) {
$expr = $this->attributeFinder->findAttributeByClassesArgByName($property, self::TO_ONE_ANNOTATION_CLASSES, 'targetEntity');
if (!$expr instanceof Expr) {
return null;
}
$targetEntityClass = $this->targetEntityResolver->resolveFromExpr($targetEntity);
$targetEntityClass = $this->targetEntityResolver->resolveFromExpr($expr);
if ($targetEntityClass !== null) {
$fullyQualifiedObjectType = new FullyQualifiedObjectType($targetEntityClass);
// @todo resolve nullable value

View File

@ -112,9 +112,9 @@ CODE_SAMPLE
if ($type !== 'datetime') {
return null;
}
$constructorAssign = $this->constructorAssignPropertyAnalyzer->resolveConstructorAssign($property);
$node = $this->constructorAssignPropertyAnalyzer->resolveConstructorAssign($property);
// 0. already has default
if ($constructorAssign !== null) {
if ($node !== null) {
return null;
}
// 1. remove default options from database level

View File

@ -99,8 +99,8 @@ CODE_SAMPLE
}
// remove parent class
$node->extends = null;
$entityObjectType = $this->entityObjectTypeResolver->resolveFromRepositoryClass($node);
$genericObjectType = new GenericObjectType('Doctrine\\ORM\\EntityRepository', [$entityObjectType]);
$subtractableType = $this->entityObjectTypeResolver->resolveFromRepositoryClass($node);
$genericObjectType = new GenericObjectType('Doctrine\\ORM\\EntityRepository', [$subtractableType]);
// add $repository property
$this->classInsertManipulator->addPropertyToClass($node, 'repository', $genericObjectType);
// add $entityManager and assign to constuctor

View File

@ -9,7 +9,7 @@
"require-dev": {
"rector\/rector-src": "dev-main",
"phpunit\/phpunit": "^9.5",
"phpstan\/phpstan": "^1.8",
"phpstan\/phpstan": "^1.8.2",
"symplify\/phpstan-rules": "^11.0",
"symplify\/phpstan-extensions": "^11.0",
"symplify\/easy-coding-standard": "^11.0",