mirror of
https://github.com/pestphp/pest.git
synced 2026-03-07 08:17:22 +01:00
feat(describe): continues work around hooks
This commit is contained in:
@ -31,7 +31,7 @@ final class ChainableClosure
|
||||
/**
|
||||
* Calls the given `$closure` and chains the `$next` closure.
|
||||
*/
|
||||
public static function from(Closure $closure, Closure $next): Closure
|
||||
public static function fromSameObject(Closure $closure, Closure $next): Closure
|
||||
{
|
||||
return function () use ($closure, $next): void {
|
||||
if (! is_object($this)) { // @phpstan-ignore-line
|
||||
@ -43,6 +43,17 @@ final class ChainableClosure
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls the given `$closure` and chains the `$next` closure.
|
||||
*/
|
||||
public static function fromDifferentObjects(Closure $closure, Closure $next): Closure
|
||||
{
|
||||
return function () use ($closure, $next): void {
|
||||
$closure(...func_get_args());
|
||||
$next(...func_get_args());
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Call the given static `$closure` and chains the `$next` closure.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user