You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error on line no. 68. What am I doing wrong? The dumped type seems to match what is compatible.
On line no. 113, the error makes absolutely sense. But what I attempted was to declare in getAttributeValue()'s docblock that the returned type depends on the passed key as well. This doesn't seem to be possible right now (and possibly never will, which I'd also understand), correct?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey there,
I played around with the offset access example and wanted to use objects as values instead of native types.
The result is: https://phpstan.org/r/bae10bc5-2d88-4e97-b656-32d8be02bca8
There are two questions though:
getAttributeValue()
's docblock that the returned type depends on the passed key as well. This doesn't seem to be possible right now (and possibly never will, which I'd also understand), correct?Beta Was this translation helpful? Give feedback.
All reactions