Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Narrowing types utilizing two conditional types #13742

Unanswered
coleshirley asked this question in Support
Discussion options

There are 4 properties on this object

  1. a boolean
  2. a nullable string which is always set if 1 is true
  3. a nullable string with is always set if 1 is false and sometimes set if 1 is true
  4. a virtual property which is the null coalesce of 4 ?? 3

Logically 4 will always be able to return a set string but I cannot figure out how to get phpstan to recognize that properly

https://phpstan.org/r/5fd9fb96-8259-4c8d-b206-f84b7aff3799

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Support
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /