diff --git a/src/Handlers/Eloquent/ModelPropertyHandler.php b/src/Handlers/Eloquent/ModelPropertyHandler.php index 4a11598..5f19705 100644 --- a/src/Handlers/Eloquent/ModelPropertyHandler.php +++ b/src/Handlers/Eloquent/ModelPropertyHandler.php @@ -11,6 +11,7 @@ use Illuminate\Database\Eloquent\Relations\MorphToMany; use PhpParser; use Psalm\Context; use Psalm\CodeLocation; +use Psalm\LaravelPlugin\Providers\ModelStubProvider; use Psalm\Type; use Psalm\StatementsSource; use function in_array; @@ -27,7 +28,7 @@ class ModelPropertyHandler implements /** @return array */ public static function getClassLikeNames() : array { - return \Psalm\LaravelPlugin\Plugin::$model_classes; + return ModelStubProvider::getModelClasses(); } /** diff --git a/src/Plugin.php b/src/Plugin.php index e5767f2..6e852d4 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -21,9 +21,6 @@ use function glob; class Plugin implements PluginEntryPointInterface { - /** @var array */ - public static $model_classes = []; - public function __invoke(RegistrationInterface $registration, ?SimpleXMLElement $config = null) : void { try {