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

11.15 breaks codebase #429

Closed
tomvo opened this issue Aug 27, 2024 · 6 comments
Closed

11.15 breaks codebase #429

tomvo opened this issue Aug 27, 2024 · 6 comments
Assignees
Labels

Comments

@tomvo
Copy link

tomvo commented Aug 27, 2024

Describe the bug
setDefaultLocale(): Return value must be of type Astrotomic\Translatable\Contracts\Translatable, App\Route returned

This happened when upgrading minor version to .15 and to be honest I don't think return type changes should be part of minor version jumps.

background
I'm setting the default locale of a specific model in an observer based on a DB value so that an object is always returned in the language the user forces it in.

@tomvo tomvo added the bug label Aug 27, 2024
@Gummibeer
Copy link
Member

So you return your model but your model does implement the interface?

@Oleksandr-Moik
Copy link
Contributor

@Gummibeer, Yes, I can confirm. In my own experience, my colleagues and I don't always implement the interface in a model, we just a trait and that's enough for us.

Therefore, I suggest to use only phpdoc, at least for now.

Type added in b46b3cc18140a54af3ecba7938f58569dcae86d6

@Gummibeer
Copy link
Member

Thanks for confirmation. I will release a fix that will revert the interface type changes.

@Gummibeer
Copy link
Member

Gummibeer commented Aug 28, 2024

With e6b3c13 & 18d1328 I fix the type changes introduced in #406

@Gummibeer
Copy link
Member

@Gummibeer Gummibeer self-assigned this Aug 28, 2024
@tomvo
Copy link
Author

tomvo commented Aug 28, 2024

hey @Gummibeer sorry for my late reply and missing background info but I'm glad @Oleksandr-Moik added some more details as that was indeed the scenario.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Development

No branches or pull requests

3 participants