Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix: change return type of hasOne and belongsTo to nullable object type. #3979

Open
wants to merge 3 commits into
base: 2.x
Choose a base branch
from

Conversation

novacuum
Copy link

Maybe there is a different sollution than with UnionType, but I found no hints about setting the ObjectType as nullable one.

**Fixes: no issues **

Changes proposed in this pull request:
Change return type of hasOne and belongsTo to nullable object type in the RelationProperty Phpstan Reflection Class.

Reviewers should focus on:
Is this Valid in every case, is there a case where nullable is not true?

Screenshot

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension?
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).
  • Core developer confirmed locally this works as intended.
  • Tests have been added, or are not appropriate here.

iamdarkle and others added 3 commits May 27, 2023 11:29
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
Maybe there is a different sollution than with UnionType, but I found no hints about setting the ObjectType as nullable one.
@novacuum novacuum requested a review from a team as a code owner April 10, 2024 09:51
@SychO9 SychO9 changed the base branch from main to 2.x April 10, 2024 15:01
@SychO9 SychO9 changed the base branch from 2.x to main April 10, 2024 15:01
Copy link
Member

@SychO9 SychO9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@novacuum Thanks for the PR! could you base this on the 2.x branch instead?

@novacuum novacuum changed the base branch from main to 2.x April 11, 2024 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants