Skip to content

Fix callable-string must be non-empty-string #3983

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

Open
wants to merge 1 commit into
base: 1.12.x
Choose a base branch
from

Conversation

aivchen
Copy link

@aivchen aivchen commented May 8, 2025

Copy link
Member

@ondrejmirtes ondrejmirtes left a comment

Choose a reason for hiding this comment

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

Instead of this approach, please explore modifying IntersectionType::isNonEmptyString() based on $this->isString()->yes() and $this->isCallable()->yes(). Thanks.

@aivchen aivchen marked this pull request as draft May 8, 2025 12:18
@staabm
Copy link
Contributor

staabm commented May 10, 2025

might also be worth checking whether we have a similar problem with callable-array and non-empty-array

@aivchen aivchen force-pushed the callable-string-non-empty branch from 4196540 to b5af16b Compare May 11, 2025 15:19
@aivchen
Copy link
Author

aivchen commented May 11, 2025

Instead of this approach, please explore modifying IntersectionType::isNonEmptyString() based on $this->isString()->yes() and $this->isCallable()->yes(). Thanks.

@ondrejmirtes I tried to implement your suggestion. Have a look please.

@aivchen aivchen marked this pull request as ready for review May 11, 2025 15:25
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@aivchen
Copy link
Author

aivchen commented May 11, 2025

might also be worth checking whether we have a similar problem with callable-array and non-empty-array

Let's do it in another issue, please. As I see the logic for arrays is completely different.

@aivchen aivchen requested a review from ondrejmirtes May 11, 2025 15: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.

4 participants