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

feat(php): Support literal types #5991

Merged
merged 15 commits into from
Feb 13, 2025
Merged

feat(php): Support literal types #5991

merged 15 commits into from
Feb 13, 2025

Conversation

ajgateno
Copy link
Member

No description provided.

@ajgateno ajgateno requested a review from dsinghvi as a code owner February 13, 2025 20:25
@amckinney
Copy link
Member

Discussed offline w/ @ajgateno - with the amount of one-off handling we need to accommodate setting literals under the hood, this feels bug prone and easy to mess up.

To start, we'll take on a design similar to the literal experience in TypeScript - strongly type each call-site in PHPDoc comments, but still require the user to specify them by hand in the constructor. We can always improve this experience later on if there's enough reason to, but this feels like the right middle ground to start.

Copy link
Member

@amckinney amckinney left a comment

Choose a reason for hiding this comment

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

Few nits + updates in the error messages we throw.

Copy link
Member

@amckinney amckinney left a comment

Choose a reason for hiding this comment

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

Looks good - some of the large unions have really large PHPDoc comments, but it feels safer to start in the more strict manner, and relax that requirement later on (if ever).

@ajgateno ajgateno merged commit ea08bd2 into main Feb 13, 2025
13 of 14 checks passed
@ajgateno ajgateno deleted the alberto/literal-support branch February 13, 2025 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants