From 002b2eab60c03a41c0be709710300d22776b07a5 Mon Sep 17 00:00:00 2001 From: Jonas Staudenmeir Date: Tue, 19 Dec 2023 12:58:06 +0100 Subject: [PATCH] Improve IDE helper model hook --- src/IdeHelper/BelongsToThroughRelationsHook.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/IdeHelper/BelongsToThroughRelationsHook.php b/src/IdeHelper/BelongsToThroughRelationsHook.php index 99bf185..574c184 100644 --- a/src/IdeHelper/BelongsToThroughRelationsHook.php +++ b/src/IdeHelper/BelongsToThroughRelationsHook.php @@ -25,7 +25,8 @@ public function run(ModelsCommand $command, Model $model): void $methods = (new ReflectionClass($model))->getMethods(ReflectionMethod::IS_PUBLIC); foreach ($methods as $method) { - if ($method->isStatic() || $method->getNumberOfParameters() > 0) { + if ($method->isAbstract() || $method->isStatic() || !$method->isPublic() + || $method->getNumberOfParameters() > 0 || $method->getDeclaringClass()->getName() === Model::class) { continue; }