mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-19 06:18:07 +01:00
Updated Rector to commit 8b7c8c7d4f7ed05b36f595c01c632494193ba4bc
8b7c8c7d4f
[stabilize] Remove family tree check from ClassMethodParamVendorLockResolver as not reliable (#5536)
This commit is contained in:
parent
dc77b4b2a6
commit
b33dd4eba3
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'cbc077340ed5ee4a062caa32ab91cd8cb0d4ec6e';
|
||||
public const PACKAGE_VERSION = '8b7c8c7d4f7ed05b36f595c01c632494193ba4bc';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2024-01-31 21:37:40';
|
||||
public const RELEASE_DATE = '2024-01-31 21:41:35';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
@ -5,7 +5,6 @@ namespace Rector\VendorLocker\NodeVendorLocker;
|
||||
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
use PHPStan\Reflection\ClassReflection;
|
||||
use Rector\FamilyTree\Reflection\FamilyRelationsAnalyzer;
|
||||
use Rector\FileSystem\FilePathHelper;
|
||||
use Rector\NodeNameResolver\NodeNameResolver;
|
||||
use Rector\Reflection\ReflectionResolver;
|
||||
@ -16,11 +15,6 @@ final class ClassMethodParamVendorLockResolver
|
||||
* @var \Rector\NodeNameResolver\NodeNameResolver
|
||||
*/
|
||||
private $nodeNameResolver;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\FamilyTree\Reflection\FamilyRelationsAnalyzer
|
||||
*/
|
||||
private $familyRelationsAnalyzer;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Reflection\ReflectionResolver
|
||||
@ -31,10 +25,9 @@ final class ClassMethodParamVendorLockResolver
|
||||
* @var \Rector\FileSystem\FilePathHelper
|
||||
*/
|
||||
private $filePathHelper;
|
||||
public function __construct(NodeNameResolver $nodeNameResolver, FamilyRelationsAnalyzer $familyRelationsAnalyzer, ReflectionResolver $reflectionResolver, FilePathHelper $filePathHelper)
|
||||
public function __construct(NodeNameResolver $nodeNameResolver, ReflectionResolver $reflectionResolver, FilePathHelper $filePathHelper)
|
||||
{
|
||||
$this->nodeNameResolver = $nodeNameResolver;
|
||||
$this->familyRelationsAnalyzer = $familyRelationsAnalyzer;
|
||||
$this->reflectionResolver = $reflectionResolver;
|
||||
$this->filePathHelper = $filePathHelper;
|
||||
}
|
||||
@ -49,28 +42,12 @@ final class ClassMethodParamVendorLockResolver
|
||||
}
|
||||
/** @var string $methodName */
|
||||
$methodName = $this->nodeNameResolver->getName($classMethod);
|
||||
if ($this->hasTraitMethodVendorLock($classReflection, $methodName)) {
|
||||
return \true;
|
||||
}
|
||||
// has interface vendor lock? → better skip it, as PHPStan has access only to just analyzed classes
|
||||
if ($this->hasParentInterfaceMethod($classReflection, $methodName)) {
|
||||
return \true;
|
||||
}
|
||||
return $this->hasClassMethodLockMatchingFileName($classReflection, $methodName, '/vendor/');
|
||||
}
|
||||
private function hasTraitMethodVendorLock(ClassReflection $classReflection, string $methodName) : bool
|
||||
{
|
||||
$relatedReflectionClasses = $this->familyRelationsAnalyzer->getChildrenOfClassReflection($classReflection);
|
||||
foreach ($relatedReflectionClasses as $relatedReflectionClass) {
|
||||
foreach ($relatedReflectionClass->getTraits() as $traitReflectionClass) {
|
||||
/** @var ClassReflection $traitReflectionClass */
|
||||
if ($traitReflectionClass->hasMethod($methodName)) {
|
||||
return \true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return \false;
|
||||
}
|
||||
/**
|
||||
* Has interface even in our project?
|
||||
* Better skip it, as PHPStan has access only to just analyzed classes.
|
||||
|
2
vendor/scoper-autoload.php
vendored
2
vendor/scoper-autoload.php
vendored
@ -14,7 +14,7 @@ $loader = (static function () {
|
||||
// Restore the backup and ensure the excluded files are properly marked as loaded
|
||||
$GLOBALS['__composer_autoload_files'] = \array_merge(
|
||||
$existingComposerAutoloadFiles,
|
||||
\array_fill_keys(['0e6d7bf4a5811bfa5cf40c5ccd6fae6a', '5928a00fa978807cf85d90ec3f4b0147'], true)
|
||||
\array_fill_keys(['5928a00fa978807cf85d90ec3f4b0147', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a'], true)
|
||||
);
|
||||
|
||||
return $loader;
|
||||
|
Loading…
x
Reference in New Issue
Block a user