You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recognize [$obj, $method] as callable when method_exists($obj, $method) is known true in scope
- In `ArrayHandler::resolveType()`, after computing the array type, check if
the 2-element array's `isCallable()` returns `maybe` and whether
`method_exists(item0, item1)` is known to be `true` in the current scope
- When both conditions are met, intersect the array type with `CallableType`,
making `isCallable()` return `yes` instead of `maybe`
- This fixes false positives from `CallCallablesRule` for patterns like:
`method_exists($obj, $method)` followed by `[$obj, $method]()`
- Also fixes the same pattern via `is_callable([$obj, $method])` for inline
arrays, since `IsCallableFunctionTypeSpecifyingExtension` delegates to
`MethodExistsTypeSpecifyingExtension` which stores the `method_exists`
result in scope
- Tested with: `$this`, class-string first element, `is_callable` inline
array, and if/else branching patterns
0 commit comments