Skip to content

Commit 40c5cd6

Browse files
committed
refactor
1 parent b55b335 commit 40c5cd6

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/Method/AssociationTableMixinClassReflectionExtension.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,15 @@ public function hasMethod(ClassReflection $classReflection, string $methodName):
5858
return true;
5959
}
6060
}
61-
6261
if (!$classReflection->is(Association::class)) {
6362
return false;
6463
}
65-
66-
$classReflection = $this->getAssociationTargetClassReflection($classReflection);
67-
if ($classReflection->hasNativeMethod($methodName)) {
64+
if (preg_match('/^find(All)?By/', $methodName) !== 1) {
6865
return false;
6966
}
67+
$classReflection = $this->getAssociationTargetClassReflection($classReflection);
7068

71-
return preg_match('/^find(All)?By/', $methodName) === 1;
69+
return !$classReflection->hasNativeMethod($methodName);
7270
}
7371

7472
/**

0 commit comments

Comments
 (0)