Skip to content

Commit a7ee6d4

Browse files
committed
fixup! fixup! add nullable property doclbock support to RemoveNullFromNullableCollectionTypeRector
1 parent a574ca3 commit a7ee6d4

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

rules/TypedCollections/Rector/ClassMethod/RemoveNullFromNullableCollectionTypeRector.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,7 @@ private function refactorProperty(Property $property): ?Property
133133
return null;
134134
}
135135

136-
if (! $property->type instanceof Name) {
137-
return null;
138-
}
139-
140-
if (! $this->isName($property->type, DoctrineClass::COLLECTION)) {
136+
if (! $this->hasNativeCollectionType($property)) {
141137
return null;
142138
}
143139

@@ -156,4 +152,13 @@ private function refactorProperty(Property $property): ?Property
156152

157153
return $property;
158154
}
155+
156+
private function hasNativeCollectionType(Property $property): bool
157+
{
158+
if (!$property->type instanceof Name) {
159+
return false;
160+
}
161+
162+
return $this->isName($property->type, DoctrineClass::COLLECTION);
163+
}
159164
}

0 commit comments

Comments
 (0)