psalm-plugin-laravel
psalm-plugin-laravel copied to clipboard
`@property` seems to be ignored on model classes
I've got this model class:
/**
* @property-read \App\Domain\Equipment\State\ArticleCategoryType\ArticleCategoryType $type
* @property-read \App\Domain\Equipment\State\ArticleCategoryTarget\ArticleCategoryTarget $target
*/
class ArticleCategory extends Model
But whenever calling ->type on a model instance, Psalm things type is a string or null:
InvalidReturnType - app/Domain/Equipment/Models/ArticleCategory.php:159:32 - The declared return type 'App\Domain\Equipment\State\ArticleCategoryType\ArticleCategoryType' for App\Domain\Equipment\Models\ArticleCategory::getType is incorrect, got 'null|string'
Duplicate of #193.