Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

@property seems to be ignored on model classes #208

Open
brendt opened this issue Dec 15, 2021 · 1 comment
Open

@property seems to be ignored on model classes #208

brendt opened this issue Dec 15, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@brendt
Copy link
Contributor

brendt commented Dec 15, 2021

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'
@brendt brendt added the bug Something isn't working label Dec 15, 2021
@caugner
Copy link
Contributor

caugner commented Jan 21, 2022

Duplicate of #193.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants