Skip to content

@property seems to be ignored on model classes #208

@brendt

Description

@brendt

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions