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
I have a method that returns an array that has a string key and a string backed enum value. When I define this shape as a template I get a type narrowing error, but when I type it directly I dont.
I dont understand why the template route gives me an error, AFAIK I'm abiding by the template by returning a narrower type, or in this instance a value of the enum...
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
Uh oh!
There was an error while loading. Please reload this page.
I have a method that returns an array that has a string key and a string backed enum value. When I define this shape as a template I get a type narrowing error, but when I type it directly I dont.
https://phpstan.org/r/f2fd19b9-2fc7-4b47-b5b4-11a8e3dce62a
I dont understand why the template route gives me an error, AFAIK I'm abiding by the template by returning a narrower type, or in this instance a value of the enum...
All reactions