Skip to content

Conversation

@jderusse
Copy link
Member

No description provided.

@jderusse jderusse force-pushed the psalm-fix branch 2 times, most recently from c7a50a7 to 6cb7dfa Compare July 24, 2025 08:21
@jderusse jderusse changed the title Help psalm to detect enum variables and avoid the More/LessSpecificReturn exceptions Fix typehint on enums to reflect that AWS might add new values Jul 24, 2025
@GrahamCampbell
Copy link
Contributor

Hmmm, but the type RuntimeName::*|string is identical to string, so we lose the value of having the specific string values.

@jderusse
Copy link
Member Author

Hmmm, but the type RuntimeName::*|string is identical to string, so we lose the value of having the specific string values.

Yeah, that's true. See the reasoning here #1921 (comment)

@stof
Copy link
Member

stof commented Oct 16, 2025

Based on the analysis of the official JS SDK (see #1921 (comment)), I'm not sure we should do this change.
Our current approach (returning the string as is but documenting the type as being one of the known values) is exactly what AWS does in their own SDK for JS and Typescript users.

@jderusse
Copy link
Member Author

Based on the analysis of the official JS SDK (see #1921 (comment)), I'm not sure we should do this change. Our current approach (returning the string as is but documenting the type as being one of the known values) is exactly what AWS does in their own SDK for JS and Typescript users.

I agree.

I took time to think about that and finally agreed with your initial suggestions. Returning a special a sdk unknown value.

I don't like adding an overhead for edge cases... but that the single way to make the typehint useful.

Or we just let it like that (like is does) and continue adding exception to PHP Stan.

@jderusse jderusse closed this Oct 18, 2025
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.

3 participants