Updated Rector to commit 1884cdd170c8a1f9580dea448fc79ede3e7e9802

1884cdd170 Skip Columns from TypedPropertyFromAssignsRector, as handled better in doctrine rules (#6254)
This commit is contained in:
Tomas Votruba 2024-08-23 08:38:17 +00:00
parent 85974b8979
commit 5ffac169d7
2 changed files with 12 additions and 4 deletions

View File

@ -18,6 +18,7 @@ use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory;
use Rector\Contract\Rector\ConfigurableRectorInterface;
use Rector\DeadCode\PhpDoc\TagRemover\VarTagRemover;
use Rector\Doctrine\CodeQuality\Enum\CollectionMapping;
use Rector\Doctrine\Enum\MappingClass;
use Rector\Doctrine\NodeAnalyzer\AttrinationFinder;
use Rector\Php74\Guard\MakePropertyTypedGuard;
use Rector\PhpParser\Node\Value\ValueResolver;
@ -161,8 +162,7 @@ CODE_SAMPLE
if (!$property->isPrivate() && !$this->inlinePublic) {
continue;
}
// doctrine colleciton is handled in doctrine rules
if ($this->attrinationFinder->hasByMany($property, CollectionMapping::TO_MANY_CLASSES)) {
if ($this->isDoctrineMappedProperty($property)) {
continue;
}
if (!$classReflection instanceof ClassReflection) {
@ -217,4 +217,12 @@ CODE_SAMPLE
}
return TypeCombinator::addNull($inferredType);
}
/**
* Doctrine properties are handled in doctrine rules
*/
private function isDoctrineMappedProperty(Property $property) : bool
{
$mappingClasses = \array_merge(CollectionMapping::TO_MANY_CLASSES, CollectionMapping::TO_ONE_CLASSES, [MappingClass::COLUMN]);
return $this->attrinationFinder->hasByMany($property, $mappingClasses);
}
}

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'c9470e4aa3fe841a40b4b92e3c351a84ad9d7dc4';
public const PACKAGE_VERSION = '1884cdd170c8a1f9580dea448fc79ede3e7e9802';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-08-23 09:58:02';
public const RELEASE_DATE = '2024-08-23 08:35:43';
/**
* @var int
*/