mirror of
https://github.com/pestphp/pest.git
synced 2026-03-08 00:37:22 +01:00
release: v3.2.0
This commit is contained in:
@ -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.');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user