Skip to content

Commit 185289a

Browse files
committed
add comment
1 parent 11a9a5f commit 185289a

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

rules/TypeDeclaration/Rector/ClassMethod/NarrowObjectReturnTypeRector.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ public function refactor(Node $node): ?Node
150150
}
151151

152152
// this rule narrows only object or class types, not interfaces
153+
// except private methods, as they are not part of contract, and not mockable from tests
153154
if (! $declaredTypeClassReflection->isClass() && ! $node->isPrivate()) {
154155
return null;
155156
}

0 commit comments

Comments
 (0)