Skip to content

Commit

Permalink
Fix Closure::bindTo() with $newScope = null
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek authored and ondrejmirtes committed Jun 20, 2022
1 parent 3926ff8 commit 6f306d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion resources/functionMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@
'Closure::__construct' => ['void'],
'Closure::__invoke' => ['', '...args='=>''],
'Closure::bind' => ['Closure', 'old'=>'Closure', 'to'=>'?object', 'scope='=>'object|string|null'],
'Closure::bindTo' => ['Closure', 'new'=>'?object', 'newscope='=>'object|string'],
'Closure::bindTo' => ['Closure', 'new'=>'?object', 'newscope='=>'object|string|null'],
'Closure::call' => ['', 'to'=>'object', '...parameters='=>''],
'Closure::fromCallable' => ['Closure', 'callable'=>'callable'],
'clusterObj::convertToString' => ['string'],
Expand Down
3 changes: 3 additions & 0 deletions tests/PHPStan/Rules/Methods/data/bug-7489.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@

\Closure::bind(function () {
}, null, null)();

(function () {
})->bindTo(null, null)();

0 comments on commit 6f306d0

Please sign in to comment.