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

Add Type::isScalar() #2149

Merged
merged 3 commits into from Dec 28, 2022
Merged

Add Type::isScalar() #2149

merged 3 commits into from Dec 28, 2022

Conversation

herndlm
Copy link
Contributor

@herndlm herndlm commented Dec 27, 2022

Returns yes for bool, float, int or string only. I found myself in need of something like that in the filter_var() extension. The alternative would be to combine isBoolean(), isFloat(), isInteger() and isString() of course, but that feels somehow wrong too.

src/Type/CallableType.php Outdated Show resolved Hide resolved
src/Type/JustNullableTypeTrait.php Outdated Show resolved Hide resolved
@ondrejmirtes ondrejmirtes merged commit 1e7b58a into phpstan:1.9.x Dec 28, 2022
@ondrejmirtes
Copy link
Member

Thank you!

@herndlm herndlm deleted the add-is-scalar branch December 28, 2022 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants