Skip to content

Commit

Permalink
Improve IDE helper model hook
Browse files Browse the repository at this point in the history
  • Loading branch information
staudenmeir committed Dec 19, 2023
1 parent 18b5d55 commit 002b2ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/IdeHelper/BelongsToThroughRelationsHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 002b2ea

Please sign in to comment.