Skip to content

Conversation

@HypeMC
Copy link

@HypeMC HypeMC commented Jan 21, 2026

@HypeMC HypeMC force-pushed the fix-13975 branch 8 times, most recently from a02e586 to 6d1e13c Compare January 22, 2026 04:07
if (
$this->isCallable()->yes()
&& $otherType->isCallable()->yes()
&& !($otherType->isObject()->yes() && $otherType->isInstanceOf(Closure::class)->yes())
Copy link
Author

Choose a reason for hiding this comment

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

@ondrejmirtes Hi, I'm not sure how to proceed here. I tried using instanceof, but PHPStan said I should use isObject() instead. Now I'm getting this error. Any advice?

Copy link
Contributor

Choose a reason for hiding this comment

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

see other similar spots in the codebase.
it need to look like (new ObjectType(Closure::class))->isSuperTypeOf(...)

$this->assertNoErrors($errors);
}

public function testBug13975(): void
Copy link
Contributor

@staabm staabm Feb 3, 2026

Choose a reason for hiding this comment

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

your test needs to be moved into a *RuleTest which relates to the error message you no longer want to have.

AnalyzerIntegrationTest is reserved for performance and crash-tests

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.

Invokable objects incorrectly labeled as instances of \Closure

2 participants