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

Literal float methods to Union type #6252

Merged
merged 1 commit into from Aug 6, 2021

Conversation

boesing
Copy link
Contributor

@boesing boesing commented Aug 6, 2021

Hey there,

I recently started to write a plugin to handle #5040
I tried to receive the value of a float type but then realized that the union type lacks methods for literal float.
In that plugin, i definitely could use Union#isSingleFloatLiteral along with Union#getSingleFloatLiteral and Union#hasLiteralFloat.

This, I'd like to add these methods with this PR. If anything is missing, feel free to hit me up.

@boesing boesing force-pushed the feature/union-float-literal branch from 39d31d0 to 02c14fb Compare August 6, 2021 19:01
src/Psalm/Type/Union.php Outdated Show resolved Hide resolved
src/Psalm/Type/Union.php Outdated Show resolved Hide resolved
- Added `Psalm\Type\Union#isSingleFloatLiteral`
- Added `Psalm\Type\Union#getSingleFloatLiteral`
- Added `Psalm\Type\Union#hasLiteralFloat`

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
@boesing boesing force-pushed the feature/union-float-literal branch from 02c14fb to 9d59fbe Compare August 6, 2021 19:05
@boesing
Copy link
Contributor Author

boesing commented Aug 6, 2021

Not sure why Unit Tests - 6 was cancelled x_O

@weirdan weirdan merged commit cccfe75 into vimeo:master Aug 6, 2021
@weirdan
Copy link
Collaborator

weirdan commented Aug 6, 2021

Thanks!

@boesing boesing deleted the feature/union-float-literal branch August 6, 2021 20:29
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

3 participants