Skip to content

Commit

Permalink
Updated Rector to commit 1884cdd170c8a1f9580dea448fc79ede3e7e9802
Browse files Browse the repository at this point in the history
rectorphp/rector-src@1884cdd Skip Columns from TypedPropertyFromAssignsRector, as handled better in doctrine rules (#6254)
  • Loading branch information
TomasVotruba committed Aug 23, 2024
1 parent 85974b8 commit 5ffac16
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
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;
Expand Down Expand Up @@ -161,8 +162,7 @@ public function refactor(Node $node) : ?Node
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) {
Expand Down Expand Up @@ -217,4 +217,12 @@ private function decorateTypeWithNullableIfDefaultPropertyNull(Property $propert
}
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);
}
}
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit 5ffac16

Please # to comment.