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

use conditional return type for is_a() via stub #1310

Merged
merged 3 commits into from
May 13, 2022

Conversation

staabm
Copy link
Contributor

@staabm staabm commented May 13, 2022

@@ -1,5 +1,13 @@
<?php

/**
* @param mixed $object_or_class
Copy link
Contributor Author

Choose a reason for hiding this comment

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

couldn't we even use a conditional parameter type here?

Suggested change
* @param mixed $object_or_class
* @param ($allow_string is false ? object : object|class-string) $object_or_class

Copy link
Member

Choose a reason for hiding this comment

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

Try it after this PR is merged :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh my.. now I get what you was telling me in #1306 (comment) .. will send a 2nd PR ..

@staabm staabm changed the title use conditional parameter for is_a() via stub use conditional return type for is_a() via stub May 13, 2022
@ondrejmirtes ondrejmirtes merged commit 1f38c6c into phpstan:1.7.x May 13, 2022
@ondrejmirtes
Copy link
Member

Thank you!

@staabm staabm deleted the is-a-stub branch May 13, 2022 13:52
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