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 0dc38a2 commit c6b107d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/IdeHelper/JsonRelationsHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,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 c6b107d

Please sign in to comment.