release: v3.2.0

This commit is contained in:
Nuno Maduro
2024-09-23 13:14:03 +01:00
parent f291cd1603
commit a55da85dd2
13 changed files with 99 additions and 9 deletions

View File

@ -20,13 +20,13 @@ final class Closure
*/
public static function bind(?BaseClosure $closure, ?object $newThis, object|string|null $newScope = 'static'): BaseClosure
{
if ($closure == null) {
if (! $closure instanceof \Closure) {
throw ShouldNotHappen::fromMessage('Could not bind null closure.');
}
$closure = BaseClosure::bind($closure, $newThis, $newScope);
if ($closure == false) {
if ($closure === null) {
throw ShouldNotHappen::fromMessage('Could not bind closure.');
}