Skip to content

Commit

Permalink
Use more generic-safe operations
Browse files Browse the repository at this point in the history
  • Loading branch information
alies-dev committed Jan 26, 2023
1 parent c94b0c1 commit 579d83a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Fakes/FakeModelsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@

use function config;
use function get_class;
use function in_array;
use function is_a;
use function in_array;
use function is_string;
use function implode;

/** @psalm-suppress PropertyNotSetInConstructor */
Expand Down Expand Up @@ -41,12 +42,12 @@ public function getModels(): array

// Bypass an issue https://github.com/barryvdh/laravel-ide-helper/issues/1414
foreach ($this->loadModels() as $probably_model_fqcn) {
if (is_a($probably_model_fqcn, Model::class, true)) {
if (is_string($probably_model_fqcn) && is_a($probably_model_fqcn, Model::class, true)) {
$models[] = $probably_model_fqcn;
}
}

return $this->model_classes + $models;
return [...$this->model_classes, ...$models];
}

/**
Expand Down

0 comments on commit 579d83a

Please sign in to comment.