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

String increment on numeric string #6166

Merged
merged 7 commits into from
Jul 24, 2021

Conversation

orklah
Copy link
Collaborator

@orklah orklah commented Jul 23, 2021

This PR allows incrementing on a numeric-string without triggering StringIncrement as this is most probably on purpose. Also, it fixes the resulting type from non-empty-string to float|int. This is particularly useful when working with numeric array-keys due to PHP shenanigans that cast string to int

@orklah
Copy link
Collaborator Author

orklah commented Jul 23, 2021

(I've also added documentation for TNonEmptyString and TNonFalsyString in the class because I keep confusing myself between the two and I did it again on this PR when I wondered if "hello"++ should result in TNonEmptyString or TNonFalsyString)

@orklah orklah force-pushed the StringIncrementOnNumericString branch from 668a2f8 to 4b660aa Compare July 24, 2021 19:17
@weirdan weirdan merged commit aa23aa5 into vimeo:master Jul 24, 2021
@weirdan
Copy link
Collaborator

weirdan commented Jul 24, 2021

Thanks!

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.

None yet

2 participants